a vertical subMenu

If someone needs a vertical subMenu


Submenu.zip (4.1 KB)

2 Likes

Updated Version

Menu creator example:

local newMenuDataExample = {
		{
			name="Game",
			--there no need "id"
			items={
				{name="Font", id="GameFontGroup"},
				{name="Sound", id="GameSoundGroup"}
			}
		},
		{
			name="Chat",
			--there no need "id" 
			items={
				{name="Font", id="ChatFontGroup"},
				{name="Sound", id="ChatSoundGroup"}
			}
		},
		{
			name="OwnIcon",
			--there no need "id" 
			iconDir=system.ResourceDirectory,  -- OwnIconDir
			icon="own-icon.png", -- OwnIconName
			items={
				{name="own icon test", id="ownIconGroup"},
			}
		},
		{
			name="System",
			id="systemGroup", -- !!!! need "id" if empty items={}
			items={}
		}
	}
	
        -- ScrollOptions u can find there: https://docs.coronalabs.com/api/library/widget/newScrollView.html
	local scrollOptions = {
		left=200,
		top=100,
		width = 230,
		height = 500,
		scrollHeight = 500,
		horizontalScrollDisabled=true,
		isBounceEnabled=false,
		hideBackground =true,
		hideScrollBar=true
	}

local SubMenu = require("subMenu")
local Menu = SubMenu:Create(newMenuDataExample, scrollOptions)
--MenuFunction:
Menu:initialization(sceneGroup) -- Add Menu in SceneGroup
Menu:add( obj, "GameFontGroup") -- Add obj in subMenugroup for example GameFontGroup
Menu:OpenSub( number, subNumber or null) -- Auto open SubMenu after showing of Menu
Menu:OpenSub(1,1)  -- Auto open SubMenu Game(Font)
Menu:OpenSub(1) -- Auto open Game(Font)
Menu:findGroup(groupIDname) -- return group

img:

Submenu.7z (7.0 KB)

OtherExample:

4 Likes