Work resumed
This commit is contained in:
@ -1,20 +0,0 @@
|
||||
<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>
|
118
assets/games/liminal/prefabs/ButtonPrefab.xml
Normal file
118
assets/games/liminal/prefabs/ButtonPrefab.xml
Normal file
@ -0,0 +1,118 @@
|
||||
<prefab name="Button" type="">
|
||||
<asset type="truetype" name="font_main" />
|
||||
|
||||
<!-- <asset type="texture" name="button_background_50_inactive" />
|
||||
<asset type="texture" name="button_background_50" />
|
||||
<asset type="texture" name="button_background_75_inactive" />
|
||||
<asset type="texture" name="button_background_75" />
|
||||
<asset type="texture" name="button_background_inactive" /> -->
|
||||
<asset type="texture" name="button_background" />
|
||||
<asset type="texture" name="button_hover_element" />
|
||||
<asset type="texture" name="button_wings_down" />
|
||||
<asset type="texture" name="button_wings_inactive" />
|
||||
<asset type="texture" name="button_wings_open" />
|
||||
|
||||
<UIEmpty alignment="64, 128, 400, 64" ref="uiItem" />
|
||||
<UISimpleMenuItem ref="menuItem" />
|
||||
|
||||
<!-- Background -->
|
||||
<item>
|
||||
<UIImage
|
||||
ref="backgroundLeft"
|
||||
texture="button_background"
|
||||
color="white"
|
||||
alignment="0, 0, 47, 0"
|
||||
alignX="left"
|
||||
alignY="stretch"
|
||||
alignUnitRight="ratio"
|
||||
uvs="0, 0, 0.1, 1"
|
||||
/>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<UIImage
|
||||
ref="backgroundMiddle"
|
||||
texture="button_background"
|
||||
color="white"
|
||||
alignment="47, 0, 47, 0"
|
||||
alignX="stretch"
|
||||
alignY="stretch"
|
||||
alignUnitLeft="ratio"
|
||||
alignUnitRight="ratio"
|
||||
uvs="0.1, 0, 0.9, 1"
|
||||
/>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<UIImage
|
||||
ref="backgroundRight"
|
||||
texture="button_background"
|
||||
color="white"
|
||||
alignment="47, 0, 0, 0"
|
||||
alignX="right"
|
||||
alignY="stretch"
|
||||
alignUnitLeft="ratio"
|
||||
uvs="0.9, 0, 1.0, 1"
|
||||
/>
|
||||
</item>
|
||||
|
||||
<!-- Hover Element -->
|
||||
<item>
|
||||
<UIImage
|
||||
ref="hoverDeocration"
|
||||
texture="button_hover_element"
|
||||
color="transparent"
|
||||
alignment="0, -320, 400, 175"
|
||||
alignX="UI_COMPONENT_ALIGN_MIDDLE"
|
||||
alignY="UI_COMPONENT_ALIGN_END"
|
||||
/>
|
||||
</item>
|
||||
|
||||
<!-- Left Wing -->
|
||||
<item>
|
||||
<UIImage
|
||||
texture="button_wings_open"
|
||||
ref="wingsLeft"
|
||||
alignment="-80, -54, 134.15, 151.3"
|
||||
alignX="UI_COMPONENT_ALIGN_START"
|
||||
alignY="UI_COMPONENT_ALIGN_START"
|
||||
uvs="0, 0, 0.5, 1"
|
||||
/>
|
||||
</item>
|
||||
|
||||
<!-- Right Wing -->
|
||||
<item>
|
||||
<UIImage
|
||||
texture="button_wings_open"
|
||||
ref="wingsRight"
|
||||
alignment="134.15, -54, -80, 151.3"
|
||||
alignX="UI_COMPONENT_ALIGN_END"
|
||||
alignY="UI_COMPONENT_ALIGN_START"
|
||||
uvs="0.5, 0, 1, 1"
|
||||
/>
|
||||
</item>
|
||||
|
||||
<!-- Label -->
|
||||
<item>
|
||||
<UISimpleLabel
|
||||
ref="label"
|
||||
font="font_main"
|
||||
size="32"
|
||||
alignment="0, 12, 0, 12"
|
||||
alignX="center"
|
||||
alignY="stretch"
|
||||
>
|
||||
Hello Button.
|
||||
</UISimpleLabel>
|
||||
</item>
|
||||
|
||||
<code type="init">
|
||||
useEvent([&]{
|
||||
hoverDeocration->color = COLOR_WHITE;
|
||||
}, menuItem->eventHoveredOn);
|
||||
|
||||
useEvent([&]{
|
||||
hoverDeocration->color = COLOR_TRANSPARENT;
|
||||
}, menuItem->eventHoveredOff);
|
||||
</code>
|
||||
</prefab>
|
@ -4,7 +4,7 @@
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
tool_prefab(${CMAKE_CURRENT_LIST_DIR}/AvePrefab.xml)
|
||||
tool_prefab(${CMAKE_CURRENT_LIST_DIR}/Button.xml)
|
||||
tool_prefab(${CMAKE_CURRENT_LIST_DIR}/ButtonPrefab.xml)
|
||||
tool_prefab(${CMAKE_CURRENT_LIST_DIR}/EthPrefab.xml)
|
||||
tool_prefab(${CMAKE_CURRENT_LIST_DIR}/CraigPrefab.xml)
|
||||
tool_prefab(${CMAKE_CURRENT_LIST_DIR}/RoninPrefab.xml)
|
||||
|
@ -26,11 +26,17 @@
|
||||
|
||||
<UIMenuController />
|
||||
<UISimpleMenu />
|
||||
|
||||
<!-- <item ref="button0" prefab="prefabs/Button" menuX="0" menuY="0" /> -->
|
||||
<item ref="button0" alignment="0, 0, 32, 32" prefab="prefabs/Button" menuX="0" menuY="0" />
|
||||
<item ref="button1" alignment="180, 0, 32, 32" prefab="prefabs/Button" menuX="1" menuY="0" />
|
||||
<item ref="button2" alignment="0, 180, 32, 32" prefab="prefabs/Button" menuX="0" menuY="1" />
|
||||
<item ref="button3" alignment="180, 180, 32, 32" prefab="prefabs/Button" menuX="1" menuY="1" />
|
||||
|
||||
<item prefab="Button" ref="button0" alignment="0, 0, 0, 0" menuX="0" menuY="0" />
|
||||
<!-- <item prefab="Button" ref="button0" alignment="0, 0, 0, 0" menuX="0" menuY="0" />
|
||||
<item prefab="Button" ref="button1" alignment="180, 0, 0, 0" menuX="1" menuY="0" />
|
||||
<item prefab="Button" ref="button2" alignment="0, 64, 0, 0" menuX="0" menuY="1" />
|
||||
<item prefab="Button" ref="button3" alignment="180, 64, 0, 0" menuX="1" menuY="1" />
|
||||
<item prefab="Button" ref="button3" alignment="180, 64, 0, 0" menuX="1" menuY="1" /> -->
|
||||
|
||||
<VNTextboxScroller ref="textboxScroller" label="uiLabel" visibleLines="6" />
|
||||
</prefab>
|
Reference in New Issue
Block a user