this also goes for RenderingServer as well by proxy
Hi! I’ve been going mad trying to find a way to make a way for canvas items to share a uniform alpha value like how the CanvasGroups does. but without the CanvasGroup Node so it can be used on multiple things like bullets without tanking the performance on
everything.
i was wanting to achieve a similar effect to the fading animation used in arras.io where muliple moving parts fade as one whole part
i’ve tried Rendering server & draw() to only realize there really just isn’t a way to make alpha not blend & overlap…
so I’ve finally came here for some final shreads of hope that maybe im wrong or where else to look.
Code & screenshots
RenderServer attempt
extends Node2D
var sprite_thingy : RID
@export var debug_tex : Texture2D
func _ready() -> void:
var rs = RenderingServer
sprite_thingy = rs.canvas_item_create()
rs.canvas_item_set_parent(sprite_thingy, get_canvas_item())
rs.canvas_item_add_circle(sprite_thingy, Vector2.ZERO, 200, Color.BLACK)
rs.canvas_item_add_texture_rect(sprite_thingy, Rect2(Vector2(100, 0), Vector2(200, 200)), debug_tex)
rs.canvas_item_set_self_modulate(sprite_thingy, Color(0, 0, 0, 0.5))
Draw() attempt
extends Node2D
var sprite_thingy : RID
@export var debug_tex : Texture2D
func _draw() -> void:
draw_circle(position, 200, Color.BLACK)
draw_texture_rect(debug_tex, Rect2(Vector2(100, 0), Vector2(200, 200)), false)

