Animations
There is a simple way to create animations (or rather transitions) in guiSET. This works for all
values
based on numbers and colors. For the object you want to animate call the animate function, pass a String of
the property you want to animate, a final value this property shall take and the time in milliseconds. I.e.
myObject.animate("x", 20, 1000) to move myObject to x-Position 20px within 1000 milliseconds =
1 second.
The time in which the transition is performed will probably not match the given time very precisely as it is just estimated through the current sketch frame rate.
Animations do not work in the drawing mode NO_LOOP. Instead the value is just set immediately.
You can add as many different animations to an object as you like but when adding an animation of the same type as one that is still running the old animation is discarded.
Animatable properties for all components:
- x, y
- width, height, minWidth, maxWidth, minHeight, maxHeight
- backgroundColor, hoverColor, pressedColor, foregroundColor
- borderWidth, borderRadius, borderColor
- z
- paddingLeft, paddingRight, paddingTop, paddingBottom
- marginLeft, marginRight, marginTop, marginBottom
- fontSize
- opacity
And for other components
- all colors
- all sizes
- scrollPosition, scrollSpeed
Obviously only numeric values can be animated - no booleans (wtf), images and strings.
