26 lines
1.1 KiB
GDScript3
26 lines
1.1 KiB
GDScript3
|
|
extends Control
|
||
|
|
|
||
|
|
@export var colour: Color = Color(0.85, 0.95, 0.15)
|
||
|
|
|
||
|
|
|
||
|
|
func _draw() -> void:
|
||
|
|
var centre: Vector2 = size * 0.5
|
||
|
|
var radius: float = minf(size.x, size.y) * 0.34
|
||
|
|
# A cell outline (battery/reactor cell, same hexagon family as the ore
|
||
|
|
# glyph's own outline) with a bolt struck through it, so energy reads as
|
||
|
|
# "stored power" rather than being confused with ore's plain hexagon.
|
||
|
|
var cell := PackedVector2Array()
|
||
|
|
for i in range(6):
|
||
|
|
var angle: float = TAU * float(i) / 6.0 - PI * 0.5
|
||
|
|
cell.append(centre + Vector2(cos(angle), sin(angle)) * radius)
|
||
|
|
NeonDraw.draw_glowing_polygon(self, cell, colour, 1.0, colour.darkened(0.78), maxf(0.5, radius * 0.035))
|
||
|
|
|
||
|
|
var bolt := PackedVector2Array([
|
||
|
|
centre + Vector2(radius * 0.18, -radius * 0.75),
|
||
|
|
centre + Vector2(-radius * 0.32, radius * 0.05),
|
||
|
|
centre + Vector2(radius * 0.05, radius * 0.05),
|
||
|
|
centre + Vector2(-radius * 0.18, radius * 0.75),
|
||
|
|
centre + Vector2(radius * 0.32, -radius * 0.05),
|
||
|
|
centre + Vector2(radius * 0.0, -radius * 0.05),
|
||
|
|
])
|
||
|
|
NeonDraw.draw_glowing_polygon(self, bolt, colour.lightened(0.35), 1.0, colour.darkened(0.6), maxf(0.4, radius * 0.03))
|