UI / Dropdown
Dropdown Class
Dropdown
Hierarchy
↳
Dropdown
Table of contents
Properties
click
Properties
onCustomPropertyChange: Readonly <MulticastDelegate <(path : string , value : unknown , oldValue : unknown ) => void >> other |
---|
Monitor custom attribute synchronization events |
Accessors
dropdownStyle(): DropdownStyle other |
---|
Menu Style |
isOpened(): boolean other |
Get whether the menu is open or not |
menuRowStyle(): ListItemStyle other |
ListItem Style Style Style |
onOpeningEvent(): MulticastDelegate <() => void > other |
Trigger event before opening the Dropdown |
onSelectionChangedEvent(): MulticastDelegate <(item : string , select : SelectInfo ) => void > other |
Select Change Event |
optionCount(): number other |
Get the number of menu items |
options(): string [] other |
Get all menu items |
scrollbarStyle(): ScrollbarStyle other |
Scroll bar style |
selectedOption(): string other |
Get the current selected item |
selectedOptionIndex(): number other |
Retrieve the dropdown index of the selected item |
textStyle(): TextStyle other |
Text style |
click
Accessors
alignPosition(): Readonly <Vector2 > other |
---|
Get the align position of the widget. When the align method is right align, bottom align, and center align, the value of alignPosition is different from that of position; |
autoSizeHorizontalEnable(): boolean other |
Get whether to automatically set the size horizontally |
autoSizeVerticalEnable(): boolean other |
Get whether to set the size automatically vertical |
cachedGeometry(): Geometry other |
Get the previous Get TickSpaceGeometry |
constraints(): Readonly <UIConstraintAnchors > other |
Get the layout of the control |
desiredSize(): Vector2 other |
Obtain expected size |
enable(): boolean other |
Is it available |
guid(): string other |
Get the widget GUID |
isHovered(): boolean other |
Is it hovered |
mouseCursor(): MouseCursor other |
Get the cursor type on the widget |
name(): string other |
Get Name |
paintSpaceGeometry(): Geometry other |
Get the last geometric information used to render the Widget |
parent(): Widget other |
Get parent node |
pivot(): Vector2 other |
Get the position of the widget anchor. This property determine the relative position of the widget graph and the anchor; At (0,0), the anchor point is located in the upper left corner of the control; (0.5,0.5), the anchor is at the center of the widget |
position(): Readonly <Vector2 > other |
Get the position of the control |
renderOpacity(): number other |
Obtain rendering transparency |
renderScale(): Vector2 other |
Get rendering scaling |
renderShear(): Vector2 other |
Obtain rendering misalignment deformation |
renderTransformAngle(): number other |
Obtain the rendering angle |
renderTransformPivot(): Vector2 other |
Get Render anchor |
size(): Vector2 other |
Get size |
tickSpaceGeometry(): Geometry other |
Retrieve the last geometric information used to drive Widget Tick |
transform(): Readonly <UITransform > other |
Obtain the size and position of the control |
visibility(): SlateVisibility other |
Get visibility |
visible(): boolean other |
Is it visible |
zOrder(): number other |
Get Zorder |
Methods
addOption(option : string ): void other |
---|
Add menu items |
clearOptions(): void other |
Clear all menu items |
clearSelection(): void other |
Clear all selections |
findOptionIndex(option : string ): number other |
Get dropdown order coordinates |
getOptionByIndex(index : number ): string other |
Menu item content |
getShowTextVisible(): boolean |
removeOption(option : string ): void other |
Remove menu item |
setOptionByIndex(index : number , value : string ): void other |
Modify the value at the index |
setShowTextVisible(bVisible ): void |
newObject(parent? : Canvas , inName? : string ): Dropdown other |
Create Canvas widget When the parent and inName are the same as the existing object, the old object will be destroyed |
click
Methods
addChild(child : Widget ): void other |
---|
Add child nodes |
clone(position : Vector2 , Parent? : any ): Widget other |
Clone the UI widget and its child nodes to the specified parent widget position (default to its parent node) |
destroyObject(): void other |
Remove and destroy immediately. Cannot be used again |
equal(that : Widget ): boolean other |
Determine if it is the same object |
findChildByPath(inPath : string ): Widget other |
Find nodes by relative path |
getChildAt(index : number ): Widget other |
What is the position node to obtain |
getChildByName<T : extends Widget <T >>(name : string ): T : extends Widget <T > other |
Search for nodes by name |
getChildrenCount(): number other |
Obtain the number of child nodes |
getCustomProperties(): string [] other |
Get all customize property |
getCustomProperty<T : extends CustomPropertyType >(propertyName : string ): T : extends CustomPropertyType other |
Get customize property |
getCustomPropertyChangeDelegate(property ): Readonly <MulticastDelegate <(path : string , value : unknown , oldValue : unknown ) => void >> other |
Event proxy triggered when a given object property is modified |
invalidateLayoutAndVolatility(): void other |
Immediately trigger re rendering and layout calculation |
removeAllChildren(): void other |
Clearing all child nodes will destroy the UI and render it unusable |
removeChild(child : Widget ): void other |
Removing a node will destroy the UI and make it unusable |
removeChildAt(index : number ): void other |
Removing the third node will destroy the UI and render it unusable |
removeObject(): void other |
Immediately remove and add to the root node for reuse |
serialize(): string other |
Serialize UI widget |
setCustomProperty(propertyName : string , value : undefined CustomPropertyType ): void other |
Set custom attributes |
deserialize(Data : string , Parent? : Widget ): Widget other |
Deserialize UI |
Properties
Accessors
dropdownStyle
• | ||
---|---|---|
Menu Style Returns
|
isOpened
• | ||
---|---|---|
Get whether the menu is open or not Returns
|
menuRowStyle
• | ||
---|---|---|
ListItem Style Style Style Returns
|
onOpeningEvent
• | ||
---|---|---|
Trigger event before opening the Dropdown Returns
|
onSelectionChangedEvent
• | ||
---|---|---|
Select Change Event Returns
|
optionCount
• | ||
---|---|---|
Get the number of menu items Returns
|
options
• | • | ||||
---|---|---|---|---|---|
Get all menu items Returns
| Get all menu items Parameters
|
scrollbarStyle
• | ||
---|---|---|
Scroll bar style Returns
|
selectedOption
• | • | ||||
---|---|---|---|---|---|
Get the current selected item Returns
| Select items before setting Parameters
|
selectedOptionIndex
• | • | ||||
---|---|---|---|---|---|
Retrieve the dropdown index of the selected item Returns
| Set dropdown index for selected items Parameters
|
textStyle
• |
---|
Text style Returns |
TextStyle | Return text style |
---|
Methods
addOption
• addOption(option
): void
other
Add menu items
Parameters
option string | Menu item range: No restrictions, reasonable is sufficient. |
---|
clearOptions
• clearOptions(): void
other
Clear all menu items
clearSelection
• clearSelection(): void
other
Clear all selections
findOptionIndex
• findOptionIndex(option
): number
other
Get dropdown order coordinates
Parameters
option string | Menu item range: No restrictions, reasonable is sufficient. |
---|
Returns
number | Pull down sequence coordinates |
---|
getOptionByIndex
• getOptionByIndex(index
): string
other
Menu item content
Parameters
index number | Drop down order coordinates range: No restrictions, reasonable is sufficient. |
---|
Returns
string | Retrieve menu item content |
---|
getShowTextVisible
• getShowTextVisible(): boolean
Get visibility of the selected text displayed
removeOption
• removeOption(option
): void
other
Remove menu item
Parameters
option string | Menu item range: No restrictions, reasonable is sufficient. |
---|
setOptionByIndex
• setOptionByIndex(index
, value
): void
other
Modify the value at the index
Parameters
index number | Index range: The corresponding index value, without any restrictions< Br>type: integer |
---|---|
value string | Value range: No restrictions. |
setShowTextVisible
• setShowTextVisible(bVisible
): void
Set the visibility of the selected text displayed
newObject
• Static
newObject(parent?
, inName?
): Dropdown
other
Create Canvas widget When the parent and inName are the same as the existing object, the old object will be destroyed
Parameters
parent? Canvas | Usage: Create the external parent object of the control with default: null |
---|---|
inName? string | Usage: the name of the create widget default: null range: no restrictions, just reasonable. |
Returns
Dropdown | Return the created object |
---|
bVisible | boolean |
---|