Godot Version
4.4.1
Question
I am using a Node2D to represent the backgound of my “level”. Inside i have placed a Camera2D to manage pan & zoom in the level.
On the level i place both Sprite2Ds (manually instantiated by script, since items are generate outside) that i manually place on the level with:
position = Vector2( item_x, item_y )
At the side of this, i also draw some lines and circles in the _draw methods of the sprite scenes, like:
(Sprite-derived scene, manually added above, this can be sprite_1 or sprite_2 below)
func _draw():
if camera_zoom.x < 0.04:
draw_circle( position, 5 / camera_zoom.x, Color.BLACK, true )
i also draw some lines within the level _draw method itself like:
(level scene, the background where the sprites have been added)
func _draw():
var from: Vector2 = sprite_1.position
var to: Vector2 = sprite_2.position
draw_line( from, to, Color.GREEN )
The green line is properly drawn between the two Sprites, while the two circles are drawn displaced radially from the center of the level, the further the sprite is, the more displaced the circle is…
Am i missing something here?