Currently, these is no difference.
Use the StateModifier if you need setTransform
,setSize
,setOrigin
and setOpacity
.
Currently the Modifier still supports these methods, but they are Deprecated.
The StateModifier use a Transitionable, which can be used to smoothly transition between values. Just provide a transition when using these methods:
stateModifier.setTransform(Transform.rotateZ(Math.random()*Math.PI/2), { curve: 'easeOut', duration: 5000 });
The Modifier is more limited and uses transformFrom
,sizeFrom
,originFrom
and opacityFrom
. These methods can take in a value, getter-function, or an object with a get
function.