text positioning - device vs sim - screenshot included

Thanks Joakim. Although living with a goofy bug like that isn’t really acceptable (not saying that to you, to Corona employees listening).

So, essentially we are taking the position + some offset with the variable, but what offset are we supposed to be using?? Is the offset unique per device?

Also for Corona Employees: If that is accurate, that we are stuck living with this ‘bug’, then I would like to see some official documentation on the workaround, at the least.

Thanks,

-Mark [import]uid: 9189 topic_id: 24605 reply_id: 128032[/import]

This needs to be fixed. It’s biting me in an app right now. It’s terrible to have to see stuff in the simulator not be in the same place on the device. To make matters worst, it seems to be off a bit depending on the device too.
[import]uid: 19626 topic_id: 24605 reply_id: 128033[/import]

I’m using build 929 and this is still a problem.

Any idea on when this will get fixed? It’s very frustrating to align text this way.

-Mark [import]uid: 9189 topic_id: 24605 reply_id: 128029[/import]

This will not be fixed, we have to live with it - that was the answer I got from my bugreport.

Use a variable to align your text correctly according to the device positioning. It works fine.

Joakim [import]uid: 81188 topic_id: 24605 reply_id: 128030[/import]

Thanks Joakim. Although living with a goofy bug like that isn’t really acceptable (not saying that to you, to Corona employees listening).

So, essentially we are taking the position + some offset with the variable, but what offset are we supposed to be using?? Is the offset unique per device?

Also for Corona Employees: If that is accurate, that we are stuck living with this ‘bug’, then I would like to see some official documentation on the workaround, at the least.

Thanks,

-Mark [import]uid: 9189 topic_id: 24605 reply_id: 128032[/import]

This needs to be fixed. It’s biting me in an app right now. It’s terrible to have to see stuff in the simulator not be in the same place on the device. To make matters worst, it seems to be off a bit depending on the device too.
[import]uid: 19626 topic_id: 24605 reply_id: 128033[/import]

  • 1 [import]uid: 140000 topic_id: 24605 reply_id: 130280[/import]
  • 1 [import]uid: 140000 topic_id: 24605 reply_id: 130280[/import]

I was told by Corona that this will NOT be fixed - 10 times faster development - yeah, but not when dealing with text…It is a nightmare positioning all text…

Joakim [import]uid: 81188 topic_id: 24605 reply_id: 130332[/import]

I was told by Corona that this will NOT be fixed - 10 times faster development - yeah, but not when dealing with text…It is a nightmare positioning all text…

Joakim [import]uid: 81188 topic_id: 24605 reply_id: 130332[/import]

Joakim can you post an example of “Use a variable to align your text correctly according to the device positioning. It works fine.”

agreed that this is a frustrating issue. [import]uid: 32462 topic_id: 24605 reply_id: 130344[/import]

Well, it depends on what font you are using and I am always starting of with the exact positioning in corona, before I add a variable that takes care of the errors. When I build my menus etc, I always positioning things dynamically so that stuff is in relation to each other.

For example: If I am positioning a text at 100,100 - I take a screenshot on the device and open that screenshot in photoshop to check the exact position. Any differences here I will just add to a variable.

So if the position in photoshop is 103,98 I will add two variables to my project that takes care of these errors:

 local leftAlign = 3;  
 local topAlign = -2;  
  
 myText = display.newText("This is my text", ReferencingObject.x + leftAlign, ReferencingObject.y + topAlign);  
  

With this way, I am sure that text is aligned perfect no matter if it looks like crap in the simulator.

Joakim [import]uid: 81188 topic_id: 24605 reply_id: 130345[/import]

Joakim can you post an example of “Use a variable to align your text correctly according to the device positioning. It works fine.”

agreed that this is a frustrating issue. [import]uid: 32462 topic_id: 24605 reply_id: 130344[/import]

Well, it depends on what font you are using and I am always starting of with the exact positioning in corona, before I add a variable that takes care of the errors. When I build my menus etc, I always positioning things dynamically so that stuff is in relation to each other.

For example: If I am positioning a text at 100,100 - I take a screenshot on the device and open that screenshot in photoshop to check the exact position. Any differences here I will just add to a variable.

So if the position in photoshop is 103,98 I will add two variables to my project that takes care of these errors:

 local leftAlign = 3;  
 local topAlign = -2;  
  
 myText = display.newText("This is my text", ReferencingObject.x + leftAlign, ReferencingObject.y + topAlign);  
  

With this way, I am sure that text is aligned perfect no matter if it looks like crap in the simulator.

Joakim [import]uid: 81188 topic_id: 24605 reply_id: 130345[/import]

FYI … got a note that this has been fixed… [import]uid: 32462 topic_id: 24605 reply_id: 138164[/import]

FYI … got a note that this has been fixed… [import]uid: 32462 topic_id: 24605 reply_id: 138164[/import]

Was this ever fixed? I am still having this problem with the current daily build. I’m using a custom font and it appears slightly higher on the device than it does in the simulator. I’ve put this off throughout the development of my game (years) but want to address it now because i’m due to publish. Can anyone help?

The font file has some empty space above and below the visible portion of the font to account for superscript and such. The different platforms handles the font differently so that is what you are seeing.

You can handle this manually by putting a bit of an offset on the Y position. You can also try this module I made to get the perfect placement: http://code.coronalabs.com/code/perfect-vertical-text-alignment-across-devices 

Hi jonjonsson. Thanks for suggesting your module, I’ll look into it, though I’ll probably have to change it because I’m still on graphics 1.

I had a thought that this problem might just be in graphics v1 compatibility mode. I haven’t tried migrating to graphics 2.0 because I don’t have time right now, do you know if it makes any difference?

 

Hi Julius. There is no difference between graphics 1 and 2 in regards to this problem. 

The module was originally made for graphics 1 so you can see the changes in the repository. I never tried it in compatibility mode though.

I would say it depends on how much text you have and how nit-picky you are if its a good time investment to use that module though.