Hey guys, I have some problem with my panel.
So, first of all, I did a small panel with two buttons. I can close the panel, but I don't know how to make a next page.
How could I make a next page? Should I disappear the first page, and then create another one?
Here's my code:
local thePlayer = getLocalPlayer()
local x, y = guiGetScreenSize(thePlayer)
local pS = [[randomtext]]
-------------------------------------------------------------------------------------------
function drawInformation()
dxDrawRectangle(x/3, y/3, 500, 450, tocolor(0, 0, 0, 125))
dxDrawRectangle(x/3, y/3, 500, 20, tocolor(0, 0, 0, 125))
dxDrawRectangle(x/2.8, y/1.4, 100, 30, tocolor(0, 0, 0, 125))
dxDrawRectangle(x/1.6, y/1.4, 100, 30, tocolor(0, 0, 0, 125))
dxDrawText("Welcome to the help panel!", x/2.3, y/2.8, tocolor(75, 108, 213, 115))
dxDrawText(pS, x/2.8, y/2.6)
dxDrawText("Close", x/2.6, y/1.39, tocolor(75, 108, 213, 125))
dxDrawText("Next", x/1.54, y/1.39, tocolor(75, 108, 213, 125))
end
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
function showThings()
addEventHandler("onClientRender", root, drawThings)
addEventHandler("onClientClick", getRootElement(), onClickThing)
showCursor(true)
outputChatBox("t")
end
addCommandHandler("test", showThings)
function disappearThings()
removeEventHandler("onClientRender", root, drawThings)
removeEventHandler("onClientClick", getRootElement(), onClickThing)
showCursor(false)
outputChatBox("t.")
end
---------------------------------------------------------------------------------------------
function onClickThing(button, state, absoluteX, absoluteY, worldX, worldZ, clickedElement)
if (state == "down") then
if (absoluteX >= x/2.8) and (absoluteX <= x/2.8 + 100) and (absoluteY >= y/1.4) and (absoluteY <= y/1.4 + 100) then
disappearThings()
end
end
end