Jump to content

Search the Community

Showing results for tags 'gui'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. hi guys i want create gui like this to show the car inside How should I do this? image link https://ibb.co/87hYNKF
  2. GUIEditor = { gridlist = {}, staticimage = {} } addEventHandler("onClientResourceStart", resourceRoot, function () local screenW, screenH = guiGetScreenSize() win = guiCreateStaticImage((screenW - 554) / 2, (screenH - 477) / 2, 554, 477, "s/panel.png", false) guiSetVisible(win,false) local screenW2, screenH2 = guiGetScreenSize() PlayerList = guiCreateStaticImage((screenW2 - 342) / 2, (screenH2 - 415) / 2, 342, 415, "s/PlayerList.png", false) guiSetVisible(PlayerList,false) GridPlayer = guiCreateGridList(23, 59, 188, 346, false, PlayerList) c = guiGridListAddColumn(GridPlayer, "Player", 0.9) SendWe = guiCreateStaticImage(215, 59, 101, 32, "s/SendWe.png", false, PlayerList) Close = guiCreateStaticImage(215, 117, 101, 32, "s/Close.png", false, PlayerList) GUIEditor.staticimage[1] = guiCreateStaticImage(216, 315, 104, 90, "s/logo.png", false, PlayerList) for _,player in ipairs ( getElementsByType("player") ) do local row = guiGridListAddRow(GridPlayer) guiGridListSetItemText(GridPlayer,row,1,getPlayerName(player),false,false) end Grid = guiCreateGridList(16, 71, 277, 400, false, win) guiGridListAddColumn(Grid, "name", 0.2) guiGridListAddColumn(Grid, "id", 0.2) guiGridListAddColumn(Grid, "ammo", 0.2) guiGridListAddColumn(Grid, "price", 0.2) for k,v in ipairs(Weapons) do local row = guiGridListAddRow(Grid) guiGridListSetItemText(Grid,row,1, v[1],false,false) guiGridListSetItemText(Grid,row,2, v[2],false,false) guiGridListSetItemText(Grid,row,3, v[3],false,false) guiGridListSetItemText(Grid,row,4, v[4],false,false) guiGridListSetItemText(Grid,row,5, v[5],false,false) guiGridListSetItemText(Grid,row,6, v[6],false,false) guiGridListSetItemText(Grid,row,7, v[7],false,false) guiGridListSetItemText(Grid,row,8, v[8],false,false) guiGridListSetItemText(Grid,row,9, v[9],false,false) guiGridListSetItemText(Grid,row,10, v[10],false,false) guiGridListSetItemText(Grid,row,11, v[11],false,false) guiGridListSetItemText(Grid,row,12, v[12],false,false) guiGridListSetItemText(Grid,row,13, v[13],false,false) Close1 = guiCreateStaticImage(215, 117, 101, 32, "s/Close.png", false, win) -- I want it to close the window. I tried several ways but no result. Buy = guiCreateStaticImage(320, 95, 200, 60, "s/Buy.png", false, win) Send = guiCreateStaticImage(320, 224, 200, 60, "s/Send.png", false, win) GUIEditor.staticimage[4] = guiCreateStaticImage(352, 339, 170, 132, "s/logo.png", false, win) end end) I want it to close the window. I tried several ways but no result.
  3. En este serie de videos estaré introduciendo al mundo de la programación de GUI o mejor conocido como paneles en el mundo de MTA, Para esto hay que conocer que son las GUI La interfaz gráfica de usuario, conocida también como GUI, es un programa informático que actúa de interfaz de usuario, utilizando un conjunto de imágenes y objetos gráficos para representar la información y acciones disponibles en la interfaz. (re copiado de la wikipedia xd) Para esto no hay que ser muy experto en la programación en MTA solo es de conocer las bases para ellos se deben conocer. Conocer eventos, saber crear funciones, conocer la diferencia entre cliente y servidor. Tener el GUI editor instalado. Conocer lo básico en programación. Así que acompáñame en esta serie de videos para principiantes. Parte 1 - Botones. Parte 2 - Edit Box y Label
  4. So first I tried on top-left: window = guiCreateWindow(800, 290, 500, 500, "Testing", false) closeBut = guiCreateButton(0, 0, 22, 19, "X", false, window) guiSetProperty(closeBut, "ClippedByParent", "False") guiSetProperty(closeBut, "AlwaysOnTop", "True") It looks like this: Now, I'm used to it on the right just like most operating systems, it just doesn't look right to me, so I tried taking it to the top right of the window.. window = guiCreateWindow(800, 290, 500, 500, "Testing", false) closeBut = guiCreateButton(800-22-5, 0, 22, 19, "X", false, window)--X position set to 800-button width guiSetProperty(closeBut, "ClippedByParent", "False") guiSetProperty(closeBut, "AlwaysOnTop", "True") It took me an hour to figure out that the button is that far above ? Now, I tried to see how I could make it go lower: window = guiCreateWindow(800, 290, 500, 500, "Testing", false) closeBut = guiCreateButton(160-19, 0, 22, 19, "X", false, window) --Here I tried to make it on one-quarter 1/4 guiSetProperty(closeBut, "ClippedByParent", "False") guiSetProperty(closeBut, "AlwaysOnTop", "True") Of course, I tried changing its 'Y' position, to end up between 2 numbers that were the reason I'm asking for aid: window = guiCreateWindow(800, 290, 500, 500, "Testing", false) closeBut = guiCreateButton(160-19, 8, 22, 19, "X", false, window)--Kept on one-quarter but with 'Y' position as 8 guiSetProperty(closeBut, "ClippedByParent", "False") guiSetProperty(closeBut, "AlwaysOnTop", "True") window = guiCreateWindow(800, 290, 500, 500, "Testing", false) closeBut = guiCreateButton(160-19, 9, 22, 19, "X", false, window)--Kept on one-quarter but with 'Y' position as 9 guiSetProperty(closeBut, "ClippedByParent", "False") guiSetProperty(closeBut, "AlwaysOnTop", "True") I don't want to use onClientRender for CPU usage and a button without parent means its on top of the guiRoot and if you open more than 1 window, those buttons will be on top of everything.. I tried using labels, worked perfectly. And the rest? Static images, edits, combo box, checkbox, radio button, grid list, memo, progress bar, scroll bar and tab panel have the same problem as the button takes the same position as all these pictures.. Anyone knows what should I do? I don't want to place the button on top-left neither use a label as button..
  5. Hello, I would like help with sizing gui (relative) For consistency on all screen sizes as on my screens I hope you can help me, thanks in advance
  6. So the problem is that there is a function called "animate" https://wiki.multitheftauto.com/wiki/Animate and with this function we can animate the GUI etc ... but there is one problem, because I would like to stop this function at some point and stop animating at some point, there is a way to do that ?
  7. I've been working on a script that realistically manipulates the wheels. I've gotten to the point I can hide the original wheels, in hopes I can later attach a new set in the same place. I'm aware I might have to use attachElements, and several other functions. For the moment, I'd like to attach a single wheel. I've got this: -- All GUI elements. local vehicle = getPedOccupiedVehicle(localPlayer) local x1, y1, z1 = getVehicleComponentPosition(vehicle, "wheel_lf_dummy") local x2, y2, z2 = getVehicleComponentPosition(vehicle, "wheel_rf_dummy") local x3, y3, z3 = getVehicleComponentPosition(vehicle, "wheel_lb_dummy") local x4, y4, z4 = getVehicleComponentPosition(vehicle, "wheel_rb_dummy") local function replace1 () attachElements (1097, vehicle, x1, y2, z1, 0, 0, 0) end addEventHandler ("onClientGUIClick", set1, replace1, false) -- Function runs when button called 'set1' is clicked. -- Everything else. Here's my thought process: First, I get the player's vehicle. Then, I get the position of all four wheels in the player's vehicle, and represent them with x1, y1 and z1. With all wheels hidden by another function, I then attach the wheel model in the same place as the front left wheel. At the moment, I'm only aiming at the position; I'll handle the rotation later. DB 3 can't identify '1097', and thus asks for a valid element. Am I on the right path?
  8. I made this: -- All other functions and GUI creation. -- [...] -- Created button called "fbumper". local function setFBumper() local theVeh7 = getPedOccupiedVehicle(localPlayer) if theVeh7 then setVehicleComponentVisible(theVeh7, "bump_front_dummy", false) end end addEventHandler("onClientGUIClick", fbumper, setFBumper, false) -- Everything else... It works. Then I wanted to have the button switch between true to false when clicked. Something like: local function setFBumper() local theVeh7 = getPedOccupiedVehicle(localPlayer) if theVeh7 then setVehicleComponentVisible(theVeh7, "bump_front_dummy", false) elseif getVehicleComponentVisible(theVeh7) == "false" then setVehicleComponentVisible(theVeh7, "bump_front_dummy", true) end end addEventHandler("onClientGUIClick", fbumper, setFBumper, false) guiSetVisible (vehmod, false) It doesn't work correctly. It sets it invisible, but it doesn't return the state to visible. I also thought about using the setVehicleComponentVisible (not setVehicleComponentVisible) to make it a little bit more compact. I'm using a setEngineState script to help myself, but I don't know how to use it with these arguments. DB 3 throws nothing. What am I doing wrong?
  9. [SOLVED] This will certainly be a beginner's subject. The folder [gameplay], located in "Resources", is filled with .rar files. I want to edit 'help.xml', which is inside "freeroam.rar". I tried extracting everything into a new folder called "freeroam", but my server is not detecting said folder. I'm sure I'm ignoring a command somewhere that's failing to locate the folder (might be written to only locate "freeroam.rar"). What can I do to reach the file, modify it, and keep the freeroam files working?
  10. Hello dudes, I make a circular menu like in gta 5. For this I use dxDrawImage, the menu is divided into 8 pictures. For effect, I hover to change the picture. But the hover area is big. When an empty place is induced. That changes the picture. How to fix it? (Sorry for my English)
  11. Hello, want to make a inventory system. What is better CEF or dxDraw? Say CEF slow performance, but faster development.
  12. Hello, I am trying to make a script that swaps the image on screen for a new one from a table I really am lost and dont have idea what to do next, local screenW, screenH = guiGetScreenSize() local randomize2 = math.random ( #Imagens ) local alpha = 255 local current_image = "" function ImageRender(image,alpha) if getElementData (getLocalPlayer( ),"logedin") == false or getElementData (getLocalPlayer( ),"logedin") == nil then current_image = guiCreateStaticImage(0, 0, screenWidth, screenHeight, tostring(Imagens[image]), false) guiMoveToBack( current_image ) guiSetAlpha(current_image, alpha ) end end addEventHandler("onClientResourceStart", resourceRoot,ImageRender) function RenderImageSwap() if getElementData (getLocalPlayer( ),"logedin") == false or getElementData (getLocalPlayer( ),"logedin") == nil then if (alpha > 0) then newAlpha = alpha < 25 if (newAlpha < 0) then ImageRender(randomize2,255) else ImageRender(current_image,newAlpha) end end end end setTimer( RenderImageSwap, 1000, 0) This is my code right know, which unfortunately, isnt working at all, does anyone know how to make a fade out an image (set alpha to alpha - 25.5 in a duration of 10 seconds for example) and if it reaches zero, it fades the next one in (set alpha of new image to alpha + 25.5 in a duration of 5 seconds for example) thanks I really tried my best but I dont know what functions to use, was thinking on getCurrentTick but I dont get how it works
  13. Hello, I dont know if someone has posted this here before, I searched and wasn´t able to find anyone having this problem, my problem is, I have a DayZ script, which I have been modifying, but since the start some of my players were not able to click on the GUI from the Inventory, nor the gang system, nor the login panel, this just happens with some players, for example, everything works on my computer, but with a virtual machine, I am not able to click on anything, here is a video of what I am talking about, I have no idea why this is caused, there is no related problems in my debugscript, actually, there is only 1 thing that is wrong in my server and been lazy to fix it, just a warning and I am missing an event client side which has nothing to do with this, since it affects various resources, the only way I´ve been able to fix this is by restarting the resource, that seems to fix the issue but I cant restart every time someone logs in: VIDEO: VIDEO (dont know the tags to embed video here) Any help is appreciated
  14. Вечер добрый, столкнулся с тем, что иногда после нажатия кнопки закрытия не исчезает GUI. Мышка скрывается а интерфейс остается. Юзаю вот такой костыль: function atmGUI() atmGUIMain = guiCreateStaticImage(0, 0, screenx, screeny, "atm.png", false) exitGUIbtn = guiCreateStaticImage(screenx/1.1955, screeny/1.367, screenx/20.5, screeny/17, "button.png", false, atmGUIMain) showCursor(true) end addEvent("drawATMgui", true) addEventHandler("drawATMgui", localPlayer,atmGUI) addEventHandler("onClientGUIClick", getRootElement(), function() if(source == exitGUIbtn) then guiSetVisible(atmGUIMain, false) destroyElement(atmGUIMain) showCursor(false) end end ) В основном всё работает как надо, но иногда бывают траблы с закрытием. Подскажите пожалуйста как исправить этот косяк.
  15. Is it possible to get all the guiStaticImages that have the specified color? I created a few guiStaticImages that are using a fully black png image. i was trying to do it this way, but it does not work.. for i, v in ipairs(getElementType("gui-staticimage")) do local color = guiGetProperty(v, "ImageColours") if color == "000000" then outputChatBox("lol") end end
  16. Hello. (sry for english and stupid question) I created window and input field on DGS win = DGS:dgsDxCreateWindow(0.18, 0.27, 0.22, 0.3," ",true,0xFF000000,25,nil,0xFFFFFFFF,nil,0xFFFFFFFF,5,true) -- window emailBoxReg = DGS:dgsCreateEdit( 0.1, 0.36, 0.8, 0.1, "INPUT FIELD", true, win, 0xFF000000, 0.5, 0.5, nil, 0xFFEBEBEB, false) -- input field DGS:dgsDxGUISetVisible( winReg, true) -- show DGS:dgsDxWindowSetMovable(winReg, false) DGS:dgsDxWindowSetSizable(winReg, false) guiSetInputEnabled(true) -- input showCursor(true) -- cursor why if i click on input field, later click on window - next clicks everywhere not work?
  17. Hi guys,im stuck here... I want when i press on GUIEditor.button[1] it sends that i typed in GUIEditor.edit[1] to selected player.. --client GUIEditor = { edit = {}, button = {}, window = {}, label = {}, gridlist = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 528) / 2, (screenH - 183) / 2, 528, 183, "dm panel - gat", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(29, 32, 186, 142, false, GUIEditor.window[1]) local column = guiGridListAddColumn(GUIEditor.gridlist[1], "players", 0.9) GUIEditor.button[1] = guiCreateButton(247, 107, 271, 60, "DM", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.edit[1] = guiCreateEdit(247, 32, 269, 65, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(216, 63, 31, 15, "close", false, GUIEditor.window[1]) for id, player in pairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor.gridlist[1]) guiGridListSetItemText ( GUIEditor.gridlist[1], row, column, getPlayerName ( player ), false, false ) guiSetVisible(GUIEditor.window[1], false ) end end ) function show () if guiGetVisible(GUIEditor.window[1] ) then guiSetVisible(GUIEditor.window[1], false ) showCursor (false) else guiSetVisible(GUIEditor.window[1], true ) showCursor (true) end end addCommandHandler("dm", show) function clickin () if source == GUIEditor.label[1] then guiSetVisible(GUIEditor.window[1], false ) showCursor (false) elseif source == GUIEditor.button[1] then if guiGetText(GUIEditor.edit[1] ) == "" then return end --im stoped here, showCursor (false) guiSetVisible(GUIEditor.window[1], false ) end end addEventHandler("onClientGUIClick", root, clickin)
  18. Somehow i can make this possible? When a player connect, then he have to wait the end of download, then he can use the fr gui. I want make fr gui usable when player download the mods. Sorry for my bad english..
  19. I made an script that make staffs can open an panel by using /dm then choose a player and type a message then send it... But my problem is i don't know how to trigger this to put this code in server side outputChatBox(msg, selectedplayer, 255, 255, 255, true) I mean to send the message to selected player only... client variables: msg = guiGetText(editbox) selectedplayer = guiGridListGetSelectedItem(gridlist) Help pls
  20. Hey, I don't know whats wrong in this guy. any ideas? GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(563, 204, 519, 491, "Rules and Regulation", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(9, 29, 500, 418, "", false, GUIEditor.window[1]) button1 = guiCreateButton(18, 449, 491, 32, "I agree", false, GUIEditor.window[1]) end ) function closeButton() if button1 == source then outputChatBox("Hey") end end addEventHandler("onClientGUIClick",button1,closeButton,false)
  21. Hi all, I'm putting together a section of My Account on my server, I want it to be a little window with a tabpanel that has the following tabs: Start (where it shows the basic statistics, name, type of account, level, etc) Configuration (where it will show buttons to change the password, delete the account, etc) Clan/Gang (where it would show data exported from the gangystem) For now I can not think of any other flap, if any one sees a utility to a flap I could also recommend it The problem is this, I am creating this through the freeroam resource GUI (since the My Account button is in the freeroam too, then I wanted to do everything together). The code is the following: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, }, } The result: It's strange, but I say ... maybe the tab is missing for it to work, so I add it and the code looks like this: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, {'tab', id='tab1', text='pruebaTab', width=200 , height=200}, }, } But the result is that when I want to open this section (My Account) it shows the last 2 errors in the debugscript (ignore 'callesgroove' resource) Somebody could help me? From already thank you very much!
  22. Buenas a todos, estoy armando una sección de Mi Cuenta en mi servidor, quiero que sea una ventanita con un tabpanel que tenga las siguientes pestañas: Inicio (donde muestra las estadisticas basicas, nombre, tipo de cuenta, nivel, etc) Configuración (donde mostrara botones para cambiar la clave, eliminar la cuenta, etc) Clan (donde mostraria datos exportados del gangystem) Por ahora no se me ocurre ninguna otra solapa, si alguno le ve alguna utilidad a una solapa podría recomendármela también El problema es el siguiente, estoy creando esto a través de la GUI del resource freeroam (ya que el botón de Mi Cuenta está en el freeroam también, entonces quería hacer todo junto). El código es el siguiente: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, }, } Y el resultado el siguiente: Es extraño, pero digo... quizá le faltan las tab para que funcione, entonces la agrego y el codigo queda así: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, {'tab', id='tab1', text='pruebaTab', width=200 , height=200}, }, } Pero el resultado es que cuando quiero abrir esta sección (Mi Cuenta) muestra los ultimos 2 errores en el debugscript (ignoren el de callesgroove) Alguien podría ayudarme? Desde ya, muchas gracias!
  23. Hi, is there already a way to make the default gui editboxes transparent? It seems to always have a white background, which doesn't look so good if they are used within a dx environment. If not, then this might be a good way to make the default editboxes usable outside of an actual gui window. @ccw Bonsai
  24. Hi all, could you tell me how to make a dynamic installation of interface sizes depending on the size of the user's screen? Code: function guiCreateMainMenu() local sWidth,sHeight = guiGetScreenSize() local localPlayerName = getPlayerName(getLocalPlayer()) mainMenuSound() menu = guiCreateStaticImage( 0, 0, sWidth, sHeight, "img/screen_shadow.png", false ) userImg = guiCreateStaticImage( sWidth/2.8, 0, sWidth/1.5, sHeight/1.5, "img/user.png", false, menu ) menuBg = guiCreateStaticImage( sWidth/7, sHeight/8.07692, sWidth/1.4, sHeight/17, "img/bg.png", false, menu ) menuFg = guiCreateStaticImage( sWidth/7, sHeight/8.07692, sWidth/1.4, sHeight/17, "img/fg.png", false, menu ) usernameLabel = guiCreateLabel( sWidth/2434.78260, sHeight/14000, 1, 1, localPlayerName, true, userImg) --24 символа макс. userNameFont = guiCreateFont( "fonts/calibri.ttf", 16 ) guiSetFont ( usernameLabel, userNameFont ) menuMainLabel = guiCreateLabel( sWidth/8400, sHeight/11666.66666, 1, 1, "*Главное меню*", true, menu) mainMenuFont = guiCreateFont( "fonts/carbon.ttf", 32 ) guiSetFont ( menuMainLabel, mainMenuFont ) carrierBtn = guiCreateLabel( (0.12/1680)*sWidth, 0.341, 1, 1, "КАРЬЕРА", true, menuFg) carrierBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( carrierBtn, carrierBtnFont ) carrierButton = guiCreateStaticImage( 385, 154, 80, 13, "img/btn.png", false, menu ) statBtn = guiCreateLabel( 0.2, 0.341, 1, 1, "СТАТИСТИКА", true, menuFg) statBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( statBtn, statBtnFont ) statButton = guiCreateStaticImage( 481, 154, 111, 13, "img/btn.png", false, menu ) achBtn = guiCreateLabel( 0.313, 0.341, 1, 1, "ДОСТИЖЕНИЯ", true, menuFg) achBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( achBtn, achBtnFont ) achButton = guiCreateStaticImage( 615, 154, 121, 13, "img/btn.png", false, menu ) bestBtn = guiCreateLabel( 0.432, 0.341, 1, 1, "ТОП ЛУЧШИХ ИГРОКОВ", true, menuFg) bestBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( bestBtn, bestBtnFont ) bestButton = guiCreateStaticImage( 758, 154, 198, 13, "img/btn.png", false, menu ) settingsBtn = guiCreateLabel( 0.616, 0.341, 1, 1, "НАСТРОЙКИ", true, menuFg) settingsBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( settingsBtn, settingsBtnFont ) settingsButton = guiCreateStaticImage( 980, 154, 101, 13, "img/btn.png", false, menu ) newsBtn = guiCreateLabel( 0.720, 0.341, 1, 1, "НОВОСТИ", true, menuFg) newsBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( newsBtn, newsBtnFont ) newsButton = guiCreateStaticImage( 1106, 154, 78, 13, "img/btn.png", false, menu ) aboutBtn = guiCreateLabel( 0.810, 0.341, 1, 1, "О СЕРВЕРЕ", true, menuFg) aboutBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( aboutBtn, aboutBtnFont ) aboutButton = guiCreateStaticImage( 1213, 154, 87, 13, "img/btn.png", false, menu ) showCursor(true) showChat(false) setPlayerHudComponentVisible("all", false) end
  25. Доброго времени суток. Столкнулся с такой проблемой как динамическое изменение размеров интерфейса под разрешение экрана игрока. Я накидал GUI под своё разрешение экрана т.е. в таком виде: guiCreateLabel( 0.2, 0.341, 1, 1, "СТАТИСТИКА", true, menuFg) statBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( statBtn, statBtnFont ) Вообще это всё выглядит вот так: Скриншот Код клиента целиком: function guiCreateMainMenu() local sWidth,sHeight = guiGetScreenSize() local localPlayerName = getPlayerName(getLocalPlayer()) mainMenuSound() menu = guiCreateStaticImage( 0, 0, sWidth, sHeight, "img/screen_shadow.png", false ) userImg = guiCreateStaticImage( sWidth/2.8, 0, sWidth/1.5, sHeight/1.5, "img/user.png", false, menu ) menuBg = guiCreateStaticImage( sWidth/7, sHeight/8.07692, sWidth/1.4, sHeight/17, "img/bg.png", false, menu ) menuFg = guiCreateStaticImage( sWidth/7, sHeight/8.07692, sWidth/1.4, sHeight/17, "img/fg.png", false, menu ) usernameLabel = guiCreateLabel( sWidth/2434.78260, sHeight/14000, 1, 1, localPlayerName, true, userImg) --24 символа макс. userNameFont = guiCreateFont( "fonts/calibri.ttf", 16 ) guiSetFont ( usernameLabel, userNameFont ) menuMainLabel = guiCreateLabel( sWidth/8400, sHeight/11666.66666, 1, 1, "*Главное меню*", true, menu) mainMenuFont = guiCreateFont( "fonts/carbon.ttf", 32 ) guiSetFont ( menuMainLabel, mainMenuFont ) carrierBtn = guiCreateLabel( (0.12/1680)*sWidth, 0.341, 1, 1, "КАРЬЕРА", true, menuFg) carrierBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( carrierBtn, carrierBtnFont ) carrierButton = guiCreateStaticImage( 385, 154, 80, 13, "img/btn.png", false, menu ) statBtn = guiCreateLabel( 0.2, 0.341, 1, 1, "СТАТИСТИКА", true, menuFg) statBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( statBtn, statBtnFont ) statButton = guiCreateStaticImage( 481, 154, 111, 13, "img/btn.png", false, menu ) achBtn = guiCreateLabel( 0.313, 0.341, 1, 1, "ДОСТИЖЕНИЯ", true, menuFg) achBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( achBtn, achBtnFont ) achButton = guiCreateStaticImage( 615, 154, 121, 13, "img/btn.png", false, menu ) bestBtn = guiCreateLabel( 0.432, 0.341, 1, 1, "ТОП ЛУЧШИХ ИГРОКОВ", true, menuFg) bestBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( bestBtn, bestBtnFont ) bestButton = guiCreateStaticImage( 758, 154, 198, 13, "img/btn.png", false, menu ) settingsBtn = guiCreateLabel( 0.616, 0.341, 1, 1, "НАСТРОЙКИ", true, menuFg) settingsBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( settingsBtn, settingsBtnFont ) settingsButton = guiCreateStaticImage( 980, 154, 101, 13, "img/btn.png", false, menu ) newsBtn = guiCreateLabel( 0.720, 0.341, 1, 1, "НОВОСТИ", true, menuFg) newsBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( newsBtn, newsBtnFont ) newsButton = guiCreateStaticImage( 1106, 154, 78, 13, "img/btn.png", false, menu ) aboutBtn = guiCreateLabel( 0.810, 0.341, 1, 1, "О СЕРВЕРЕ", true, menuFg) aboutBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( aboutBtn, aboutBtnFont ) aboutButton = guiCreateStaticImage( 1213, 154, 87, 13, "img/btn.png", false, menu ) showCursor(true) showChat(false) setPlayerHudComponentVisible("all", false) end P.S. В начале уже пытался поправить эту проблему, но получилось мягко говоря не очень. Подскажите пожалуйста как оптимизировать меню без танцев с подбором новых значений?
×
×
  • Create New...