A clickable icon that fires IconClicked_${name} messages.

export class MyGUI extends Component {
@link("GraphicsEngine:typesprite")
private graphics:GraphicsEngine;

@res("sheet", "path/to/main.sheet.json")
private sheet:SpriteSheet;

onInit() {
const icon = new LUIIconButton(
this.sheet,
"heart"
).setName("ExitSpace");
// ^^^^^^^^^
this.graphics.gui.addChild(icon);
}

onMessage_IconClicked_ExitSpace() {
// ^^^^^^^^^
console.log("click-element was clicked! :-)");
}
}

Compared to LUIIconButton this has no background and the clicking


⚠️ experimental

Hierarchy

Constructors

Properties

_isDown: boolean = false
iconAnimation: string
iconClickedAnimation: string = iconAnimation
messageData: any

Methods

Generated using TypeDoc