mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-13 07:07:12 +08:00
feat(相机): 添加鼠标位置对相机偏移的影响
实现鼠标位置影响相机偏移的功能,使相机能够根据鼠标在屏幕上的位置进行轻微偏移,提升游戏交互体验
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class_name MouseTool
|
||||
|
||||
static func getPositionByScreen(anchor: Vector2, by: Node):
|
||||
var viewport = by.get_viewport()
|
||||
return viewport.get_mouse_position() - viewport.get_visible_rect().size * anchor
|
||||
Reference in New Issue
Block a user