GH_Stack
ReferencesRepresents a manager for animating asynchronous box movements. This is a useful feature for GUIs that want to mimic physical behaviour or continuous UI changes.
Remarks: This class is ABSOLUTELY NOT Thread-safe.
Constructors
Properties
Duration
#Gets or sets the duration (in milliseconds) of individual frame animations. This change is only applied to new animations. Existing animations will keep the duration set at construction.
Element_Final
#Gets or sets the target dimenions of the stack element at the given index. If you overwrite the existing value with a different value, a new animation will be initiated for this stack element. If you wish to retrieve the current (based on system time) stack element dimensions, you should use the Intermediate readonly property.
Parameters:
| index (int) | Index of stack element. |
Exceptions:
| IndexOutOfRangeException | Thrown if index does not represent a valid index in the stack. |
Element_Initial
#Gets the starting dimensions of the stack element at the given index.
Parameters:
| index (int) | Index of stack element. |
Exceptions:
| IndexOutOfRangeException | Thrown if index does not represent a valid index in the stack. |
Element_Intermediate
#Gets the intermediate dimensions for the specified physical stack element as determined by the current system time.
Parameters:
| index (int) | Index of stack element. |
InMotion
#Gets a value that indicates whether or not any element in this stack is currently in motion.
Returns: True if the stack is still (partly) in motion.
InMotion
#Gets a value that indicates whether or not the element at the given index is currently in motion.
Parameters:
| index (int) | Index of element. |
Returns: True if the element hasn't yet reached its final location.
Interpolation
#Gets or sets the interpolation mode for stack animations. Cubic results in a more natural motion. Although you can change the interpolation during animation, it might result in a discontinuous motion. You should set the desired interpolation algorithm during or directly after construction of this stack.
public GH_Interpolation Interpolation { get; set; }
UpdateInterval
#Gets or sets the interval (in milliseconds) for update events.
Value: The number of milliseconds between update intervals.
Exceptions:
| InvalidConstraintException | Thrown when the interval is set to less than 5 milliseconds. |
Methods
AddElement
#Add a new animated element to the stack.
public void AddElement()
Rectangle
rec_0,
Initial dimensions of element.
Rectangle
rec_1,
Final dimensions of element.
duration_override
Duration of animation in milliseconds.
AddElement
#Add a new animated element to the stack.
public void AddElement()
Rectangle
rec_0,
Initial dimensions of element.
Rectangle
rec_1
Final dimensions of element.
AddElement
#Add a new static element to the stack.
public void AddElement()
Rectangle
rec
Dimensions of new element.
Destroy
#Call this function when you are certain you will no longer need the stack. It will disable any current update events and clear animation instances.
public void Destroy()
InsertElement
#Add a new animated element to the stack.
InsertElement
#Add a new animated element to the stack.
public void InsertElement()
index,
Insertion index.
Rectangle
rec_0,
Initial dimensions of element.
Rectangle
rec_1
Final dimensions of element.
ResizeContainer
#Call this function to override the width or height of all elements without interfering with the animation.
SetNewTarget
#Set new target dimenions for the given object.
SetOwner
#public void SetOwner()
Control
ui_thread_owner,
ui_thread_update,
ui_thread_complete