Hello,
I have downloaded the Lib AppGameKit Gui from here:
https://forum.thegamecreators.com/thread/219790
But the thread is locked so I am going to post a new thread to ask some questions and I am encountering some problems.
Does anyone have ever used this GUI library? (If not do you have any better to suggest)?
First what is the difference between Lib AppGameKit Gui v0.50 and v0.77. It seems the version 0.77 is more improved and the version 0.50 have errors when it runs.
I have seen 1 example in the verion 0.77 here and I have one problem.
The example is working well, but when I put the code in my game (I am starting to play with Application Game Kit Studio).. the same code from the example is not working.
I try to create one menu.
The code to create the menu is like this:
I have put the include folder in the root folder of my project.
//************* include the LAG lib
#include "include/include.agc"
#include "include/lag/LAG_include.agc"
//Setting the skin of the GUI
Init_LAG("grey") // other theme : light, dark, fx, white, classic, darkgrey - you can add/change the theme in LAG_init.agc
I have placed the ui folder inside the media folder for the library to find the skins.
The program prepares the window:
Function Init_Graphics1()
// set window properties
SetWindowTitle( "DLB - Adventure Maker" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 0 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 0 )
EndFunction
My program creates one window 1024x768 in size.
And then I copied the exact lines of code from the library example to my game to insure if I am making any error:
/ MENU FILE
LAG_MenuTitle(0,"File") // the id of the menutitle is = 0
LAG_MenuItem(0,0,"Open") // you can use a constant for the menuItem Id : #constant CMENU_OPENAS = 20 : LAG_MenuItem(0,CMENU_OPENAS,"Open as...")
LAG_MenuItem(0,1,"Save")
LAG_MenuItem(0,11,"SaveAs")
LAG_MenuItem(0,14,"Export")
LAG_MenuItem(0,15,"Import")
LAG_MenuBar(0)
LAG_MenuItem(0,12,"Quit")
LAG_MenuItem(0,17,"Another Last Addition")
// MENU EDIT
LAG_MenuTitle(0,"Edit") // his id = 1
LAG_MenuItem(1,2,"Undo") // the first number = id of the menutitle
LAG_MenuItem(1,3,"Redo")
LAG_MenuItem(1,4,"Select All")
LAG_MenuItem(1,16,"just a very big menu text, to test if the menu will be scaled")
// MENU VIEW
LAG_MenuTitle(0,"View") // his id = 2, and so....
LAG_MenuItem(2,5,"Zoom")
LAG_MenuItem(2,13,"Show/Hide panel")
The window opens and creates one menu bar with 3 menus (File Edit View) all looks nice but when you are cliking on each menu the menu is not opening to present the menu items.
In the example the menu works when I am placing the same code in my project the menu is not working.
There is no manual or explanation how this Library works and I am looking inside the source code and the example they have to fugure out how is working.
If you like I can upload whole project with the source code to see it.
Any suggestion why the menus are not clickable?