Work resumed

This commit is contained in:
2023-10-05 17:19:48 -05:00
parent 66fca2323e
commit 0692b2b6d1
23 changed files with 383 additions and 217 deletions

View File

@ -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([&amp;]{
uiItem->color = COLOR_RED;
}, menuItem->eventHoveredOn);
useEvent([&amp;]{
uiItem->color = COLOR_BLUE;
}, menuItem->eventHoveredOff);
useEvent([&amp;]{
uiItem->color = COLOR_GREEN;
}, menuItem->eventSelected);
</code>
</prefab>

View 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([&amp;]{
hoverDeocration->color = COLOR_WHITE;
}, menuItem->eventHoveredOn);
useEvent([&amp;]{
hoverDeocration->color = COLOR_TRANSPARENT;
}, menuItem->eventHoveredOff);
</code>
</prefab>

View File

@ -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)

View File

@ -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>

View File

@ -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

View 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}
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 KiB