Controls

Most control types in EZ GUI are animatable if you also own SM2 and include it with your project. For information on animation-related settings not covered here, please see the SM2 documentation.

Setting up

Setting up a control is very straight-forward. Setup for most control types is virtually identical. See Creating a control for the common setup steps (using a Button as the example). See the individual pages for each control type below for information about settings peculiar to that type:

Sprite-based control settings

In addition to the settings listed below, unmanaged sprites/controls must be assigned a material. A default material is provided called "Sprite Material" which has common default settings. You can duplicate and modify this as needed to create materials you will use for your controls.

Sprites/controls which share a common material will be packed together onto the same atlas. Managed sprites, on the other hand, must be assigned to a SpriteManager object. Managed sprites which share a SpriteManager will be packed together onto the same atlas. So to keep draw calls down, try to have as many controls as possible use the same material (for unmanaged controls) or use the same SpriteManager (for managed controls).

All sprite-based controls share the common settings listed below:
Managed
Sets whether or not the sprite will be managed by a SpriteManager. When managed, a sprite does not have its own mesh, but rather is combined with other sprites into a single mesh. For more information, see Managed Sprites.
Manager
[Managed Only] The SpriteManager object that will manage this sprite. This can only be set if "Managed" is checked. For more information, see Managed Sprites.
Draw Layer
[Managed Only] The layer in which this sprite will be drawn. Lower draw layer values result in an earlier drawing order. Sprites with higher draw layer values will appear to be drawn in front of sprites with lower draw layer values. This value only has meaning if the sprite is managed. For more information, see Managed Sprites.
Persistent
When checked, the sprite will not be automatically destroyed when a new scene is loaded.
Plane
The plane in which the sprite will be drawn. i.e. XY, XZ, or YZ.
Winding
Whether sprite polygons should be wound clock-wise or counter clock-wise. Determines which side of the sprite is considered by the renderer to be the "front".
Width
Height
The dimensions of the sprite in local space.
Bleed Compensation
Bleed compensation can be used to adjust for "bleed" that can occur with texture filtering. When two sprites are close together on an atlas, filtering can cause pixels from adjacent images to "bleed" into the one you are showing. If this occurs, try setting this value to 0.5,0.5. Depending on how severe it is and what mip level your game is using at a given time, this value may need to be increased from there.
Anchor
How the sprite will be "anchored" relative to its center. Ex: if UPPER_LEFT is selected, the GameObject center will be at the upper-left corner of the sprite, and all sprite growth will take place downward and toward the right. TEXTURE_OFFSET is a special anchoring mode that centers the sprite relative to its GameObject's center according to how the sprite was centered in the original source texture.
Pixel Perfect
When enabled, the sprite will always be sized pixel-perfect at runtime. This means regardless of screen resolution, the sprite will always be drawn at its "native" size. Ex: a 32x32 sprite will always be drawn using 32x32 screen pixels, regardless of resolution. NOTE: If the object moves relative to a perspective camera, the sprite's/control's SetCamera() method will need to be called and passed a reference to the camera to ensure it updates its size to remain pixel-perfect at the new location.
Auto Resize
When changing states or animating (Requires SM2), the sprite's proportions will be automatically adjusted according to the original source texture, so that there is no warping or distortion.
Offset
Distance the sprite will be offset, in local space, from its GameObject's center.
Color
The color the sprite will be tinted. This can also be used to apply a fade to the sprite by changing the alpha.
Render Camera
The camera that will be used to render the sprite. If left empty, this will default to the main camera.
Hide At Start
When checked, the object will be hidden initially until it is unhidden by calling:
obj.Hide(false);
Ignore Clipping
When true, the control will not be clipped.
Text
Text that appears in the control's "control_text" child object, if any. When text is added to this field for the first time, a child GameObject with a SpriteText component is created using the default font specified in the scene's UIManager object's "Default Font" member. If no default font is set, no child GameObject or SpriteText will be created.
Sprite Text
Reference to the TextMesh component of the child GameObject that serves to display text associated with the control.
Text Offset Z
The distance along the Z-axis that the child SpriteText (if any) will be offset from the object itself to avoid depth-fighting.
Include Text In Auto Collider
When set to true, any automatically-generated collider for this control will take into account the extents of the child text object (if any). If you want the text to only be for show and not part of the control's clickable area, keep this set to false.
Detarget On Disable
When set to true, the control will instruct any pointers which have it as their target to de-target them. Use this if you are deactivating a control and want no input to go to it.
NOTE: It is strongly recommended NOT to use this feature on any control that appears in a scroll list, or else you may be unable to scroll past the edge of the list's viewable area.
Data
(Only accessible in script.) A property that gets/sets a reference to a System.Object. This means you can assign anything to the Data property and retrieve it later. This is useful for associating relevant information to a control so that you can easily access it later.
Is Draggable
Indicates whether the object can be dragged as part of a drag & drop operation.
Drop Mask
A mask which can be used to make the object only be "droppable" on objects in a certain layer.
NOTE: This mask is combined with the camera's mask.
Drag Offset
The distance an object being dragged and dropped should be offset toward the camera to ensure it hovers above other objects and controls in the scene.
A value of NaN indicates the default value will be used from the UIManager.
Cancel Drag Easing
The type of easing to use to animate the object back to its starting position when a drag operation is canceled.
Cancel Drag Duration
The duration of the easing animation when a drag and drop operation is canceled. A value of -1 indicates to use the default value specified in the UIManager.
Drop Mask