Migrating guide from < 3.x
Fit
and Alignment
options to. There are also a few other enums for parameters that have changed slightly regarding loop modes and direction.
Fit | Before | After |
---|---|---|
Fill | .fitFill | .fill |
Contain | .fitContain | .contain |
Cover | .fitCover | .cover |
Fit Width | .fitFitWidth | .fitWidth |
Fit Height | .fitFitHeight | .fitHeight |
Scale Down | .fitScaleDown | .scaleDown |
None | .fitNone | .noFit |
Alignment | Before | After |
---|---|---|
Top Left | .alignmentTopLeft | .topLeft |
Top Center | .alignmentTopCenter | .topCenter |
Top Right | .alignmentTopRight | .topRight |
Center Left | .alignmentCenterLeft | .centerLeft |
Center | .alignmentCenter | .center |
Center Right | .alignmentCenterRight | .centerRight |
Bottom Left | .alignmentBottomLeft | .bottomLeft |
Bottom Center | .alignmentBottomCenter | .bottomCenter |
Bottom Right | .alignmentBottomRight | .bottomRight |
Loop Mode | Before | After |
---|---|---|
One Shot | loopOneShot | oneShot |
Loop | loopLoop | loop |
Ping Pong | loopPingPong | pingPong |
Auto | loopAuto | autoLoop |
Direction | Before | After |
---|---|---|
Backwards | directionBackwards | backwards |
Forwards | directionForwards | forwards |
Auto | directionAuto | autoDirection |
RiveViewModel
, the first animation made in the Rive file would play.
With v3, if no state machine or specific animation is specified, the first state machine (if one is created) in the Rive file will play. So if you prefer to keep your existing default behavior of the first animation, simply set the animationName
property on RiveViewModel
when creating it.