Resizing to iPad technique - same project file

Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
edited January 2012 in Working with GS (Mac)
Hey guys,

I just started converting Penguin Pounce to the iPad by using Tenrdrmer's technique he shared with us not to long ago.
It works great, however, I had thought that I would need to save my project file as Penguin Pounce HD for example. Then I would create the iPad version on that new project file separate from my iPhone one. This is just how I thought, I don't know if this is what you had thought.

I got to thinking, what if I need to change my iPhone version because it has a ton of bugs? (not saying it does) Then I would have to fix them in the iPad version wouldn't I?

I have configured a way to have it IN THE SAME PROJECT FILE. Just thought I would share. If you already know this, then don't bother reading.

I created a real attribute (global) called iPad/iPhone and set it to .9

Then I went into each actor and put a change attribute:

change attribute self.width to self.width*game.iPad/iPhone (which would be .9)
I also did this for the self.height since my game is landscape.

I did that for all my actors. I then created a new actor called iPad/iPhone
I dragged this into my scene, unlocked it, and put this:

Rule: if game.iPad/iPhone = .9,
change attribute: current scene.camera.size.width to 480
change attribute: current scene.camera.size.height to 320
change attribute: current scene.camera.origin.X to 477 (since my camera is off a little)

OTHERWISE
change attribute: current scene.camera.origin.X to 477 (this is used for me when I convert the project file back to iPhone)

----------------------------------------------------------------------------------

Now here is the cool part:
just go and change the file to iPad landscape and you should have a working iPad project!

How do you change it back to iPhone?
Just change it back to iPhone landscape, and go into your attributes and change iPad/iPhone to 1.

That should do it!
NOTE: You will have to have an unlocked actor in each scene that does this rule:

Rule: if game.iPad/iPhone = .9,
change attribute: current scene.camera.size.width to 480
change attribute: current scene.camera.size.height to 320
change attribute: current scene.camera.origin.X to 477 (since my camera is off a little)

OTHERWISE
change attribute: current scene.camera.origin.X to 477

..Then it should work.
I haven't come across any issues and I just thought I would share.
Hope this helps someone.

Braydon

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I actually just made some integer attributes in penguin glide so I could set which of 3 resolutions I wanted to use 1-3 for iPhone iPad and nook/Fire Then I made a second integer attribute and I use that to check which of the three android options i'm going to call for so I can just go a head and precode all my links and stuff for Nook, Amazon, android MArket. I believe this was talked about in that thread at some point.

    It prob would be a good something to have posted in that thread in the interest of organization. Also keep in mind for nook/fire you will need to adjust the width and height the opposite of what you do for iPad.

    Glad you liked that technique. It has save me hours on end. And it even works for expanding and iPhone app out to iPad size or prob many other sizes for Mac apps.

    Cheers
    Aaron
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Integers work, but I used a real attribute.
    Reading your post correctly, would you like me to post this in that thread?

    Yes, It's great and only took about hour for me to sort everything out and get a good bit done. Now that the coding's done, Ill just go into each scene and unlock that actor. :)

    Braydon
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You can post where ever you want man. I would merge it if I could but we don't have that ability anymore. :P
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    My mistake, I will repost this in that thread. Thank you.
Sign In or Register to comment.