Created
December 10, 2022 19:23
-
-
Save dextercd/2ca7a63b221e47160fa3f5bb656db6fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local imgui = load_imgui({version="1.0.0", name="test"}) | |
local valuea = 0 | |
function OnWorldPreUpdate() | |
if imgui.Begin("Main Window Title") then | |
imgui.Button("Drag start element") | |
if imgui.BeginDragDropSource() then | |
imgui.SetDragDropPayload("TEST", valuea) | |
imgui.Text("Testing") | |
imgui.EndDragDropSource() | |
end | |
imgui.SameLine() | |
_, valuea = imgui.SliderFloat("Value", valuea, 0, 1000) | |
end | |
if imgui.Begin("Destination") then | |
imgui.Button("Drag destination") | |
if imgui.BeginDragDropTarget() then | |
local payload = imgui.AcceptDragDropPayload("TEST") | |
if payload ~= nil then | |
print("Received " .. tostring(payload) .. " " .. type(payload)) | |
end | |
imgui.EndDragDropTarget() | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment