Simulator Width and Height

In placing some objects I can’t seem to find the actual size of the screen. I’ve used the content width and height in the config.lua file, but when i go to place a 10px image in the center of the screen (contentWidth/2 and contentHeight/2) it ends up more to the right and lower than center… [import]uid: 8485 topic_id: 1859 reply_id: 301859[/import]

Did you do anything with the setReferencePoint() command? If you set it to display.TopLeftReferencePoint it will place the top left corner in the center. Just the kind of thing I would forget about :slight_smile: [import]uid: 6397 topic_id: 1859 reply_id: 5493[/import]

There are new display properties (I think they’re new) called:

display.viewableContentWidth  
display.viewableContentHeight   

they represent the actual screen dimension, so you can use them as reference points to position display ojects. They even seem to take into consideration the content scale parameter in the config.lua file.

You also may want to play around with the scale parameter in config.lua to get your desired results:

-- config.lua  
  
application =  
{  
 content =  
 {  
 -- seems to work best on all iPhones  
 width = 320,  
 height = 480,  
 scale = "zoomEven"  
 },  
}  

Dave [import]uid: 8194 topic_id: 1859 reply_id: 5525[/import]

Thanks,

I’ve tried a combination of a few things and all seems well. Really like the language - pretty easy to learn. Have a game that I had started creating in Game Salad that I’m now converting over and things are going well so far. Hopefully its ready for release in a few weeks.

Bob [import]uid: 8485 topic_id: 1859 reply_id: 5552[/import]

Seem like a lot of ex-GameSalad developers end up here, although the forums here aren’t as busy as the GS forums. Fortunately the Ansca staff is really good at answering questions in here and keeping the community up-to-date with the product - much better that the Gendai staff.

I made my first game in GS and I’m fairly certain that will be my last one. I really like where Corona is heading and I prefer their “all features for one price” model. I hope it stays that way.

Dave [import]uid: 8194 topic_id: 1859 reply_id: 5555[/import]

I agree - the lack of features in Game Salad made me come over - I want to have the ability to use Open Feint or iAds and think this is the most viable option. Even if the Game Edition ends up at $349 for the year, I would gladly pay that, considering I was able to make that with my first couple apps made with Game Salad. [import]uid: 8485 topic_id: 1859 reply_id: 5556[/import]

One thing to be aware of is the reference point changes for most objects after the object is created. For all objects (except newCircle) the x,y point is display.TopLeftReferencePoint. After the object is created, x,y point is display.CenterReferencePoint. If I need to center an object on the screen I create the object setting x and y to 0 and then use obj.x = display.contentWidth/2 and obj.y = displayContentHeight/2 afterward.

-Tom [import]uid: 7559 topic_id: 1859 reply_id: 5729[/import]

Is this still true about the referencePoint changing upon creation?? We need this clearly spelled out in the docs, as well as a list of which objects are affected?? What about native Input fields or Text boxes? Is Circle the ONLY thing that does not follow this convention? [import]uid: 6175 topic_id: 1859 reply_id: 7234[/import]

All objects have a center reference point after they are created. All objects except the circle are created with a left/top reference point. We will make this clearer in the docs.

Thanks,
-Tom [import]uid: 7559 topic_id: 1859 reply_id: 7235[/import]

We too just started working with Corona. After having 4 games now sitting on the shelf at 70% complete with GameSalad due to lack of game engine performance…we were forced to dig in and start coding. We have been watching Corona for several months and tickling with the tutorials and are now diving in full bore working on our first app. It has been quite easy at the top level…but we are still befuddled with many of the more complex concepts…as our background is mostly in web code (PHP/AS2) and mostly procedural. Obj-Oriented programming is a new thing for us…so we are a little slow out of the gate…but things look promising.

We have 3 apps out with X-Code (in conjunction with some C-Programmers helping us)…but that dev cycle takes months compared to Corona. I really hope this software turns out to be all that it appears to be.

I think once Corona gets a GUI…GameSalad will be DOA…unfortunately…as that software seems to have great potential…but the staff is unresponsive and the dev progress is extremely slow. Its also buggy as all get out and the memory leaks are intolerable. [import]uid: 9492 topic_id: 1859 reply_id: 7236[/import]