Page 1 of 1

Menu Template (dynamic and adaptable)

PostPosted: Sun Jun 18, 2017 3:10 pm
by claurent9
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 **
********************************************************************

Re: Menu Template (dynamic and adaptable)

PostPosted: Mon Aug 21, 2017 2:44 am
by roguecore
@claurent9 Looks good! Will the box resize to the length of the text?

Re: Menu Template (dynamic and adaptable)

PostPosted: Sun Sep 03, 2017 3:22 pm
by claurent9
@roguecore Thanks :-). No all the boxes have the same size based on the size of the original object.