*️Rendering menus, windows

Pseudocodes to use of rendering menu / window.

You should also check the Hooks if you want to know more about the callbacks for you script.

-- Define a local function called "Menu"
local function Menu()
	-- Call the ImGui library's Text function to display a message
	ImGui.Text("Your text in this menu")
end

-- Register the Menu function to be called when the SAKURA_MENU_RENDER hook is triggered
Hooks.Register(SAKURA_MENU_RENDER, Menu)
-- Define a local function called "Window"
local function Window()
	-- Call the ImGui library's Text function to display a message
	ImGui.Text("Your text inside window")
end

-- The second function, named "AtWindowRender", sets up the window using the ImGui.Window function.
local function AtWindowRender()
	-- The menu is given a title "Your window" and a reference to the "Window" callback function is passed as the second argument.
	ImGui.Window("Your window", 0, Window)
end

-- Register the Menu function to be called when the SAKURA_WINDOW_RENDER hook is triggered
Hooks.Register(SAKURA_WINDOW_RENDER, AtWindowRender)

Last updated