class
GUITextureField
GUI object that displays a field in which a Texture or a SpriteTexture can be dragged and dropped.
It also displays an optional label field. When a texture is referenced its image is displayed in the field.
Public
Methods
staticGetGuiTypeName
Returns type name of the GUI element used for finding GUI element styles.
SetTexture
Represents the texture currently referenced by the field, if any.
Will return null if a non-texture type is currently assigned to the field.
GetTexture
SetTextureReference
Equivalent to , but accessed through a resource reference.
GetTextureReference
SetSpriteImage
Represents the sprite image referenced by the field, if any.
Will return null if a non-sprite image type is currently assigned to the field
GetSpriteImage
SetSpriteImageReference
Equivalent to , but accessed through a resource reference.
GetSpriteImageReference
SetValue
Represents the resource referenced by the field.
Use this if you don't know if the field holds a Texture or SpriteImage
GetValue
SetValueReference
Equivalent to , but accessed through a resource reference.
GetValueReference
staticCreate
Creates a new GUI element.
- contents
- Structure describing the contents of the GUI element to create.
- styleClass
- Style class that will be used for determining GUI element visuals from the current style sheet. If no class is provided, default style is determined based on GUI element type.
- options
- Additional options that control GUI element size and position. This will override options set in the style sheet.
Fields
OnValueChanged
Triggered whenever the referenced texture changes.
Internal
Constructors
GUITextureField
Methods
UpdateLayoutForChildren
Calculates sizes and relative positions for all child elements.
Should be preceded with a call to UpdateOptimalLayoutSizes().
CalculateUnconstrainedOptimalSize
Calculates the optimal size for the GUI element, ignoring size constraints.
Private
Methods
~GUITextureField
SetUuid
Sets the texture referenced by the field by finding the texture with the provided UUID.
- uuid
- Unique resource identifier of the texture to show, or empty string if no texture.
- triggerEvent
- Determines should the onValueChanged() event be triggered if the new UUID is different from the previous one.
DataDropped
Triggered when a drag and drop operation finishes over this element.
OnDropButtonClicked
Triggered when the drop button that displays the game object label is clicked.
OnClearButtonClicked
Triggered when the clear button is clicked.