Components – Aspire Only

From SDK
Jump to navigation Jump to search
Back.jpg

This object is the base class for all the different types of components managed by the ComponentManager. There are two classes of Component available to Lua; Component itself and ComponentGroup. Components reference the Reliefs that were used to create them. It is possible to have multiple Components referring to the same original Relief and this should be kept in mind while manipulating Component data.

Properties

.Id

Interaction: Read Only

Returns: (UUID) the id of the component

.CombineMode

Interaction: Read and Write

Note: The combine mode of the component

.IsTilted

Interaction: Read Only

Returns: (bool) true if the component is tilted

.UseTilt

Interaction: Read and Write

Returns: (bool) Is the component using tilt

.IsFaded

Interaction: Read Only

Returns: (bool) true if the component is faded

.UseFade

Interaction: Read and Write

Returns: (bool) Is the component using fade

Methods

:Transform(Matrix2D xform, bool update_all)

Tranforms the component xform(Matrix2D)The transform update_all (bool) Update the entire bounds of the component tree

:SetZScaleAuto(bool auto_scale)

Determine whether transforming the component using:Transform() will automatically scale it in the Z axis, as well. auto_scale(bool) Flag which determine whether Z is scaled.

:SetZOffset(float z_offset)

Set the Z offset of the component

z_offset (float) The amount by which to offset the component

:SetZScale(float scale)

Scale the Z heights of the component

scale (float) The amount by which to scale the heights of the component

:TiltWouldChange(Point2D anchor_pt, Point2D direction_pt, double tilt_angle, bool do_tilt)

Returns: (bool) true if the parameters would change the current tilt anchor_pt(Point2D)Start of vector determining tilt direction direction_pt (Point2D) End of vector determining tilt direction tilt_angle(double) The angle to tilt at in degrees do_tilt (bool) If true we want to apply a tilt

:SetTilt(Point2D anchor_pt, Point2D direction_pt, double tilt_angle)

Returns: (bool) true if the component was tilted successfully

anchor_pt(Point2D)Start of vector determining tilt direction direction_pt (Point2D) End of vector determining tilt direction tilt_angle(double) The angle to tilt at in degrees

:GetTiltData(Point2D anchor_pt, Point2D direction_pt)

Returns: the tilt angle and the passed points are updated to contain the components tilt anchor and directions points

anchor_pt(Point2D)Start of vector determining tilt direction direction_pt (Point2D) End of vector determining tilt direction

local anchor_pt = Point2D() local direction_pt = Point2D() local tilt_angle = component:GetTiltData(anchor_pt, direction_pt)

:FadeWouldChange(Point2D anchor_pt, Point2D direction_pt, double end_fade_val, bool do_fade)

Returns: (bool) true if the parameters would change the current fade

anchor_pt(Point2D)Start of vector determining fade direction direction_pt (Point2D) End of vector determining fade direction end_fade_val(double) The final value of the fade do_fade(bool) If true we want to apply a fade

:SetFade(Point2D anchor_pt, Point2D direction_pt, double tilt_angle)

Returns: (bool) true if the component was faded successfully

anchor_pt(Point2D)Start of vector determining fade direction direction_pt (Point2D) End of vector determining fade direction end_fade_val(double) The final value of the fade

:GetFadeData(Point2D anchor_pt, Point2D direction_pt)

Returns: the end fade value and the passed points are updated to contain the components fade anchor and directions points

anchor_pt(Point2D)Start of vector determining fade direction direction_pt (Point2D) End of vector determining fade direction

local anchor_pt = Point2D() local direction_pt = Point2D() local tilt_angle = component:GetTiltData(anchor_pt, direction_pt)

:GetRelief()

Returns: the Relief for the component. If the component is a ComponentGroup then this will return nil. Please note any changes made to this relief will affect the appearance of any other components that reference this Relief


Back.jpg

References

Please Note: The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 10.0, published August 21, 2019. by Vectric Ltd. Most current document from Vertric can be downloaded at Vertric Developer Information