Menu Template (dynamic and adaptable)

Discussion of tools and resources for game developers

Post » Sun Jun 18, 2017 3:10 pm

Hi,

I made a menu template to easily generate a menu for your games (you just need to write the infos of your buttons in the xml file).

You can download it here :

https://drive.google.com/open?id=0B-CQs9SaQCHFczRHZ3huVnpiSmM

The demo is here :
https://www.scirra.com/arcade/tutorial-games/quick-menu-demo-with-capx-18963

******************************Features******************************
+ menu created base on a xml file (ui.xml contained in the
project file - with various exemple nodes)
+ 2 type of button "normal" and "checkbox"
+ for each checkbox a key is created in the
variables dictionary to store it's state
+ for each button a function is called (if that function is
needed it need to be manualy created with a "on function..."
+ button can call a sub menu function
+ mouse, keyboard, gamepad support (analogic and d-pad)
***************************XML node usage***************************
+ The "Button" node contains each elements of a button
including sub-menu. It can contains 2 attributes
- "Type" : Type="CheckBox" create a checkbox instead of
a normal button
- "State" : Used to store the initial state of the button.
+ The "Name" node is the text which will be displayed
on the button
+ The "Callback" node is the name of the function to call
when activating a button. Two functions are included
in the capx :
- "Back" go to the parent menu
- "Sub-Menu" deploy the sub menu wich name is contained
in the "Option" node
+ The "Option" node can contain text stored in the button's
instance variable
********************************************************************
** For more info in xml https://www.w3schools.com/xml/default.asp **
********************************************************************
B
14
S
4
Posts: 22
Reputation: 946

Post » Mon Aug 21, 2017 2:44 am

@claurent9 Looks good! Will the box resize to the length of the text?
B
18
S
8
G
4
Posts: 88
Reputation: 3,124

Post » Sun Sep 03, 2017 3:22 pm

@roguecore Thanks :-). No all the boxes have the same size based on the size of the original object.
B
14
S
4
Posts: 22
Reputation: 946


Return to Tools and Resources

Who is online

Users browsing this forum: No registered users and 1 guest