Skip to main content
Inspiring
March 29, 2022
解決済み

apk shows different to the emulator (position of a movieclip)

  • March 29, 2022
  • 返信数 1.
  • 607 ビュー

Good Morning!. I am making an app in animate for android. I put a movieclip with this code so that it appears at the bottom in the center (the mc pruebaPie has the position at the bottom right,you can see it on the screenshot screenshot 😞

 

pruebaPie.x = stage.stageWidth;
pruebaPie.y = stage.stageHeight;

 

in debugging it works perfectly, but in the apk file the movieclip doesn't come out!!!

 

I appreciate the help very much. Thanks!

    このトピックへの返信は締め切られました。
    解決に役立った回答 JoãoCésar17023019

    Hi.

     

    In mobile devices, the stage usually is scaled so you have to take this change into account.

     

    I usually store the scale when the app runs like this:

    var scale:Number = stage.stageHeight / 720; // 720 is the height of the stage set in the IDE

     

    And then if I need to get the full width I do like this:

    var fullWidth:Number = stage.stageWidth / scale;

     

    I have a sample here:

    https://github.com/joao-cesar/adobe/tree/master/animate%20cc/as3/responsive_app_game_structure

     

    I hope this helps.

     

    Regards,

    JC

    返信数 1

    JoãoCésar17023019
    Community Expert
    Community Expert
    March 30, 2022

    Hi.

     

    In mobile devices, the stage usually is scaled so you have to take this change into account.

     

    I usually store the scale when the app runs like this:

    var scale:Number = stage.stageHeight / 720; // 720 is the height of the stage set in the IDE

     

    And then if I need to get the full width I do like this:

    var fullWidth:Number = stage.stageWidth / scale;

     

    I have a sample here:

    https://github.com/joao-cesar/adobe/tree/master/animate%20cc/as3/responsive_app_game_structure

     

    I hope this helps.

     

    Regards,

    JC

    joaquin5EDD作成者
    Inspiring
    April 3, 2022

    Hello. Your contribution has been of great help to me, thank you very much! I have understood perfectly how to place objects in space. Fantastic!
    Thank you very much again

    JoãoCésar17023019
    Community Expert
    Community Expert
    April 4, 2022

    Awesome, Joaquin!

     

    You're welcome!