跳转至

GetTargetPosition 获取焦点坐标

格式

GetTargetPosition()

简介

返回焦点方块的坐标。

返回值

名称 类型 描述
pos Vec3 坐标位置

实例

按下鼠标左键时打印焦点方块的坐标位置。

import fg,wx

asset = fg.AssetCreate()
asset.name = 'Main Scene'
asset.state = fg.STATE.VOXMODEL
asset.vmFile = 'mainScene'
asset.icon='icon.png'

fg.AssetRegister(asset)

def onMouseButton(self, stamp, button, action, mods):
    if action == wx.ACTION.PRESS and button == wx.MOUSE_BUTTON.LEFT:
        a = wx.GetTargetPosition()
        print(a)

fg.AssetSetMouseButtonCBFunc(asset, onMouseButton)