根据官方教程:
https://docs.godotengine.org/zh-cn/4.x/tutorials/inputs/custom_mouse_cursor.html#cursor-list
extends Node
# Load the custom images for the mouse cursor.
var arrow = load("res://arrow.png")
var beam = load("res://beam.png")
func _ready():
# Changes only the arrow shape of the cursor.
# This is similar to changing it in the project settings.
Input.set_custom_mouse_cursor(arrow)
# Changes a specific shape of the cursor (here, the I-beam shape).
Input.set_custom_mouse_cursor(beam, Input.CURSOR_IBEAM)
其中定义
var beam = load("res://beam.png")
这个我以为是点击后鼠标变成该图片,真不知道是怎么想的,演示不出效果,鼠标点击根本就没有显示beam.png这个图片
所以请问有没有实际,简单点的方法,实现标题功能?
就是光标是一个图片,点击鼠标,光标变成另外一张图片,实现动态光标本身的点击动态效果?
请尽量演示下可行组件、代码谢谢!
https://docs.godotengine.org/zh-cn/4.x/tutorials/inputs/custom_mouse_cursor.html#cursor-list
extends Node
# Load the custom images for the mouse cursor.
var arrow = load("res://arrow.png")
var beam = load("res://beam.png")
func _ready():
# Changes only the arrow shape of the cursor.
# This is similar to changing it in the project settings.
Input.set_custom_mouse_cursor(arrow)
# Changes a specific shape of the cursor (here, the I-beam shape).
Input.set_custom_mouse_cursor(beam, Input.CURSOR_IBEAM)
其中定义
var beam = load("res://beam.png")
这个我以为是点击后鼠标变成该图片,真不知道是怎么想的,演示不出效果,鼠标点击根本就没有显示beam.png这个图片
所以请问有没有实际,简单点的方法,实现标题功能?
就是光标是一个图片,点击鼠标,光标变成另外一张图片,实现动态光标本身的点击动态效果?
请尽量演示下可行组件、代码谢谢!