顯示物件座標系 (DisplayObject Coordinate System)

顯示物件座標系的座標方向與螢幕座標系相同,x, y 座標往右下方遞增,左上方遞減,然而原點與螢幕座標系不同,顯示物件座標系預設的原點在畫面正中央。

以下程式碼示範如何將物件置於畫面中心:

blueRect.x = display.contentWidth/2
blueRect.y = display.contentHeight/2

results matching ""

    No results matching ""