Stevenn Posted April 3, 2012 Posted April 3, 2012 well, I can't find the problem anywhere. The gui is there, or only the windows as there is no buttons nor any memo text. texts = {} texts["Overview"] = "texthere" texts["Rules"] = "texthere" texts["FAQ"] = "texthere" docWindow = guiCreateWindow(0.3672,0.3306,0.2823,0.2481,"Information Panel",true) docOverview = guiCreateButton(13,24,92,38,"Overview",true,docWindow) docRules = guiCreateButton(13,85,92,38,"Rules",true,docWindow) docFAQ = guiCreateButton(14,145,92,38,"FAQ",true,docWindow) docClose = guiCreateButton(17,208,92,38,"Close",true,docWindow) docMemo = guiCreateMemo(121,29,410,227,texts["Overview"],true,docWindow) guiSetVisible(docWindow,false) function bindGui() guiSetVisible(docWindow,true) showCursor(true) end bindKey("F1","down", function() guiSetVisible(docWindow,not guiGetVisible(docWindow)) showCursor(guiGetVisible(docWindow)) end) function setText() local source = guiGetText(source) if soruce == "docClose" then guiSetVisible(docWindow,false) showCursor(false) return end guiSetText(docMemo,texts[source]) end addEventHandler("onClientGUIClick",docOverview,setText,false) addEventHandler("onClientGUIClick",docRules,setText,false) addEventHandler("onClientGUIClick",docFAQ,setText,false) addEventHandler("onClientGUIClick",docClose,setText,false)
Kenix Posted April 3, 2012 Posted April 3, 2012 (edited) if you use argument relative ( true ) you need use numbers like this 0.9 not 900 Edited April 3, 2012 by Guest
BriGhtx3 Posted April 3, 2012 Posted April 3, 2012 Im not sure, but maby because you mixed relative positions with absolute position.
Castillo Posted April 3, 2012 Posted April 3, 2012 texts = {} texts["Overview"] = "texthere" texts["Rules"] = "texthere" texts["FAQ"] = "texthere" -- Your GUI buttons we're set to Absolute, but they we're Relative. -- true = Absolute -- false = Relative docWindow = guiCreateWindow(0.3672,0.3306,0.2823,0.2481,"Information Panel",true) docOverview = guiCreateButton(13,24,92,38,"Overview",false,docWindow) docRules = guiCreateButton(13,85,92,38,"Rules",false,docWindow) docFAQ = guiCreateButton(14,145,92,38,"FAQ",false,docWindow) docClose = guiCreateButton(17,208,92,38,"Close",false,docWindow) docMemo = guiCreateMemo(121,29,410,227,texts["Overview"],false,docWindow) guiSetVisible(docWindow,false) bindKey("F1","down", function ( ) guiSetVisible ( docWindow, not guiGetVisible ( docWindow ) ) showCursor ( guiGetVisible ( docWindow ) ) end ) function setText ( ) if ( source == docClose ) then -- You had a type here: "soruce" instead of "source". Also you we're checking if the button you've press was "docClose" instead of docClose ( you have to check the element, not the string. ) guiSetVisible ( docWindow, false ) showCursor ( false ) return end local text = guiGetText ( source ) guiSetText ( docMemo, texts[ text ] ) end addEventHandler("onClientGUIClick",docOverview,setText,false) addEventHandler("onClientGUIClick",docRules,setText,false) addEventHandler("onClientGUIClick",docFAQ,setText,false) addEventHandler("onClientGUIClick",docClose,setText,false)
Stevenn Posted April 3, 2012 Author Posted April 3, 2012 Solidsnake, thanks it works but could you just add some comments on where I did wrong so if I were to do it in the future i'd know what I did wrong?
Kenix Posted April 3, 2012 Posted April 3, 2012 You need use it in any resolutions? You should use relative argument or calculate it your self.
Castillo Posted April 3, 2012 Posted April 3, 2012 Solidsnake, thanks it works but could you just add some comments on where I did wrong so if I were to do it in the future i'd know what I did wrong? Done, added some comments.
Stevenn Posted April 3, 2012 Author Posted April 3, 2012 You need use it in any resolutions?You should use relative argument or calculate it your self. Yeah, just noticed it doesn't work with a lower res, but if I need to calculate it myself, how would I do that?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now