forked from datawhale/whale-town-front
合并主场景和个人小屋
This commit is contained in:
@@ -131,13 +131,14 @@ static func get_grid_rect(grid_pos: Vector2i) -> Rect2:
|
||||
var world_pos = grid_to_world(grid_pos)
|
||||
return Rect2(world_pos, Vector2(GRID_SIZE, GRID_SIZE))
|
||||
|
||||
# 打印网格信息(调试用)
|
||||
static func print_grid_info(world_pos: Vector2) -> void:
|
||||
# 获取网格信息(调试辅助)
|
||||
static func print_grid_info(world_pos: Vector2) -> Dictionary:
|
||||
var grid_pos = world_to_grid(world_pos)
|
||||
var snapped_pos = snap_to_grid(world_pos)
|
||||
var center_pos = grid_to_world_center(grid_pos)
|
||||
|
||||
print("世界坐标: ", world_pos)
|
||||
print("网格坐标: ", grid_pos)
|
||||
print("吸附位置: ", snapped_pos)
|
||||
print("网格中心: ", center_pos)
|
||||
return {
|
||||
"world_position": world_pos,
|
||||
"grid_position": grid_pos,
|
||||
"snapped_position": snapped_pos,
|
||||
"center_position": center_pos
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user