fasadhr.blogg.se

Mtasa label center text
Mtasa label center text










mtasa label center text

The same principles apply to both Width and Height as well (with a Width value of 0.5 meaning the window will be half as wide as the screen). Similarly, if the top of the screen is 0 and the bottom is 1, a Y position of 0.2 would be 20% of the way down the screen. This means that if the far left side of the screen is 0, and the far right is 1, an X position of 0.5 would represent the center point of the screen. This indicates that the coordinates and dimensions of the window are relative, meaning they are a percentage of the total screen size. Note that the final argument passed to guiCreateWindow in the above example is true. WdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) click on the function's name to read its documentation create the window and save its element value into the variable 'wdwLogin' define the width and height of the window

mtasa label center text mtasa label center text

define the X and Y positions of the window To create a window we will use guiCreateWindow: In this file we will write a function that draws the window. Under /client/ directory, create a text file and name it "gui.lua". It is also a good practice to keep all the client scripts in a separate folder.īrowse to /Your MTA Server/mods/deathmatch/resources/myserver/ directory, and create a folder named "client". We'll also take a look at client-side scripting.Īll the GUI must be made client-side. The tutorial will continue the gamemode we made in Introduction to Scripting (If you have used the Introduction to Scripting, you will need to remove or comment the spawnPlayer line in the "joinHandler" function in your code, as we will be replacing it with a GUI alternative in this tutorial). The window appears when the player joins the game, and once the button is clicked, the player is spawned. In this tutorial, we'll make a simple login window, with two input boxes and a button.












Mtasa label center text