Keep CanvasItem object' size unchanged while changing Camera2D.zoom

Godot Version

4.2.2

Question

I have a Node2D object called Point to draw a circle with constant size. There is a Camera2D object to control the zoom of game screen. Now I want the Point to keep its size unchanged while changing Camera2D.zoom but I have no idea to achieve it.

You can make the point as a child of canvas layer

hierarchy
The Point’s size is still following the Camera2D.zoom. :cry:

Change the node 2d (point) to control or any other based on your work like texture rect

image
Point’s size is still following the zoom. :upside_down_face:

Last try?
Wait now I will tell you the correct

I think of a possible approach. Maybe we can draw the point on the camera’s “lens”, but I don’t know how to realize. :smiling_face_with_tear:

Can you explain me the problem?

I want to realize an effect like the anchor in the editor.
image
No matter how we zoom the screen, it remains its size.

I have tested it, if you add a texture rect as the point with its texture as a child of canvas layer then it will works. But if will want something other then please tell me the codes of the point

These are codes of the Point.

and could you let me see your hierarchy? :smiley_cat:

So you want only the point will not affect with camera zoom or the circle? You can use texture rect if you want to create point texture

So I only need to change the Point’s type to TextureRect? Should I do something else?

Yeah right!

This is my hierarchy.
image

This is the inspector of the Point.

when i run the scene, the Point’s size is still affected by the zoom of Camera2D. :upside_down_face:

Please send me a short video on it, I have tested it but its working

1 Like

Ohh, I said you that to use a texture instead of drawing a cursor with codes, remove the point codes and use a cursor texture, tips: use a white coloured cursor texture so that you can customize the color with changing the modulate