Godot Version
4.4.1.stable
Question
My Pixel Art project has a custom sprite for the mouse cursor. I created a Scene containing a Sprite2D -with the desired sprite- and its position is set to get_global_mouse_position()
on _process()
, this is because setting the custom mouse sprite via Project Settings resulted in a very small cursor sprite compared to the rest of the game’s assets, and it didn’t respect the project’s pixel density.
I want my custom mouse sprite Scene to render on top of some UI elements, and these elements are inside of a CanvasLayer:
I have tried adding a CanvasLayer as a parent of the Sprite2D of the custom mouse Scene, but then it stops moving and stays still at the top-left corner of the DEBUG window, or at the center of it if its CanvasLayer’s Follow Viewport is set to Enabled.
How can I achieve this?
(This is a crosspost between the Godot Forum and the Godot Subreddit. Godot Subreddit post link: https://www.reddit.com/r/godot/comments/1kaphu6/showing_moving_sprite2d_on_top_of_ui_elements/)
Edit: This is solved! I’m going to share an example project for anyone who might need it in the future: ExampleProject.rar - Google Drive