Hi,
I’m trying to align some text to the right but failing miserably. I know I could just tweak the x,y center positions but I have a feeling that will fall apart on different sized screens because the font size will change. Here’s absolutely everything I’ve tried so far:
--# Main
displayMode(FULLSCREEN)
-- Use this function to perform your initial setup
function setup()
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(0, 0, 0, 255)
fill(243, 9, 9, 255)
local x = WIDTH * 0.5
local y = HEIGHT * 0.9
local lineHt = 30
--
textMode(CENTER)
textAlign(RIGHT)
text("I can has\
right alignment?", x, y)
y = y - lineHt
text("plz?", x, y)
y = y - lineHt
textAlign(CENTER)
text("I can has\
right alignment?", x, y)
y = y - lineHt
text("plz?", x, y)
y = y - lineHt
textAlign(LEFT)
text("I can has\
right alignment?", x, y)
y = y - lineHt
text("plz?", x, y)
textMode(CORNER)
y = y - lineHt
textAlign(RIGHT)
text("I can has\
right alignment?", x, y)
y = y - lineHt
text("plz?", x, y)
y = y - lineHt
textAlign(CENTER)
text("I can has\
right alignment?", x, y)
y = y - lineHt
text("plz?", x, y)
y = y - lineHt
textAlign(LEFT)
text("I can has\
right alignment?", x, y)
y = y - lineHt
text("plz?", x, y)
end
I hope it’s just that I don’t know how to properly embed a newline in a string cos that would be kinda funny.