Difference between stage.width and stage.stageWidth

前端 未结 2 926
孤独总比滥情好
孤独总比滥情好 2021-02-19 07:32

In actionscript 3 (as3) What is the difference between calling stage.width and stage.stageWidth

This was something I remember I got confused about in the past (Adobe\'s

2条回答
  •  天命终不由人
    2021-02-19 08:08

    I found this article http://ajarproductions.com/blog/2009/03/18/flash-stage-width-vs-stagewidth-in-actionscript-3/ which says:

    "stage.width will return the width of the content on the stage and ignore any empty pixels around the edges. So if you only have a 100 px wide rectangle on stage, your stage.width will be 100.

    stage.stageWidth will give you the size of the stage, more like Stage.width in Actionscript 2. Use stage.stageWidth if you’re trying to position elements relative to the stage.

    Same goes for stage.height and stage.stageHeight."

提交回复
热议问题