UI Screens for BevyEngine

version downloads

This is a little thing I put together for creating simple UI screens using the BevyEngine. The idea is to define the screens in a sort of poor-man's markup and this crate will then provide some functions to create the UI 'objects'.

For example, the following in a file will create a screen looking like:

sample_picture

with the calling code: sh let lines = gerg_ui::read_ui_file("screen1.ui"); let controls = gerg_ui::instantiate_controls(lines); let _entities = gerg_ui::spawn_controls(&mut commands, asset_server, materials, controls), Vec2::new(1920.0, 1080.0); or: sh let controls = gerg_ui::instantiate_controls_from_file("screen1.ui"); let _entities = gerg_ui::spawn_controls(&mut commands, asset_server, materials, controls), Vec2::new(1920.0, 1080.0);

```sh --globalsettings-- fontname: CrimsonText-Regular.ttf font_size: 30 //color: 1;1;1 color: White --end--

--picturebox-- name: frame1 texturename: bigframe.png size: 300;450 centerposition: -800;300 draw_order: 0 --end--

--picturebox-- name: frame2 texturename: smallframe.png size: 200;300 draworder: 0.1 dockwith: frame1.topmiddle<->this.top_middle offset: 0;-30 --end--

--picturebox-- name: frame3 texturename: bigframe.png size: 300;450 draworder: 0.2 dockwith: frame1.centerright<->this.center_left offset: 50;0 --end--

--label-- name: label1 size: 100;50 textstring: Test1 fontsize: 50 color: CYAN dockwith: frame2.topleft<->this.top_left offset: 15;-15 --end--

--label-- name: label2 size: 100;50 textstring: Test2 fontname: CrimsonText-Bold.ttf fontsize: 50 color: AMERICAN ROSE dockwith: label1.bottomleft<->this.topleft --end--

--label-- name: label3 size: 270;420 textstring: How great was the West Indian cricket team of the 70''s and 80''s? Marshall, Holding, Garner, Croft, Roberts bowling... Richards, Greenidge, Haynes batting. Brilliant stuff. Were the Aussies of the 90''s, 2000''s better, I don''t think so, but Warne and McGrath made a formidable combination. fontsize: 25 color: CANARY YELLOW dockwith: frame3.topleft<->this.top_left offset: 15;-15 --end-- ```