Godot Version
Above 4.2
Question
I’m pretty curious about which one is faster, the server api or draw. This example is basically what I’m thinking about:
# Draw API
func _process(delta: float) -> void:
queue_redraw()
func _draw() -> void:
for pos in pixels:
draw_rect(Rect2(pos, Vector2.ONE), Color.WHITE)
# Server API
func _process(delta: float) -> void:
var rid := get_canvas_item()
RenderingServer.canvas_item_clear(rid)
for pos in pixels:
RenderingServer.canvas_item_add_rect(rid, Rect2(positions[i], Vector2.ONE), Color.WHITE)