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>
|
@ -9,6 +9,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/ave/CMakeLists.txt")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/craig/CMakeLists.txt")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/eth/CMakeLists.txt")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/ronin/CMakeLists.txt")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/ui/CMakeLists.txt")
|
||||
|
||||
tool_texture(texture_border
|
||||
FILE=${CMAKE_CURRENT_LIST_DIR}/texture_test.png
|
||||
|
34
assets/games/liminal/textures/ui/CMakeLists.txt
Normal file
34
assets/games/liminal/textures/ui/CMakeLists.txt
Normal file
@ -0,0 +1,34 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
set(BUTTON_TEXTURE_OPTIONS
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(button_background
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/button_background.png"
|
||||
${BUTTON_TEXTURE_OPTIONS}
|
||||
)
|
||||
|
||||
tool_texture(button_hover_element
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/button_hover_element.png"
|
||||
${BUTTON_TEXTURE_OPTIONS}
|
||||
)
|
||||
|
||||
tool_texture(button_wings_down
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/button_wings_down.png"
|
||||
${BUTTON_TEXTURE_OPTIONS}
|
||||
)
|
||||
|
||||
tool_texture(button_wings_inactive
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/button_wings_inactive.png"
|
||||
${BUTTON_TEXTURE_OPTIONS}
|
||||
)
|
||||
|
||||
tool_texture(button_wings_open
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/button_wings_open.png"
|
||||
${BUTTON_TEXTURE_OPTIONS}
|
||||
)
|
BIN
assets/games/liminal/textures/ui/button_background.png
Normal file
BIN
assets/games/liminal/textures/ui/button_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
BIN
assets/games/liminal/textures/ui/button_hover_element.png
Normal file
BIN
assets/games/liminal/textures/ui/button_hover_element.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 103 KiB |
BIN
assets/games/liminal/textures/ui/button_wings_down.png
Normal file
BIN
assets/games/liminal/textures/ui/button_wings_down.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
BIN
assets/games/liminal/textures/ui/button_wings_inactive.png
Normal file
BIN
assets/games/liminal/textures/ui/button_wings_inactive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
BIN
assets/games/liminal/textures/ui/button_wings_open.png
Normal file
BIN
assets/games/liminal/textures/ui/button_wings_open.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 843 KiB |
Reference in New Issue
Block a user