TextOut command and text Justify

Find quick help here to get you started with Hollywood
Post Reply
SpawnPPC
Posts: 61
Joined: Fri Mar 15, 2024 11:51 pm

TextOut command and text Justify

Post by SpawnPPC »

Hi everyone.

I have these 2 lines of code:

-----
TextOut(#CENTER, WinHeight/4, GetCatalogString(16, "Critical Error!")) ; Display a blank line and then string 5 with the solution, with English fallback
-----
TextOut(#CENTER, WinHeight/4 + 40, GetCatalogString(5, "Error: The executable must be run from the AmiWORP-Gate directory.\n\nTo solve this issue, ensure that the executable is located in the correct folder.\nIf the executable is not inside the AmiWORP-Gate folder, the application will not function correctly and will continue to show this error.\n\nThe program will close in:"))
-----

There are 2 TextOut commands.
I'm going crazy trying to figure out why the first command works fine and places itself perfectly in the center of the window I have open, while the second is all wrong and seems to start further to the left of the window, practically outside the window and therefore missing pieces, like if the #CENTRE command doesn't work.

Ideas ?

Also is there a way to justify the text ?

Thanks everyone

bySpawnPPC
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: TextOut command and text Justify

Post by plouf »

how certain you are that catalogstring id =16 is NOT a "" (correctly loaded but empty string ?)

more code needed, just a small sniped showing problem not your entire program
for example problem maybe in calculating WinHeight !?

i.e. have you try the "faulty command" with hardcoded position ?
TextOut(100, 100, GetCatalogString(16, "Critical Error!"))
Christos
Flinx
Posts: 342
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: TextOut command and text Justify

Post by Flinx »

Maybe your strings are too long?
Try to insert an argument table with WordWrap at the end of your string between the closing brackets "...), {WordWrap=600})" and replace the 600 with your window width.
SpawnPPC
Posts: 61
Joined: Fri Mar 15, 2024 11:51 pm

Re: TextOut command and text Justify

Post by SpawnPPC »

I done, thanx !!!

bySpawnPPC
Flinx
Posts: 342
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: TextOut command and text Justify

Post by Flinx »

BTW, your second question is answered in the TextOut() manual entry: Add "Align=#JUSTIFIED" to the argument table. Of course this works only for exactly this text object.
Post Reply