跳到主要内容

屏幕位置

使用(X, Y)的形式描述画面上的一个位置。描述时,以屏幕左上角为(0, 0),X轴向右为正,Y轴向下为正。

创建

  • 参数
    • x (integer) - X坐标
    • y (integer) - Y坐标
  • 返回
    • position (position) - 位置
local position = base.position(x, y)

get_xy

获取坐标

  • 返回
    • x (integer) - X坐标
    • y (integer) - Y坐标
local x, y = position:get_xy()