dropDown
Decorator that creates a dropdown selection control for properties in the inspector.
| Type | Name | Interface Description |
|---|---|---|
| Functions | dropDown(options: [string, string][]|[string, number][]): (target: any, key: string) => any | • Function: Decorator that creates a dropdown selection control for properties in the inspector. Allows selection from a predefined list of options. Parameters • Returns Property decorator function |
Example
@component()
export class QualitySettings extends APJS.BasicScriptComponent {
@serializeProperty()
@dropDown([
["Low", 0],
["Medium", 1],
["High", 2],
["Ultra", 3]
])
public graphicsQuality: number = 2;
@serializeProperty()
@dropDown([
["Windowed", "windowed"],
["Fullscreen", "fullscreen"],
["Borderless", "borderless"]
])
public displayMode: string = "windowed";
}