You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
378 B
GDScript

extends Control
class_name WeaponItemSub
var icon: TextureRect
var slot: TextureRect
func init(value: Texture2D):
icon = $WeaponIcon
slot = $WeaponSlot
icon.texture = value
func update_alpha(alpha_from: float, alpha_to: float, rate: float):
var alpha = lerp(alpha_from, alpha_to, rate)
icon.modulate = Color(1, 1, 1, alpha)
slot.modulate = Color(1, 1, 1, alpha)