Source code for simvx.core.nodes_2d.marker

"""Marker2D -- Lightweight position marker for editor use."""

from __future__ import annotations

from ..descriptors import Property
from ..math.types import Vec2
from .node2d import Node2D


[docs] class Marker2D(Node2D): """Position marker for spawn points, waypoints, and reference positions. Invisible at runtime. The editor renders a coloured cross gizmo via get_gizmo_lines(). """ gizmo_colour = Property((1.0, 0.4, 0.7, 0.8), hint="Editor gizmo colour") gizmo_size = Property(10.0, range=(1, 100), hint="Cross size in pixels")
[docs] def get_gizmo_lines(self) -> list[tuple[Vec2, Vec2]]: """Return line segments for an editor cross gizmo centred at global position.""" p = self.world_position s = float(self.gizmo_size) return [ (Vec2(p.x - s, p.y), Vec2(p.x + s, p.y)), (Vec2(p.x, p.y - s), Vec2(p.x, p.y + s)), ]