Why doesn't this work:
function createWindow( )
myWindow = Window:Create( 0.02, 0.3, 0.6, 0.6, "Test", true );
btnCls = myWindow:AddButton ( 0.1, 0.9, 0.2, 0.05, "Close", true );
myWindow:Visible ( true );
myWindow:Movable ( false );
myWindow:Sizable ( false );
showCursor( true );
btnCls:AddOnClick( hide );
img = StaticImage:Create( 0.3, 0.4, 0.3, 0.3, "image.png", false, myWindow );
end
addEventHandler( "onPlayerJoin", getResourceRootElement( getThisResource() ), createWindow );
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), createWindow );
function hide( button )
myWindow:Visible ( false );
showCursor( false );
end
addCommandHandler("close", hide)
function show( )
myWindow:Visible ( true );
showCursor( true );
end
addCommandHandler( "open", show )
Gui works, but the image wont show, and i want the image to be in the Window. What is wrong??