Sex* Posted March 11, 2013 Share Posted March 11, 2013 So i want to make something like this that image is the GUIWindow: local sW,sH = guiGetScreenSize ( ); local gUtils = { }; gUtils.guiW,gUtils.guiH = 650, 450; gUtils.posX,gUtils.posY = sW / 2 - gUtils.guiW / 2, sH / 2 - gUtils.guiH / 2; --Center of screen for all resolutions local gLabels = { }; local gButtons = { }; local staticimage = {}; resourceRoot = getResourceRootElement( getThisResource( ) ) localPlayer = getLocalPlayer() infoTable = {} Login_Edit = {} SanyButtons = {} SanysButtons = {} GUIEditor_Checkbox = {} font = {} font[-1] = guiCreateFont( "font/font2.ttf", 8 ) local g_Window = nil function createGui ( ) if g_Window then return end g_Window = {} gWindow = guiCreateStaticImage ( gUtils.posX, gUtils.posY, gUtils.guiW, gUtils.guiH, "images/window.png", false ) But if i make something like that it crashes, the original is like this: tabs ={ guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"WARNING! The userpanel has failed to load! Please contact the owner as soon as possible!",false)} And if i tried to make something it came like this and didnt work: tabs = { local sW,sH = guiGetScreenSize ( ); local gUtils = { }; gUtils.guiW,gUtils.guiH = 650, 450; gUtils.posX,gUtils.posY = sW / 2 - gUtils.guiW / 2, sH / 2 - gUtils.guiH / 2; --Center of screen for all resolutions local gLabels = { }; local gButtons = { }; local staticimage = {}; resourceRoot = getResourceRootElement( getThisResource( ) ) localPlayer = getLocalPlayer() infoTable = {} Login_Edit = {} SanyButtons = {} SanysButtons = {} GUIEditor_Checkbox = {} local g_Window = nil function createGui ( ) if g_Window then return end g_Window = {} gWindow = guiCreateStaticImage ( gUtils.posX, gUtils.posY, gUtils.guiW, gUtils.guiH, "images/window.png",WARNING! The userpanel has failed to load! Please contact the owner as soon as possible!", false )} Link to comment
Sex* Posted March 11, 2013 Author Share Posted March 11, 2013 Now its like this. I tried only one. tabs = { dxDrawImage ( screenWidth/2 - 50, 0, 100, 240, 'window.png', angle,"Stats", 0, -120 ) end function HandleTheRendering ( ) addEventHandler("onClientRender", getRootElement(), renderDisplay), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Achievements",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Shop",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Maps",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Options",false) } and the result: [2013-03-11 12:28:40] WARNING: Loading script failed: lol123\main_client.lua:191: '}' expected (to close '{' at line 189) near 'end' Link to comment
novo Posted March 11, 2013 Share Posted March 11, 2013 What are you trying to do? I think you want to insert all the windows into a table, you can do it with table.insert. Link to comment
Sex* Posted March 11, 2013 Author Share Posted March 11, 2013 Im trying to replace the windows with an image so they would look cool and stuff Link to comment
iPrestege Posted March 11, 2013 Share Posted March 11, 2013 may this help you try this : function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "imageName.png", relative2 ) return mainBackground end and tell me ^_* don't forget add the image to meta.xml and re name it . Link to comment
Sex* Posted March 11, 2013 Author Share Posted March 11, 2013 This will make only the background image? or the edges of the window will go away also? Link to comment
iPrestege Posted March 11, 2013 Share Posted March 11, 2013 Yes, the edges of the window go away : ) . Link to comment
Sex* Posted March 12, 2013 Author Share Posted March 12, 2013 Yes, the edges of the window go away : ) . Dont work, crashed, basically thats the part of the tabs and the stats window: tabs = { guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"WARNING! The userpanel has failed to load! Please contact NeXTreme as soon as possible!!",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Players",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Achievements",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Shop",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Maps",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Options",false) } guiSetVisible(tabs[1],false) guiSetVisible(tabs[2],false) guiSetVisible(tabs[3],false) guiSetVisible(tabs[4],false) guiSetVisible(tabs[5],false) guiSetVisible(tabs[6],false) -- "Stats" TAB lblStats = guiCreateLabel(18,24,150,49,"Stats",false,tabs[1]) guiLabelSetColor(lblStats,255,130,0) guiLabelSetVerticalAlign(lblStats,"top") guiLabelSetHorizontalAlign(lblStats,"left",false) guiSetFont(lblStats,"sa-header") lblPlayerLevel = guiCreateLabel(18,83,136,15,"Level: N/A",false,tabs[1]) guiSetFont(lblPlayerLevel,"default-bold-small") lblPlayerStats = guiCreateLabel(18,201,84,16,"Player stats:",false,tabs[1]) guiLabelSetColor(lblPlayerStats,255,130,0) guiSetFont(lblPlayerStats,"default-bold-small") lblPlayerMoney = guiCreateLabel(18,98,151,14,"Money: N/A",false,tabs[1]) guiLabelSetColor(lblPlayerMoney,255,255,255) guiSetFont(lblPlayerMoney,"default-bold-small") lblAchievementsUnlocked = guiCreateLabel(18,126,180,14,"Achievements unlocked: 0/40",false,tabs[1]) guiSetFont(lblAchievementsUnlocked,"default-bold-small") lblTotalPlayingTime = guiCreateLabel(18,156,292,15,"Total playing time: N/A",false,tabs[1]) guiSetFont(lblTotalPlayingTime,"default-bold-small") lblNextLevelProgress = guiCreateLabel(335,131,232,45,"Progress to next level:",false,tabs[1]) guiLabelSetVerticalAlign(lblNextLevelProgress,"top") guiLabelSetHorizontalAlign(lblNextLevelProgress,"center",false) guiSetFont(lblNextLevelProgress,"default-bold-small") lblPlayerLevelRank = guiCreateLabel(388,45,124,22,"Loading...",false,tabs[1]) guiLabelSetColor(lblPlayerLevelRank,255,130,0) guiLabelSetVerticalAlign(lblPlayerLevelRank,"bottom") guiLabelSetHorizontalAlign(lblPlayerLevelRank,"center",false) guiSetFont(lblPlayerLevelRank,"default-bold-small") lblMapsWon = guiCreateLabel(18,242,205,15,"Maps won: N/A",false,tabs[1]) guiSetFont(lblMapsWon,"default-bold-small") lblTotalMapsPlayed = guiCreateLabel(18,227,205,15,"Total maps played: N/A",false,tabs[1]) guiSetFont(lblTotalMapsPlayed,"default-bold-small") lblWinRatio = guiCreateLabel(18,260,205,15,"Map win ratio: N/A",false,tabs[1]) guiSetFont(lblWinRatio,"default-bold-small") lblTotalHunters = guiCreateLabel(18,285,205,15,"Total hunters reached: N/A",false,tabs[1]) guiSetFont(lblTotalHunters,"default-bold-small") lblTotalToptimes = guiCreateLabel(18,306,205,15,"Total toptimes set: N/A",false,tabs[1]) guiSetFont(lblTotalToptimes,"default-bold-small") lblTotalMoney = guiCreateLabel(222,227,205,15,"Total money earned: N/A",false,tabs[1]) guiSetFont(lblTotalMoney,"default-bold-small") lblTimesJoined = guiCreateLabel(18,171,205,15,"Times joined the server: N/A",false,tabs[1]) guiSetFont(lblTimesJoined,"default-bold-small") lblSentMoney = guiCreateLabel(222,242,205,15,"Money sent to players: N/A",false,tabs[1]) guiSetFont(lblSentMoney,"default-bold-small") lblTotalDeaths = guiCreateLabel(447,257,135,15,"Total deaths: N/A",false,tabs[1]) guiSetFont(lblTotalDeaths,"default-bold-small") lblTotalBets = guiCreateLabel(222,270,205,15,"Total bets: N/A",false,tabs[1]) guiSetFont(lblTotalBets,"default-bold-small") lblBetsWon = guiCreateLabel(222,285,205,15,"Bets won: N/A",false,tabs[1]) guiSetFont(lblBetsWon,"default-bold-small") lblMoneyEarnBet = guiCreateLabel(222,307,205,15,"Money earned with betting: N/A",false,tabs[1]) guiSetFont(lblMoneyEarnBet,"default-bold-small") lblTotalReactionTests = guiCreateLabel(447,217,135,15,"Reaction tests won: N/A",false,tabs[1]) guiSetFont(lblTotalReactionTests,"default-bold-small") lblBestReactionTime = guiCreateLabel(447,232,135,15,"Best reaction time: N/A",false,tabs[1]) guiSetFont(lblBestReactionTime,"default-bold-small") progressLevel = guiCreateProgressBar(341,148,219,23,false,tabs[1]) buttonLevelUp = guiCreateButton(342,176,219,19,"Level up",false,tabs[1]) imageLevel = guiCreateStaticImage(370,73,161,52,"levels/LEVEL1.png",false,tabs[1]) Link to comment
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