spaceship/resources/GasResourceGlyph.gd

19 lines
716 B
GDScript3
Raw Permalink Normal View History

2026-08-14 20:32:58 +02:00
extends Control
@export var colour: Color = Color(0.85, 0.52, 1.0)
func _draw() -> void:
var centre: Vector2 = size * 0.5
var radius: float = minf(size.x, size.y) * 0.34
var bubbles: Array = [
[centre + Vector2(-radius * 0.38, radius * 0.12), radius * 0.46],
[centre + Vector2(radius * 0.34, radius * 0.26), radius * 0.58],
[centre + Vector2(radius * 0.38, -radius * 0.48), radius * 0.32],
]
for bubble in bubbles:
var ring := PackedVector2Array()
for i in range(12):
var angle: float = TAU * float(i) / 12.0
ring.append(bubble[0] + Vector2(cos(angle), sin(angle)) * float(bubble[1]))
NeonDraw.draw_glowing_polygon(self, ring, colour, 1.0, colour.darkened(0.78), maxf(0.5, radius * 0.035))