Skip to main content

Menu Container and Menu Item

The Menu Container and Menu Item controls are mainly used in scenarios where a secondary options menu is popped up.

Name, ID, coordinates, width, height, blocking touch, transform, texture compression mode, replaceable upgrade, texture are common attributes, which are introduced in the "Basic Design - Edit Attributes" section, so we won't repeat them here.

Adjusting the "Menu Height" value changes the height of the text input control in the menu container control.

The following figure shows the properties of the menu container


The following image shows the Menu Item properties


The menu type of the menu container control has two modes: "Single Choice" and "Multiple Choice", the default is "Single Choice". "Generate Default Options", and finally bind the variables.

If you need to increase the menu options later, you can increase the height of the menu container control, then add the "Menu Item" control, and select the corresponding container number for the "Menu Item" control, and give the new "Menu Item" control a new container number. Set the text and option values for the new "Menu Item" control.

  1. If the menu container control is selected "radio" type, there are A, B, C three options (theoretically supports countless options, new options can be added by adding a Menu Item to add the value of the option to set the corresponding parameter on the line), the option value were 0, 1, 2, then select A when the variable passed to the parameters is 0, select B If you select A, the parameter passed to the variable is 0, if you select B, the parameter passed to the variable is 1, and if you select C, the parameter passed to the variable is 2.
  2. If the menu container control selects the "Multiple Choice" type, there are two options, A and B (up to 32 options, new options can be added by adding a Menu Item, the option value corresponds to bit 0,1,....31, bit 0,1,....31,bit 0,1,....31, bit 0,1,2, respectively). .31,bit32 means confirm), the option value is 0, 1, then select A when the variable is passed to the parameter is 1 (Note: binary 1, that is, 1), select AB when the variable is passed to the parameter is 3 (Note: binary 11, that is, 3)

Example:

The menu container control enables the radio type and the menu container control and the upper-left corner of the numeric control bound to the same variable, the default is A, B, C three options (see the menu container properties above), you want to add a D option, then you can increase the height of the menu container by adding the "Menu Item" control and configure it with the By adding the "Menu Item" control and configuring it with the option value and container (see the Menu Item property sheet above), and then placing the Menu Item control into the menu container.

The IDE simulation is as follows: