Difference between revisions of "ImGui.DrawList:getBackgroundDrawList"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2020.9<br/> '''Class:''' ImGui.DrawList<br/> === Description === Gets the background ImGui draw list. <source lang="lua"> ImGui.D...") |
|||
Line 6: | Line 6: | ||
Gets the background ImGui draw list. | Gets the background ImGui draw list. | ||
<source lang="lua"> | <source lang="lua"> | ||
− | ImGui | + | ImGui:getBackgroundDrawList() |
</source> | </source> | ||
=== Example === | === Example === | ||
<source lang="lua"> | <source lang="lua"> | ||
+ | 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:getBackgroundDrawList() | ||
+ | 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) | ||
</source> | </source> | ||
{{ImGui.DrawList}} | {{ImGui.DrawList}} |
Revision as of 00:28, 23 April 2021
Available since: Gideros 2020.9
Class: ImGui.DrawList
Description
Gets the background ImGui draw list.
ImGui:getBackgroundDrawList()
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:getBackgroundDrawList()
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)