CIT Toolscitwiki.com

MTA DX Designer

Draw your screen the way you want it, then copy the dxDraw Lua code for it.

Drag a part to move it. Drag a blue point to change its size. Arrow keys move the picked part 10 px (with Shift: 50 px). Delete removes it, Ctrl+D copies it, Esc unpicks it. This tool is easier to use on a computer.

to draw on top of it. It stays on your computer.

The Lua code


      

How to use the code

  1. Press Download hud.lua. Or press Copy the code and paste it into your own client script.
  2. Put the file in your resource.
  3. Add this line to meta.xml: <script src="hud.lua" type="client" />
  4. Start the resource. The layout shows as soon as the resource starts.

What the code does

MTA draws to the screen every frame. So the whole layout goes inside an onClientRender handler in a client script.

Why relative is the default

People play on every screen size, from 1366 × 768 to 4K. Numbers written straight into dxDrawRectangle are in the wrong place on every screen except yours. The relative code asks the game for the screen size with guiGetScreenSize() and calculates the position from it. So the layout is in the same place for everyone. Use absolute when you want the exact pixels you drew.

Fonts

MTA has its own fonts: default, default-bold, clear, arial, sans, pricedown, bankgothic, diploma, beckett and unifont. Those font files belong to the game, so this page does not include them. The preview here uses fonts that look similar, and the code names the real font. The size on screen will be close, not exact.

Images

An image part writes dxDrawImage with the path you type. The file is in your resource. Add it to meta.xml as <file src="images/logo.png" />. A picture you load here is only for you to see while you design. It stays on your computer.

Do you need coordinates? The coordinates map gives you X and Y for any place in San Andreas.