View Single Post
Old 11-09-2019, 04:42 AM   #1
Human being with feelings
Dafarkias's Avatar
Join Date: Feb 2019
Location: England
Posts: 418
Default gfx.drawstr flags???

Having difficulty figuring out these 'flags'.

Here's the official documentation:

Lua: gfx.drawstr("str"[,flags,right,bottom])

Draws a string at gfx.x, gfx.y, and updates gfx.x/gfx.y so that subsequent draws will occur in a similar place.

If flags, right ,bottom passed in:
  • flags&1: center horizontally
  • flags&2: right justify
  • flags&4: center vertically
  • flags&8: bottom justify
  • flags&256: ignore right/bottom, otherwise text is clipped to (gfx.x, gfx.y, right, bottom)

I want to center justify, w/o doing it manually...

I've tried a handful of different combinations of inputs into the function, without avail.

Last edited by Dafarkias; 11-09-2019 at 04:48 AM.
Dafarkias is online now   Reply With Quote