Jump to content

can't create gui checkboxes


xTravax

Recommended Posts

hi

it isnt giving any error and i dont see any checkbox

  
local sw,sh = guiGetScreenSize() 
local width,height = 400,700 
local shaderPanel = guiCreateWindow ( sw/2-width/2, sh/2-height/2, width, height, "Shader Panel", false ) 
local x1,y1 = guiGetPosition(shaderPanel,false) 
local spacing = 40 
local spaceX,spaceY = spacing/1920*sw, spacing/1080*sh 
local cWidth,cHeight = 160/1920*sw, 40/1080*sh 
local checkBox1 = guiCreateCheckBox ( x1+spaceX, y1+spaceY, cWidth, cHeight, "Water Shader", true, false, shaderPanel) 
guiSetVisible(shaderPanel,false) 
  
  
function togglePanel() 
showCursor(not guiGetVisible(shaderPanel)) 
guiSetVisible(shaderPanel,not guiGetVisible(shaderPanel)) 
end 
bindKey("F3","down",togglePanel) 
  

please help

Link to comment

You don't see it because it's created out of window box. X and Y coordinates are relative to parent, parent is shaderPanel so you don't need to add window's x and y coordinates anymore. Replace:

local checkBox1 = guiCreateCheckBox ( x1+spaceX, y1+spaceY, cWidth, cHeight, "Water Shader", true, false, shaderPanel) 

with:

local checkBox1 = guiCreateCheckBox ( spaceX, spaceY, cWidth, cHeight, "Water Shader", true, false, shaderPanel) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...