2024-09-01 18:13:19
huas
0
实际上2d游戏使用getUIPosition即可,无需屏幕转游戏坐标let node: Node = event.target
let { x, y } = event.getLocation()
let re = this.camera.screenToWorld(new Vec3(x, y, 0), node.getWorldPosition())...
2024-09-01 16:29:00
huas
0
Touch(屏幕坐标非游戏坐标)getLocation x轴为相对设计尺寸左下角距离getLocationInView x轴为相对视窗左侧距离,y轴为相对视窗中心距离getUILocation 游戏中相对左下角xy距离的坐标(若屏幕无缩放则与getLocation)无差异Node:getLocation为相对锚点坐标getWorldPosition为锚...
2024-08-31 15:25:44
huas
0
如下图,右图我框选了底部的一部分,那么我增加高度,则框选的一部分会不断被拉伸,其他部分不变,宽度同理
2024-08-30 14:44:50
huas
0
安装最上面的几个库就行,大部分python应该都有import os
import json
from PIL import Image
import sys
# 确保Python使用UTF-8编码
sys.stdout.reconfigure(encoding='utf-8')
def parse_atlas(atlas_path):
#...
2024-08-24 16:04:02
huas
0
作为函数直接调用 this 指向为 window,作为对象/类中函数调用 this 指向为 对象/类箭头函数 () => {} 传入调用则 this 指向为传入时的类/对象参考如下代码,可以简单理解 function a() {
console.log(this);
}
a() // window
c...