ImGui.Core.new

From GiderosMobile
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Available since: Gideros 2020.9
Class: ImGui

Description

Initializes a new ImGui instance.

ImGui.new(font_atlas,mouse_listeners,keyboard_listeners,touch_listeners)

Parameters

font_atlas: copy fonts optional, default=nil
mouse_listeners: (bool) add internal mouse event listeners optional, default=false
keyboard_listeners: (bool) add internal keyboard event listeners optional, default=false
touch_listeners: (bool) add internal touch event listeners optional, default=false

Example

A minimal example

require "ImGui"

local imgui = ImGui.new()
stage:addChild(imgui)

function onEnterFrame(e)
	imgui:newFrame(e.deltaTime)
	imgui:setClassicStyle()

	imgui:showDemoWindow()

	imgui:render()
	imgui:endFrame()
end

stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)