GridMenu
Extends: ItemList
Description
Custom Dungeondraft UI element that is meant to display assets. The underlying Godot type is Texture.
Properties
bool | ShowsPreview |
bool | CustomColorPreview |
bool | IsPatterns |
bool | ShowsItemText |
Dictionary | Lookup |
String | category |
Texture | Selected |
Methods
void | Load ( String category ) |
void | Reset ( ) |
void | ShowSet ( Texture[] thumbnails ) |
void | SelectTexture ( Texture texture ) |
void | MultiselectTexture ( Texture texture ) |
void | OnItemSelected ( int index ) |
void | OnMultiSelected ( int index, bool selected ) |
void | SelectPrevious ( ) |
void | SelectNext ( ) |
Texture[] | GetMultiselectedTextures ( ) |
void | SetCustomColor ( Color color ) |
Property Descriptions
- bool ShowsPreview:
Show a preview of the asset when the user mouses over.
- bool CustomColorPreview:
Colorize the icons whenever it is of an asset that can be custom colored.
- bool IsPatterns:
Must be enabled if you loaded a category of assets that is a pattern.
- bool ShowsItemText:
Display the name of the asset below its icon.
- Dictionary Lookup:
A Dictionary of String, int pairs that keys an asset's relative resource path to the index number in this menu. DO NOT MODIFY.
- String category:
The category of assets that was loaded. DO NOT MODIFY.
- Texture Selected:
Get the current selected asset as a Godot Texture.
Method Descriptions
- void Load ( String category ):
Load a category of assets into this GridMenu. Must be called for this to work. Valid Asset Categories.
- void Reset ( ):
Reload the assets.
- void ShowSet ( Texture[] thumbnails ):
Show only a certain subset of assets. Takes an array of thumbnail Texture only. Finicky.
- void SelectTexture ( Texture texture ):
Single-select an asset in the menu by its Texture if it exists in this category.
- void MultiselectTexture ( Texture texture ):
Multi-select an asset in the menu by its Texture if it exists in this category.
- void OnItemSelected ( int index ):
Called by the UI control when a user single-selects an asset. Not normally called manually.
- void OnMultiSelected ( int index, bool selected ):
Called by the UI control when a user multi-selects an asset. Not normally called manually.
- void SelectPrevious ( ):
Select the previous asset from the current cursor position.
- void SelectNext ( ):
Select the next asset from the current cursor position.
- Texture[] GetMultiselectedTextures ( ):
Get all the selected textures.
- void SetCustomColor ( Color color ):
Sets the preview color for custom color assets