- 33
- 17
- Версия MoonLoader
- .026-beta
I'm learning MImGui, how do I change colors in the menu? Is it similar to ImGui Lua?
My Code:
Lua:
script_name 'Menu mimgui teste'
local imgui = require 'mimgui'
local new = imgui.new
local menu = new.bool(false)
local key = require 'vkeys'
local ffi = require 'ffi'
local texto = new.char[256]()
local sliderint = new.int(0)
local sliderfloat = new.float(0.0)
local checkbox = new.bool(false)
local clear_color = new.float[3](0.45, 0.55, 0.60)
imgui.OnFrame(
function() return menu[0] end,
function()
imgui.SetNextWindowSize(imgui.ImVec2(330, 320), imgui.Cond.FirstUseEver)
imgui.Begin("Menu mimgui teste",menu)
imgui.SliderInt("Slider int", sliderint, 0, 10)
imgui.SliderFloat("Slider Float", sliderfloat, 0.0, 10.0)
imgui.Checkbox("Checkbox", checkbox)
imgui.InputText("Input", texto,ffi.sizeof(texto))
imgui.ColorEdit3("Clear color", clear_color)
if imgui.Button("Clique") then
sampAddChatMessage("Clicado!", 0xFF00FF)
end
imgui.End()
end
)
function main()
while not isSampfuncsLoaded() or not isSampLoaded() do
wait(100)
end
while true do
wait(0)
if wasKeyPressed(key.VK_2) then
menu[0] = not menu[0]
end
end
end