Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit/AppGameKit Studio Showcase / [AGK2] Editable Mobile GUI Template

Author
Message
nonom
AGK Developer
1
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Aden
Posted: 19th Nov 2018 20:00 Edited at: 5th Mar 2019 21:41
Got a point where i was stucked without a GUI. So I want to share my first approach, at the moment it covers text controls and buttons. It's in an early stage.

The GUI loads the first time from a text file because is more easy to populate the objects during the dev stage, but after editing uses a json file.

The code is a bit rude. My main idea is to have a screen with different scenes and layers, so a game ui can be integrated using the GUI_State object. At the moment it covers only a layer for scene. Get a look the saved.json result after editing, it should be loaded the next time instead the local text file.



The main.agc should be quite simple



Just an experiment with the GUITemplate dedicated to my nephew

Attached an example project , enjoy

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
13
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 20th Nov 2018 00:28
Very nice of you to share i will check it out later in the week
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 20th Nov 2018 03:02
Cool! I love UIs, it's always interesting to see how different people approach making a UI system.

http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
nonom
AGK Developer
1
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Aden
Posted: 20th Nov 2018 10:01 Edited at: 20th Nov 2018 12:27
Thanks guys! The code is a bit redundant in the loading data part so I'll clean to do it more abstract.

It was fun analysing how an event handler should work, so any feedback is always welcome!
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 20th Nov 2018 18:22
It would be nice if agk had true callback handling, but yeah I use a select:case dispatcher as a work around.

I haven't had a chance to actually run this yet, just looked over it a bit but how is the performance?

I ported my ui system over from dbpro and switched from using images to using sprites in the process and i definitely like the agk sprite system better but I do see performance take a hit when I get up to around 80 elements/sprites on screen
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
nonom
AGK Developer
1
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Aden
Posted: 20th Nov 2018 23:45 Edited at: 29th Nov 2018 18:22
Thanks for the feedback. You can modify the file gui_controls.txt copypasting the definitions several times (adding like 100 controls). After saving the json runs smoothly. My idea is to load from the json in a future stage anyways.

In the past I tried Creating Deleting Images Sprites but it had a cost rendering so I'm handling now the Depth and the Active and Visible properties instead. But I don't know if there is a better way.
nonom
AGK Developer
1
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Aden
Posted: 29th Nov 2018 18:22 Edited at: 29th Nov 2018 18:24
Quote: "In the past I tried Creating Deleting Images Sprites but it had a cost rendering so I'm handling now the Depth and the Active and Visible properties instead. But I don't know if there is a better way."

Any clue?
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 1st Dec 2018 22:03
I did manage to resolve my performance issues. most of the time was going to resolving the element properties like size and position but these properties dont really change most of the time and they just resolve to the same values over and over again so I am now flagging elements as "dirty" when a property changes and only re-evaluate the properties for a given element when necessary for that element.

http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
nonom
AGK Developer
1
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Aden
Posted: 21st Feb 2019 11:43
Thanks Ortu!
nonom
AGK Developer
1
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Aden
Posted: 5th Mar 2019 21:39
The repo can be located here
https://github.com/nonom/AGK_GUITemplate

Login to post a reply

Server time is: 2019-07-18 01:54:52
Your offset time is: 2019-07-18 01:54:52