Skip to content
Snippets Groups Projects
Unverified Commit 220694d1 authored by John's avatar John Committed by GitHub
Browse files

Merge pull request #182 from StarArawn/main-menu-improvements

Marginally improved the main menu example.
parents 6753953b f866db42
No related branches found
No related tags found
No related merge requests found
assets/main_menu/kayak.png

30.6 KiB

......@@ -86,6 +86,9 @@ fn menu_button_render(
styles={KStyle {
width: Units::Stretch(1.0).into(),
height: Units::Pixels(40.0).into(),
bottom: Units::Pixels(30.0).into(),
left: Units::Pixels(50.0).into(),
right: Units::Pixels(50.0).into(),
..KStyle::default()
}}
on_event={on_event}
......@@ -133,6 +136,7 @@ fn startup(
let panel1_image = asset_server.load("main_menu/panel1.png");
let logo_image = asset_server.load("main_menu/logo.png");
let kayak_image = asset_server.load("main_menu/kayak.png");
let button_image = asset_server.load("main_menu/button.png");
let button_image_hover = asset_server.load("main_menu/button-hover.png");
......@@ -185,6 +189,16 @@ fn startup(
..KStyle::default()
}}
>
<KImageBundle
image={KImage(kayak_image)}
styles={KStyle {
width: Units::Pixels(310.0).into(),
height: Units::Pixels(104.0).into(),
top: Units::Pixels(25.0).into(),
bottom: Units::Pixels(25.0).into(),
..KStyle::default()
}}
/>
<KImageBundle
image={KImage(logo_image)}
styles={KStyle {
......@@ -194,21 +208,12 @@ fn startup(
..KStyle::default()
}}
/>
<ElementBundle
id={"button_area"}
styles={KStyle {
left: Units::Pixels(50.0).into(),
right: Units::Pixels(50.0).into(),
..Default::default()
}}
>
<MenuButtonBundle button={MenuButton { text: "Play".into() }} />
<MenuButtonBundle button={MenuButton { text: "Options".into() }} />
<MenuButtonBundle
button={MenuButton { text: "Quit".into() }}
on_event={handle_click_close}
/>
</ElementBundle>
<MenuButtonBundle button={MenuButton { text: "Play".into() }} />
<MenuButtonBundle button={MenuButton { text: "Options".into() }} />
<MenuButtonBundle
button={MenuButton { text: "Quit".into() }}
on_event={handle_click_close}
/>
</NinePatchBundle>
</KayakAppBundle>
}
......
images/screen1.png

107 KiB | W: | H:

images/screen1.png

153 KiB | W: | H:

images/screen1.png
images/screen1.png
images/screen1.png
images/screen1.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment