SpatialNavigationArrow constructor
SpatialNavigationArrow({})
Implementation
SpatialNavigationArrow({
super.name = 'spatial_back_arrow',
super.transform,
this.idleColor = const Color(0xFF38BDF8),
this.hoverColor = const Color(0xFF67E8F9),
this.pressColor = const Color(0xFFFFFFFF),
void Function(Node node)? onPress,
}) {
_addBar(
name: '${name}_shaft',
position: Vector3(0.04, -0.04, 0),
scale: Vector3(0.64, 0.10, 0.10),
rotationZ: -math.pi / 4,
);
_addBar(
name: '${name}_head_horizontal',
position: Vector3(-0.16, 0.24, 0),
scale: Vector3(0.30, 0.10, 0.10),
);
_addBar(
name: '${name}_head_vertical',
position: Vector3(-0.28, 0.12, 0),
scale: Vector3(0.10, 0.30, 0.10),
);
pointable = Pointable(
node: this,
onHoverEnter: (_) => _setColor(hoverColor),
onHoverExit: (_) => _setColor(idleColor),
onPress: (node, _) {
_setColor(pressColor);
onPress?.call(node);
},
onRelease: (_) => _setColor(hoverColor),
);
}