I was hoping it would be a simple process of obtaining the current game windows size, so that I may correctly center my text since I’m assuming that it simply won’t be perfectly centered for everyone, considering 720p, 1080p, 2K, 4K, you know what I mean.
It’s likely I could be missing something fairly obvious, it’s currently 1AM, I can hardly see straight as I’m typing this, and quite frankly I’m new to development for FiveM as a whole.
Regardless, hopefully someone might know where I could go from this and hopefully point me in the right direction, thanks in advance everyone
To get text to appear centered you can do something like the following (taken from NativeUI, very basic)
local screenW, screenH = GetScreenResolution()
local height = 1080
local ratio = screenW/screenH
local width = height*ratio
AddTextComponentString( someString )
DrawText( width/2, 100) -- appear 100 pixels from the top (i think) centered in the x