Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: Oomek on June 13, 2018, 03:30:53 PM

Title: New feature: vertical text alignment
Post by: Oomek on June 13, 2018, 03:30:53 PM
I’ve added some additional flags to fe.text.align property
Align.TopCentre
Align.TopLeft
Align.TopRight
Align.BottomCentre
Align.BottomLeft
Align.BottomRight

(https://s22.postimg.cc/dblr6uyrh/A3_BD3721-2452-4832-_B1_A9-_DC0_E950_F6150.png) (https://postimg.cc/image/dblr6uyrh/)

(https://s22.postimg.cc/wgp0gm5pp/D1562_B3_B-2300-4_C1_D-_BC97-0_A7_AB72_EC256.png) (https://postimg.cc/image/wgp0gm5pp/)

I would like you to test it with your fonts and report if it aligns nicely.
I’m attaching a compiled attract.exe x64 and an example layout for testing

https://1drv.ms/u/s!Ag7uFeM0f_fzhOM9Eb2a5bKE6dKv1g
Title: Re: New feature: vertical text alignment
Post by: jedione on June 13, 2018, 05:22:44 PM
i will have a go,   and report back tomorrow  thanks...

Q: this am64 you compiled would not happen to be the one
that is set up to run your new ambiance theme would it?   ;D ;D

maybee.......


update:
 it is saying that the archive is damaged   ,,when you try to open...
will try later
Title: Re: New feature: vertical text alignment
Post by: Oomek on June 13, 2018, 05:38:53 PM
No. It’s a separate fork. I will merge them if there were no issues.

The file was too large, I’ve swapped it with the link to my OneDrive.
Title: Re: New feature: vertical text alignment
Post by: jedione on June 13, 2018, 08:03:54 PM
cool thanks,    ;)
Title: Re: New feature: vertical text alignment
Post by: Oomek on June 15, 2018, 10:39:05 AM
Added the following align modes:

Align.TopLeft, Align.TopRight, Align.TopCentre,
Align.BottomLeft, Align.BottomRight, Align.BottomCentre,
Align.MiddleLeft, Align.MiddleRight, Align.MiddleCentre

The modes:
Align.MiddleLeft, Align.MiddleRight, Align.MiddleCentre

replace the:
Align.Left, Align.Right, Align.Centre

The old align modes:
Align.Left, Align.Right, Align.Centre
are still working like before for compatibility reasons

(https://s33.postimg.cc/qhb2su7m3/align1.png) (https://s33.postimg.cc/hma8ibitr/align1.png)

(https://s33.postimg.cc/uqfsv0il7/align2.png) (https://s33.postimg.cc/linkebbj3/align2.png)

The old alignment modes were quite unreliable causing random vertical shift depending on the font used.
If your custom font is off vertically and your text aligment is set to Align.Left you just swap it with Align.MiddleLeft and it should be positioned pixel-perfect
Title: Re: New feature: vertical text alignment
Post by: jedione on June 15, 2018, 07:51:37 PM
REALLY GREAT WORK...THANKS
Title: Re: New feature: vertical text alignment
Post by: iOtero on June 16, 2018, 06:53:35 AM
Your exe is not compatible with :

Code: [Select]
if (fe.load_module("Debug")) log <- Log();

Not run with my theme layout and not shows "last_run.log" file.
Title: Re: New feature: vertical text alignment
Post by: qqplayer on June 16, 2018, 10:19:18 AM
Thanks for the work , I love this new feature.
I have tried and I dont know if something is going wrong.

(https://i.imgur.com/lZVI0cm.jpg)

Super Sidekicks 2 , Super Sidekicks 3 the word "Super" has dissapeard.
Title: Re: New feature: vertical text alignment
Post by: Oomek on June 17, 2018, 01:05:41 PM
The word "Super" disappears because of the bug? in AM which I’m currently working on I fixed already. If the text does not fit into the box AM cuts the sides and leaves only the middle part if word_wrap is enabled. Weird decision, but that’s how it was originally coded.

Update:

I asked Andrew to explain if it's whether a bug or feature. I need to know that before I pull the changes to Github.
Below is the video describing that odd behaviour. Both text boxes have default align modes.

https://www.youtube.com/watch?v=7QEVZ5mDMjc
Title: Re: New feature: vertical text alignment
Post by: Oomek on June 17, 2018, 01:06:13 PM
Your exe is not compatible with :

Code: [Select]
if (fe.load_module("Debug")) log <- Log();

Not run with my theme layout and not shows "last_run.log" file.

Thanks, I’ll look into it. Maybe it’s because I renabled the old debug window in the make file. If you compile it from my branch it should work.
Title: Re: New feature: vertical text alignment
Post by: iOtero on June 18, 2018, 12:48:15 AM

Thanks, I’ll look into it. Maybe it’s because I renabled the old debug window in the make file. If you compile it from my branch it should work.


 ;D ;D ;Dhttp://forum.attractmode.org/index.php?topic=2278.0;topicseen (http://forum.attractmode.org/index.php?topic=2278.0;topicseen) ;D ;D ;D
Title: Re: New feature: vertical text alignment
Post by: Oomek on June 18, 2018, 02:33:42 AM
Your exe is not compatible with :

Code: [Select]
if (fe.load_module("Debug")) log <- Log();

Not run with my theme layout and not shows "last_run.log" file.

Can you explain what is the purpose and describe the functionality of that plugin?
Title: Re: New feature: vertical text alignment
Post by: iOtero on June 18, 2018, 03:56:53 AM
Is a AM DEBUG mode.
Generate a file "last_run.log" with the console messages, and errors found, and/or the data you want in your layout with a code like this:

Code: [Select]
::print(" > DEBUG: " + fe.game_info(Info.Emulator) + "\n");

https://github.com/keilmillerjr/debug-module (https://github.com/keilmillerjr/debug-module)
Title: Re: New feature: vertical text alignment
Post by: Oomek on June 18, 2018, 04:35:20 AM
Hmm, i still don’t see any benefit of using it. Isn’t using a console version quicker in debugging?
Title: Re: New feature: vertical text alignment
Post by: iOtero on June 18, 2018, 08:45:32 AM
I use a version compiled in June 2018 by Mark Ormond to use the options by display and not just by layout, and I only have that exe.

Never i used debugger for console.