Simulator runs differently on Mac and Windows?

Hello again,

Thanks for responding and I’m sorry for the trouble. I ended up fixing all the problems after re-coding a lot of my app. Oh and I tested it and it works fine on the 971 build, did not need the 985+ build, even though I tested it on that one first. Here are the things I had to do in case anyone else has this problem:

I found out that using the regular x and y is what positions it differently on the Mac os

offText = display.newText( "", 300, (50 + theY), native.systemFont, 12)  

The code above will make it look exactly the same on all devices and the windows simulator, but different on the mac simulator.
However if I write it this way:

offText = display.newText( "", 300, (50 + theY), native.systemFont, 12)  
offText.x = 300  
offText.y = 50 + theY  

It will look just the same on the mac as well.

I’m sorry if this is known and I should have known that I’m supposed to specifiy the x and y values seperately.
native.systemFont made it look different as well, but when I specified a specific font like Tom said it looked exactly the same. I have one last question though. For the font I really liked how the Helvetica, default iOS font, looks. My question is, do I have to load the Helvetica font in build.settings for the iOS or include the file for the android? I figure the iOS already has the font since it’s the default, so I shouldn’t need to load it in the build.settings. But what about android? Does the android already have the font on the device as well so I don’t need to load it? Sorry for the newbie question and thanks again for all your help. I wish you guys a great day. [import]uid: 77199 topic_id: 36089 reply_id: 143656[/import]

Thanks for answering Brent! Since you gave me the hint of Retina or normal screen I think I figured out a few other things. So if you look at the screenshots that is how the Macbook sees them. Pretty much everything in the simulator is off now that I look at it in some way. I have a Macbook air @ 13 inch. It’s a normal screen. Can you please go more into detail about what the problem with the mac is and what I need for it to work the same.

Since the simulator was so off on the mac I thought the iPod and iPhone were just as messed up since some things were off on there to. But after seeing how far off the simulator is I realized that, thankfully, the iPod and iPhone werent as off. In fact it seems there is only one thing off. I have a larger image as a background, 1440 x 1157. And it’s not fully loading which makes everything else seem off. By not fully loading I mean it’s loading at like 75% of it’s full resolution. Coding is nothing special:

riftPic = display.newImage( "simulator/sr.png" )  
riftPic.x = 720  
riftPic.y = 230  
simGroup:insert( riftPic )  

Should I specify newImageRect and make it load it’s full resolution see if that helps? I won’t be able to try that till tonight. Anyway sorry for all the confusion. So the pics are how my mac sees the app in the simulator. Text is really off mainly, it loads that same picture above at like 25% of it’s full size. So I guess the new question is, what do I have to do for the mac to see everything like normal? Thanks again in advance and sorry for the trouble

Edit: Sorry this was a stupid post, I went back and read the documentation. Anything over 1024x1024 gets resized automatically. [import]uid: 77199 topic_id: 36089 reply_id: 143477[/import]

Hi @hatethinkingofnames,

If you didn’t already read it, I suggest you check out Tom’s FAQ on Custom Fonts. It should help you figure every little detail out. You shouldn’t assume that any font is going to be “natively available” on any device, so if you want to use it, just add it yourself and you’ll be safe.

http://www.coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/

Brent [import]uid: 200026 topic_id: 36089 reply_id: 143759[/import]

@hatethinkingofnames: Are you using a config.lua file in your project? [import]uid: 84637 topic_id: 36089 reply_id: 143765[/import]

Hello again and thanks for the answers.

@Brent Thanks again for your help and for the link.

@Danny Yes I am using a config. Mostly a copy of Rob’s ultimate config file with some editing. [import]uid: 77199 topic_id: 36089 reply_id: 143767[/import]

Hello,
What type of things aren’t aligning, and by how much are they off? Can you post an example or two from your code, and describe how it varies on both platforms?

Also, which model MacBook are you using? Retina screen or normal?

Thanks,
Brent [import]uid: 200026 topic_id: 36089 reply_id: 143434[/import]

I was actually able to test it sooner

riftPic = display.newImageRect( "simulator/sr.png", 1440, 1157 )  
riftPic.x = 720  
riftPic.y = 230  
simGroup:insert( riftPic )  

Fixed the image, and since the image is full res everything is in the right place again. However the text is out of position and looks weird. The same text that would fit on the screen before does not fit in the mac simulator even if it fits fine on windows simulator and iPod + iPhone. Here’s some sample code:

offTextFourOne = display.newText( "", 690, (309 + theY), native.systemFont, 12)  
offTextFourOne.text = offNumFourOne.." / 2"  
talentsOnePage:insert(offTextFourOne)  

EDIT: I got the text to look fine on the mac simulator too, POSITION wise. It still doesnt fit on the screen, does nativeFont mean something else on mac and that’s why it turns out different? Although the text looks completely fine on the iPod and iPhone, just like the windows simulator. Only mac simulator is having problems.

offTextFourOne = display.newText( "", 0, 0, native.systemFont, 12)  
offTextFourOne.x = 690  
offTextFourOne.y = (309 + theY)  
offTextFourOne.text = offNumFourOne.." / 2"  
talentsOnePage:insert(offTextFourOne)  

Oh and still main question, what about the mac retina and normal screen? How come the text doesnt fit on the mac sim? Is it because of smaller resolution? Although that doesn’t really make sense, really looking forward to finding out what the problem is. Thanks again for your help [import]uid: 77199 topic_id: 36089 reply_id: 143490[/import]

What build are you using for your tests? Build 971 (last release) had issues with text placement between simulators and devices. That was fixed in daily build 985.

Fonts on different platforms will display differently because not all the fonts with the same names have the same display metrics on different platforms. If you load custom fonts, they should line up pretty close between platforms. Even custom fonts will be off by a few pixels across different platforms because of how the OS displays the fonts.

If you think there is a real issue, you should post code here for others to comment or file a bug report with a test project so we can reproduce your results. [import]uid: 7559 topic_id: 36089 reply_id: 143493[/import]

Hello again,

Thanks for responding and I’m sorry for the trouble. I ended up fixing all the problems after re-coding a lot of my app. Oh and I tested it and it works fine on the 971 build, did not need the 985+ build, even though I tested it on that one first. Here are the things I had to do in case anyone else has this problem:

I found out that using the regular x and y is what positions it differently on the Mac os

offText = display.newText( "", 300, (50 + theY), native.systemFont, 12)  

The code above will make it look exactly the same on all devices and the windows simulator, but different on the mac simulator.
However if I write it this way:

offText = display.newText( "", 300, (50 + theY), native.systemFont, 12)  
offText.x = 300  
offText.y = 50 + theY  

It will look just the same on the mac as well.

I’m sorry if this is known and I should have known that I’m supposed to specifiy the x and y values seperately.
native.systemFont made it look different as well, but when I specified a specific font like Tom said it looked exactly the same. I have one last question though. For the font I really liked how the Helvetica, default iOS font, looks. My question is, do I have to load the Helvetica font in build.settings for the iOS or include the file for the android? I figure the iOS already has the font since it’s the default, so I shouldn’t need to load it in the build.settings. But what about android? Does the android already have the font on the device as well so I don’t need to load it? Sorry for the newbie question and thanks again for all your help. I wish you guys a great day. [import]uid: 77199 topic_id: 36089 reply_id: 143656[/import]

Thanks for answering Brent! Since you gave me the hint of Retina or normal screen I think I figured out a few other things. So if you look at the screenshots that is how the Macbook sees them. Pretty much everything in the simulator is off now that I look at it in some way. I have a Macbook air @ 13 inch. It’s a normal screen. Can you please go more into detail about what the problem with the mac is and what I need for it to work the same.

Since the simulator was so off on the mac I thought the iPod and iPhone were just as messed up since some things were off on there to. But after seeing how far off the simulator is I realized that, thankfully, the iPod and iPhone werent as off. In fact it seems there is only one thing off. I have a larger image as a background, 1440 x 1157. And it’s not fully loading which makes everything else seem off. By not fully loading I mean it’s loading at like 75% of it’s full resolution. Coding is nothing special:

riftPic = display.newImage( "simulator/sr.png" )  
riftPic.x = 720  
riftPic.y = 230  
simGroup:insert( riftPic )  

Should I specify newImageRect and make it load it’s full resolution see if that helps? I won’t be able to try that till tonight. Anyway sorry for all the confusion. So the pics are how my mac sees the app in the simulator. Text is really off mainly, it loads that same picture above at like 25% of it’s full size. So I guess the new question is, what do I have to do for the mac to see everything like normal? Thanks again in advance and sorry for the trouble

Edit: Sorry this was a stupid post, I went back and read the documentation. Anything over 1024x1024 gets resized automatically. [import]uid: 77199 topic_id: 36089 reply_id: 143477[/import]

Hi @hatethinkingofnames,

If you didn’t already read it, I suggest you check out Tom’s FAQ on Custom Fonts. It should help you figure every little detail out. You shouldn’t assume that any font is going to be “natively available” on any device, so if you want to use it, just add it yourself and you’ll be safe.

http://www.coronalabs.com/blog/2013/01/16/faq-wednesday-custom-fonts/

Brent [import]uid: 200026 topic_id: 36089 reply_id: 143759[/import]

@hatethinkingofnames: Are you using a config.lua file in your project? [import]uid: 84637 topic_id: 36089 reply_id: 143765[/import]

Hello again and thanks for the answers.

@Brent Thanks again for your help and for the link.

@Danny Yes I am using a config. Mostly a copy of Rob’s ultimate config file with some editing. [import]uid: 77199 topic_id: 36089 reply_id: 143767[/import]