PennController for IBEX › Forums › Support › Displaying texts in columns › Reply To: Displaying texts in columns
January 24, 2023 at 1:23 pm
#9857
Jeremy
Keymaster
Hi Laia,
Your code actually works pretty well already, the only problem is that the text on the left overflows onto the text on the right. This is because you didn’t explicitly set a width to the text element, so it inherits the width of its container, the Canvas element
Just give an explicit width to your Text elements and you’ll be good:
getText(oneFirst?"sentence1":"sentence2").size(300,"auto").print( 20,0,getCanvas("frases")), getText(oneFirst?"sentence2":"sentence1").size(300,"auto").print(350,0,getCanvas("frases")),
Jeremy