Difference between revisions of "ImGui.DrawList:getForegroundDrawList"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2020.9<br/> '''Class:''' ImGui.DrawList<br/> === Description === Gets the foreground ImGui draw list. <source lang="lua"> ImGui:g...") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
=== Description === | === Description === | ||
Gets the foreground ImGui draw list. | Gets the foreground ImGui draw list. | ||
− | < | + | <syntaxhighlight lang="lua"> |
− | ImGui:getForegroundDrawList() | + | (drawlist) = ImGui:getForegroundDrawList() |
− | </ | + | </syntaxhighlight> |
+ | |||
+ | === Return values === | ||
+ | '''Returns''' (drawlist) the foreground draw list<br/> | ||
=== Example === | === Example === | ||
− | < | + | <syntaxhighlight lang="lua"> |
require "ImGui" | require "ImGui" | ||
Line 28: | Line 31: | ||
stage:addEventListener(Event.ENTER_FRAME, onEnterFrame) | stage:addEventListener(Event.ENTER_FRAME, onEnterFrame) | ||
− | </ | + | </syntaxhighlight> |
{{ImGui.DrawList}} | {{ImGui.DrawList}} |
Latest revision as of 15:29, 13 July 2023
Available since: Gideros 2020.9
Class: ImGui.DrawList
Description
Gets the foreground ImGui draw list.
(drawlist) = ImGui:getForegroundDrawList()
Return values
Returns (drawlist) the foreground draw list
Example
require "ImGui"
local imgui = ImGui.new()
stage:addChild(imgui)
function onEnterFrame(e)
-- 1 we start ImGui
imgui:newFrame(e)
-- 2 the main window
local drawlist = imgui:getForegroundDrawList()
drawlist:addCircle(128, 128, 64, 0x00ff00, 1, 32)
-- 3 we end the frame and render to screen
imgui:endFrame()
imgui:render()
end
stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)