Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: Oomek on March 12, 2017, 07:51:49 AM

Title: Text alignment in AM is completely off [SOLUTION]
Post by: Oomek on March 12, 2017, 07:51:49 AM
Is there any way to make text alignment in AM more coder friendly?
Setting Align.Left does not make the text to be aligned to the left. The y offset is wrong too. What's even worse the gap changes depending on the font type used, so it's practicaly impossible in AM to make a neat theme which scales to various resolutions. I need to compensate the gap and vertical alignment manually in pixels which destroys scalability.

(https://s3.postimg.org/5paot5kjn/attract_2017_03_12_14_38_06_515.png)
Title: Re: text alignment in AM is completely off
Post by: bjose2345 on March 12, 2017, 08:24:22 AM
https://github.com/mickelson/attract/wiki/Scripting-Tips-and-Tricks

hope something there can be help
Title: Re: text alignment in AM is completely off
Post by: Oomek on March 12, 2017, 12:30:52 PM
I'm aware of that wiki page. Unfortunately it doesn't explain how to overcome the misalignment of text in relation to the text box
Title: Re: text alignment in AM is completely off
Post by: Oomek on March 17, 2017, 07:04:00 AM
Well, after few failed attempts to overcome the issue I 've decided to fork AM and fix it myself.

(https://s12.postimg.org/iut16oofx/attract_2017_03_17_13_51_44_572.png)

https://www.youtube.com/watch?v=ULSgTj53ke4 (https://www.youtube.com/watch?v=ULSgTj53ke4)

https://github.com/mickelson/attract/pull/331/files (https://github.com/mickelson/attract/pull/331/files)

It's up to mickelson now if he wants to include it in his build.
Title: Re: Text alignment in AM is completely off [SOLUTION]
Post by: jedione on March 17, 2017, 08:27:22 PM
just wanted to say thanks...looks like you really know what your doing.
good work . going to read up.....on it and use..
Title: Re: Text alignment in AM is completely off [SOLUTION]
Post by: verion on March 18, 2017, 03:27:54 AM
This is soooo awesome. It was always trial-and-error approach with text alignment. Like tweak-reload-tweak-reload-and so on. It's doable - but you have always make correction for text placement.

It will surely help with precise text positioning.
Title: Re: Text alignment in AM is completely off [SOLUTION]
Post by: Oomek on March 18, 2017, 10:51:40 AM
Now we just have to convince raygun to accept my pull request on github.
Title: Re: Text alignment in AM is completely off [SOLUTION]
Post by: verion on March 18, 2017, 11:01:03 AM
Is he against it? Or you didn't ask yet?
Title: Re: Text alignment in AM is completely off [SOLUTION]
Post by: Oomek on March 18, 2017, 11:02:23 AM
He probably didn't see it yet. He's not active recently on either AM forum or GitHub
Title: Re: Text alignment in AM is completely off [SOLUTION]
Post by: Oomek on March 18, 2017, 06:04:56 PM
Example of improvements in small thin font rendering.
As you can see only character size:20 is rendered properly.
On the left AM Baseline, on the right my build.

Make sure your browser has zoom set at 100% and your windows dpi settings are at 100% as well.
Otherwise all fonts will appear as interpolated.

(https://s13.postimg.org/5copgcf1z/fe_Text_fix.png)