-ffs-AbodyRulez Posted August 26, 2015 Share Posted August 26, 2015 (edited) Now this is weird, because i'm using relative window, relative tabPanel, relative everything, the size of the GUI window is always the same for all resolutions though, centered, not bigger or smaller than usual. However, only the tab is messed up. Notice the last tab "Permanent" isn't showing for a player with lower resolution. tabWidth, tabHeight = 0.32, 0.25 tCenterX, tCenterY = (1 / 2) - (tabWidth / 2), (1 / 2) - (tabHeight / 2) tabPanel = guiCreateTabPanel(tCenterX, tCenterY+0.355, tabWidth, tabHeight, true, window) monthsTab = guiCreateTab("Months", tabPanel) daysTab = guiCreateTab("Days", tabPanel) hoursTab = guiCreateTab("Hours", tabPanel) minutesTab = guiCreateTab("Minutes", tabPanel) permTab = guiCreateTab("Permanent", tabPanel) Notice i set the sorting to false, its really bugged, after sorting few times, reopening gridlist shows empty cells, but that's another problem, if anyone is aware of it, please leave a comment. Edited August 26, 2015 by Guest Link to comment
DNL291 Posted August 26, 2015 Share Posted August 26, 2015 If you are trying to change the size of the grid list tab according to the resolution, then leave it with the original size and change only the X and Y positions. I'm not sure of what can be though, since the only code you posted is about gridlist. Link to comment
-ffs-AbodyRulez Posted August 26, 2015 Author Share Posted August 26, 2015 Edited code, i completely didn't notice, been up for too long! Link to comment
DNL291 Posted August 26, 2015 Share Posted August 26, 2015 Well, the tab panel has a parent element which is a window. In this case, try positioning the tab panel without adjusting their positions. Look at the code of the tab and see if there's nothing wrong with it, by comparing with other gui-elements in the window - something should be wrong since it happens only to the tab panel. Link to comment
-ffs-AbodyRulez Posted August 27, 2015 Author Share Posted August 27, 2015 Well, the tab panel has a parent element which is a window. In this case, try positioning the tab panel without adjusting their positions.Look at the code of the tab and see if there's nothing wrong with it, by comparing with other gui-elements in the window - something should be wrong since it happens only to the tab panel. You lost me there. Here is the complete code for creating window and tabpanel. local guiWidth, guiHeight, centerX, centerY, tCenterX, tCenterY, tabWidth, tabHeight = 0 local tabPanel, monthsTab, daysTab, hoursTab, minutesTab, permTab = nil local window = nil function GUI() guiWidth, guiHeight = 0.6, 0.6 centerX, centerY = (1 / 2) - (guiWidth / 2), (1 / 2) - (guiHeight / 2) tabWidth, tabHeight = 0.32, 0.25 tCenterX, tCenterY = (1 / 2) - (tabWidth / 2), (1 / 2) - (tabHeight / 2) window = guiCreateWindow( centerX, centerY, guiWidth, guiHeight, "Alias System", true) guiWindowSetSizable (window, false) tabPanel = guiCreateTabPanel(tCenterX, tCenterY+0.355, tabWidth, tabHeight, true, window) monthsTab = guiCreateTab("Months", tabPanel) daysTab = guiCreateTab("Days", tabPanel) hoursTab = guiCreateTab("Hours", tabPanel) minutesTab = guiCreateTab("Minutes", tabPanel) permTab = guiCreateTab("Permanent", tabPanel) guiSetVisible(window, false) end addEventHandler("onClientResourceStart", resourceRoot, GUI) Btw, is adding all variables above as local defining their initial state is healthy for MTA? there is this counter i defined to local counter = 0, it didn't work, after removing the local keyword it worked, even though its not inside a function. Link to comment
Myths_Gaming Posted August 27, 2015 Share Posted August 27, 2015 From what I see you've a problem with the text in the tabs, they're too big to fit in the smaller resolutions. The only way to fix this issue is by editing the text in the tab and making its font smaller, which obviously you can't in MTA. I suggest using short forms, for e.g: "Mo", "D", "H", "Min", "P" instead of full-words. Link to comment
DNL291 Posted August 28, 2015 Share Posted August 28, 2015 You don't have to define locally the variable of each gui-element created. You can do this way: local guiWidth, guiHeight = 0.6, 0.6 local tabWidth, tabHeight = 0.32, 0.25 local centerX, centerY = .5 - (guiWidth / 2), .5 - (guiHeight / 2) local tCenterX, tCenterY = .5 - (tabWidth / 2), .5 - (tabHeight / 2) About your issue, I don't think the text length of the tab is causing this problem (even though I may be wrong). My guess is that your code is adjusting the interface to fit in all resolutions and causing this. I wasn't able to realize this, by looking at the code you posted, though. Try changing positions from relative to absolute and see if it works. If the problem persists, post here the entire code (or send me via PM). 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