iPhone different screen sizes in flash? (Getting Black Bars)

后端 未结 2 1965
[愿得一人]
[愿得一人] 2020-12-02 01:36

I\'m new to the whole world of coding, and actionscript 3 is my first real experience, so sorry if I don\'t understand your answer straight away.

I\'ve built an iPho

2条回答
  •  长情又很酷
    2020-12-02 01:44

    You the coder are in charge of providing different solutions for different screen sizes. You check the device size and then you present the content accordingly. All in all it is not that different from showing different content based on rotation. If you hope for a magical solution that would do all that for you in AIR you are out of luck cos there's none.

    Messing with the stage scalemodes is not recommended (you should always use no scale on mobile) as you then give up completely the ability to compare the position of your displayobject according the the real physical device size (basically you won't know for sure if whatever you display is in the screen or completely out of it).

    If you thought developing for mobile was easy (not just using AIR but using any technology) then sorry, it's not especially cos you have to handle all those sizes.

    The basic principle on how to deal with it:

    1. get the real device size.
    2. calculate the real density/ratio.
    3. Compare that size to the size of your app. (again scale mode to no scale)
    4. Extract a general ratio (size of your app compared to size of device)
    5. Use that ratio to either, scale and place your main container (a container that contain your entire app), hard: scale and place all your DisplayObject in your app.
    6. Since the app ratio is maintained fill the blank space with whatever.
    7. Your app is filling correctly the entire screen on any device.

提交回复
热议问题