SDK doesn't behave like device and simulators seem to be whacked on my computer...

Hey all! As much as I hate to say it, I’ve found two bugs in Corona that have added a lot of extra work to my app.

1.) A little while ago I built my app for my iPod for the very first time! I was like sooo excited, but when I opened the app… nuthin’… Absolutamente nutto. It just gave me an error and showed a black screen. About two days later I realized that I had done (displayCenterReferencePoint), not (display.CenterReferencePoint). For some reason Corona “overlooked” the missing period, but my iPod wasn’t so unobservant. (Kinda big deal if you get used to forgetting the period…) Also Corona overlooked the fact that I had been calling display.newImage(“images/background”) when it should have been (“Images/background”). (yes, I should have been more careful, but it would be nice to know about it BEFORE I got to six THOUSAND lines of code)

2.) The whole time I have been making my game I was using the iPhone 4 simulator. I realized that the plane old iPhone simulator would make my X and Y coordinates go haywire, so I just forgot about it (figuring it was bugged )and used the iPhone 4 version, which worked fine. Once I finally fixed the previous bug (adding in my period and capitalizing my “I”) my images would appear on th screen. Only problem was… THE COORDINATES WERE THE EXACT SAME AS THE “BUGGED” IPHONE SIMULATOR!!! Turns out the iPhone simulator is the ONLY one that gives accurate X and Y coords! (at least on MY computer) So I had to go and painstakingly change ALL the positioning, scaling, and size of ALL my images! THEN it worked on my iPod (for some reason the demos worked on all platforms, just not MY app ).

Chances are, I’ve missed something MAJOR in my code. (although I can’t seem to find it) So don’t be afraid to say “Uh, dude, you like TOTALLY forgot to add a certain line of code to a certain line of a certain file!” LOL

Much appreciated,
J.K.
[import]uid: 66117 topic_id: 17333 reply_id: 317333[/import]

Hi J.K.

Let me start by addressing point 1.

When you are setting a reference point you can set it as a number of different things, not just display.whateverRefPoint.

For example you could set it as setReferencePoint(randomWordHere) - you’d just want that random word to actually mean something.

You might, if using it a lot, say;

[lua]centerPoint = display.CenterReferencePoint[/lua]

So that in the future you could use this;
[lua]obj:setReferencePoint(centerPoint)[/lua]

Ultimately a good way to make sure you’re doing things correctly is to check the simulator after changing the reference point. You’ll be able to tell whether or not the ref point was the center or the top left or what have you quite easily most of the time.

For the capital letters issue - this is something we’re aware of and would like to get set up to make it easy for users who are prone to capitalizing the wrong words, or not capitalizing when they should be, etc - but there also several posts, threads, docs, etc. detailing the important of make sure you do this yourself.

I agree it’s a feature we should have, though - yes :slight_smile:

For point 2 - my apps are all written for the iPhone and work fine on both the iPhone 3GS and 4.

What does your config.lua file look like? Are you positioning images imaging a screen of 640 x 960 or 320 x 480?

Peach :slight_smile: [import]uid: 52491 topic_id: 17333 reply_id: 65600[/import]

Hey, Peach.

Point 1- Great idea about centerPoint = display.CenterReferencePoint!!! I can’t believe I hadn’t thought of that!! Hopefully I won’t forget my period anymore. LOL

Point 2- Here is my config.lua file:

[lua]application =
{
content =
{
width = 480,
height = 854,
scale = “zoomEven”
}
}

P.S. is there a way to add an image to a post

Much appreciated,
J.K.
[import]uid: 66117 topic_id: 17333 reply_id: 65658[/import]

P.P.S. I can’t get the syntax highlighting to switch back to text… [import]uid: 66117 topic_id: 17333 reply_id: 65659[/import]

Haha, put < lua > no spaces at the start (which I can see you’ve done) then when done with the code part, do < / lua > and it will go back to plain text :wink:

Now, the problem seems to be that your config file has, uhm, random numbers?

Where did you get width = 480 from? And where did you get that height?

For iPhone it should be width = 320 and height = 480.

This is regardless of orientation - you put in the real width and height of the device.

Make sense?

Peach :slight_smile: [import]uid: 52491 topic_id: 17333 reply_id: 65734[/import]

I spent many good hours finding those " random " numbers!!!

J.K!!! (Just Kidding!!!) I think I did print (display.ContentWidth) and height… I’m not sure.I’ll try changing them

Much appreciated,
J.K. [import]uid: 66117 topic_id: 17333 reply_id: 65794[/import]

Okay… so I changed the numbers. But since I got everything to fit the old config.lua, everything is all off kilter… [import]uid: 66117 topic_id: 17333 reply_id: 65795[/import]

I would encourage you to make your app for 320 by 480, then go from there.

Your “random numbers” (lol) were messing you up because they didn’t actually mean anything, or not anything you wanted them to, anyway.

Sorry :frowning: I know it is a bit of a pain at first, it’s just part of the learning curve though.

Peach

PS - Would still love to know where 854 came from. I’ve not seen it used before. Until now :wink: [import]uid: 52491 topic_id: 17333 reply_id: 65876[/import]

I definitely see the sense in that, but, considering I’m practically done, if I publish as is, do you know if it would work on the iPhone, iPhone 3GS, iPhone 4, iPhone4S, iPod touch, and iPod touch 4th gen.? Because it works fine on my iPod touch 4th gen.(which is the only device I have it on)

Much appreciated,
J.K. [import]uid: 66117 topic_id: 17333 reply_id: 65948[/import]

When you say “as is” - are you still using those crazy random numbers? XD

What numbers are in there now? [import]uid: 52491 topic_id: 17333 reply_id: 66175[/import]

@peach

854 came from here:-
http://www.gsmarena.com/sony_ericsson_xperia_x10-2964.php

@joe kool

its a rally rare resolution we should have to neglect this especially when you are trying for the ios
:slight_smile: [import]uid: 12482 topic_id: 17333 reply_id: 66186[/import]

What do ya know? 854! I’m pleased to know where it came from. Is that a phone you’re currently using? Looks quite cool :slight_smile:

[import]uid: 52491 topic_id: 17333 reply_id: 66219[/import]

no i am not using that mobile but one of my friend has that mobile and yup that’s very cool [import]uid: 12482 topic_id: 17333 reply_id: 66380[/import]