20 lines
488 B
XML
20 lines
488 B
XML
<prefab name="Button" type="">
|
|
<asset type="truetype" name="font_main" />
|
|
|
|
<UISimpleLabel ref="uiItem" font="font_main" size="32" />
|
|
<UISimpleMenuItem ref="menuItem" />
|
|
|
|
<code type="init">
|
|
useEvent([&]{
|
|
uiItem->color = COLOR_RED;
|
|
}, menuItem->eventHoveredOn);
|
|
|
|
useEvent([&]{
|
|
uiItem->color = COLOR_BLUE;
|
|
}, menuItem->eventHoveredOff);
|
|
|
|
useEvent([&]{
|
|
uiItem->color = COLOR_GREEN;
|
|
}, menuItem->eventSelected);
|
|
</code>
|
|
</prefab> |