Issue with previewing on different device settings

Hi all,
I'm trying to get an actor to react to the size of the screen (basically, react to which device is running my game). I've tried setting up rules like:

if game.Display Size.Height = 568
behavior that resizes the actor for iPhone5

if game.Display Size.Height = 480
behavior that resizes the actor for Legacy iPhone

etc.

But when I Preview the game and select different devices, it does nothing. The actor spawns with correct sizing for only the device that I set my project up for. Am I misunderstanding the power of Preview? Or am I doing something wrong?

Any and all help is greatly appreciated!

Comments

  • AdrenalineAdrenaline Member Posts: 523
    I've noticed that when I go to the Project Info tab and change the platform there, I see the results I'm hoping for when I Preview the app.

    Does this mean that this same app will perform how I want it to on all platforms, or only the platform that is selected on the Project Info tab?

    Thanks!
  • jtantonjtanton Member, PRO Posts: 2
    Hi Adrenaline,
    Did you get an answer to your question? I was running into the same problem. I wanted to layout my actors based on the device's width. I created a test project (iPad Landscape) which just gets the :

    Game>Display>Size = game.Display Size.Width
    Current Scene>Size>Width = scene.Size.Width
    Devices>Screen>Size>Width = game. Screen Size.Width

    As it turns out:
    game.Display.Size.Width - will give you the width of the project (ex. Game Platform Size for iPad Landscape = 1024 pt.)
    scene.Size.Width - will give you the "canvas" on which you were working on the scene (Each scene's size can be changed irrespective of the Game Platform Size ex. 1200 pt.)
    game.Screen Size.Width - gives you the actual width in which your project is currently being displayed (ex. Zoom factor 50% x Platform Size of 1024 = 512 pt.)

    I made an image so it was easier to see what I was talking about.
    http://www.flickr.com/photos/jtanton/8428370160/lightbox/

    I also tried it on different devices and it would always just read the project size and not the size of the device.

    I guess the answer would be that the actor's correct sizing will only be based for the device that I set my project up for...

    If anybody thinks otherwise or if I am mistaken, I would love to hear from you. Thanks!
  • AdrenalineAdrenaline Member Posts: 523
    Hey @jtanton
    No, I never got an answer about this. I've ended up having to constantly test to get the right results. And to get the right results, I've had to skew things depending on which device I'm preparing for. (This has been a HUGE headache for me).
    For example, my project is initially set for legacy iphone. If I want to scale up an actor for iPad, the constant seems to be that I multiply the width of an actor by 2, and multiply the height by 1.8 to get proper results when testing. (Just maintain this relationship if you want to scale it more or less...it's just 2:1.8)
    To go from legacy iPhone to iPhone 5, width x 2 and height x 1.7. (2:1.7)

    As far as placement goes, here's what I've learned:
    My project is originally a legacy project, and the scene fits the screen. I have an actor that checks the size of the screen, and that determines if clicking a particular button goes to one scene or another (ex: Scene 1 legacy, or Scene 1 iPad). Those scenes are sized to fit the correct device. HOWEVER, if I test on that device (an iPad in this example), a good chunk of the top and bottom of the screen (landscape) gets cut off. To fill the space completely, I need to build as if about 10% of the screen doesn't exist at the top or bottom of the scene. If I do this and then test, it moves those actors to the top/bottom of the screen and it looks perfect.

    Don't ask me why this is, and don't even try to imagine how I came to this solution...but there you go.
Sign In or Register to comment.