Text with center vertical alignment

From the Asset Store
Change delay, create new lines, "backspace" the text
  • Hi!

    After r235 update, text objects with center vertical alignment are meshed up. They have moved up a little and a I have to move them back in place in every project.

    Center alignment hurts in C3, was never working as should be and I cannot understand why there is not an absolute center position (with or without bbcode) for the text object and we have to find workarounds, move text objects up and down until we find the correct center position.

    *I read that this kind of problems exist back from C2 and it is hard to change due to backwards compatibility. Yes, but active projects are also meshed up. It's the same thing. So if it cannot be fixed, maybe there should be a new text object for C3 that works correctly?

    **The change in r235 was made to fix center/bottom vertical aligment when BBcode enabled. It is not fixed.. When you check/uncheck BBCode, text moves up/down a little or goes even at the bottom of the text box.

    Screenshot and project file included.

    Thank you

    drive.google.com/file/d/1XI3snrKa4yx87gYgXZCKvoho8Ul1ghjj/view

  • In r235 we fixed a bug in vertical alignment: previously it was not actually correctly vertically aligning the text; now it does a better calculation which is closer to the true middle based on the text metrics. This is technically a breaking change, so if you had adjusted your text positions to compensate for the wrong position, now you don't need to do that and so you might need to move them back a bit again. Unfortunately this is something of an unavoidable consequence of changing the alignment.

    To be honest the alignment of the Text object is a bit of a mess - the Text object dates back to the original version of Construct 2 in 2011, where BBCode was not supported, browsers did not provide the necessary text metrics to accurately align text, and (partly due to the missing text metrics) the original top alignment was actually slightly wrong. These things have been adjusted and fixed over the years (as I explained in the earlier linked bug). However some things are too difficult to change - for example if we changed the default "top" alignment we would break 10 years worth of Construct projects and inevitably be forced to change it back again. The change to middle/bottom vertical alignment when using BBcode was deemed to be both infrequently used enough to justify changing, and necessary as the previous result was actually wrong.

  • Ashley I think it got much worse in r241.

    It definitely isn't centered..

    Will it stay like this now? Do we need to adjust texts in all projects?

  • That looks wrong, but the change was made 2 months ago now. It seems to be working fine for everyone else. As ever, it's best to file an issue following all the guidelines, since it's usually impossible to tell what's going on without that information.

  • I'm opening the same project file in r234.4 and r241, and the text is completely misplaced..

    EDIT: This seems to be happening with some web fonts imported to the project, and when bbcode is enabled.

    Bug report:

    github.com/Scirra/Construct-3-bugs/issues/4711

  • I had to basically rebuild all my projects after the last stable. Took several days for me to change all the text objects. I had to use super complex calculations taking into account the font size and the text object height. I also change the font size from time to time depending on the screen size and ratio and needed even more calculations to move the whole text object to compensate for the incorrect y position. Ashley Please do not make any more changes to this ever again.

  • I, also, had to rebuild my projects and I was working for days moving texts up and down, rewriting events, etc. But... as long as this problem exists, it is a real pain every single time you create a new text object or start a new project. So in my opinion this problem definitely has to be fixed somehow.. Maybe, there should be a new text object in C3 that works as it should be.. and keep old text object for old projects.

  • I agree it should be fixed. But it should be perfectly aligned (for all fonts) or it makes no sense to change it. If it can't be fixed 100% it should not be touched at all. Text never worked well for Construct so I guess it can't be made perfect.

    Edit: I mean what is the point of me and you spending hours and days realigning text objects (to a new position that is still wrong. Maybe less wrong but still.) when we could use that time making an awesome game instead?

  • I agree with you.. it should be perfectly aligned. We have C3, one of the best game creation tools out there and we cannot perfectly align text? Come on guys! :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think I have a temporary solution to this.

    I noticed that if I resize the HEIGHT of the text to double the font size this problem does not happen.

    For example: if the font size is 35px, I put the text height at 70px.

    It cannot be bigger or smaller, it is exactly double.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)