![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | daniel500013 |
How to get pixel color under cursor?
I saw similar question as mine but those answers are in the gdscript when I programming in c#
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | daniel500013 |
How to get pixel color under cursor?
I saw similar question as mine but those answers are in the gdscript when I programming in c#
![]() |
Reply From: | wombatstampede |
I don’t use the Mono version of Godot but I guess it would be just similar to GDScript. API differences to GDScript — Godot Engine (3.1) documentation in English
So something like: (inside a node)
GetViewport().GetTexture().GetData().GetPixel(x,y);
x,y should be retrievable from the mouse event.
If you intend to work with/change many pixels often then it might be advisable to use a screen shader. (Depends on your specific use case.)