require "moonloader"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local window = imgui.ImBool(false)
local window2 = imgui.ImBool(false)
local image = {}
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
imgui.Process = false
sampRegisterChatCommand('ii', function()
window.v = not window.v
end)
for i = 1, 3 do -- 3 - кол-во каритнок в папке
image[i] = imgui.CreateTextureFromFile(getWorkingDirectory().."\\photo\\image"..i..".jpg") -- Местоположение каритнок (moonloader/photo/image.jpg)
end
while true do
wait(0)
imgui.Process = window.v or window2.v
end
end
function imgui.OnDrawFrame()
ScreenX, ScreenY = getScreenResolution()
if window.v then
imgui.SetNextWindowPos(imgui.ImVec2(ScreenX / 2 , ScreenY / 2), imgui.Cond.FirsUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(150, 200), imgui.Cond.FirstUseEver)
imgui.Begin('Window')
if imgui.Button('Start') then
window2.v = not window2.v
end
imgui.End()
end
if window2.v then
imgui.SetNextWindowPos(imgui.ImVec2(ScreenX / 2 , ScreenY / 2), imgui.Cond.FirsUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(300, 600), imgui.Cond.FirstUseEver)
imgui.Begin('Window2')
for i = 1, 3 do -- 3 - кол-во каритнок в папке
imgui.Image(image[i], imgui.ImVec2(150,100)) -- 150 и 100 - размеры картинки именно в имгуи
end
imgui.End()
end
end