simvx.core.nodes_2d.trail

Trail2D – Ribbon trail that follows a moving node.

Module Contents

Classes

Trail2D

Ribbon trail that follows this node’s movement.

API

class simvx.core.nodes_2d.trail.Trail2D(**kwargs)[source]

Bases: simvx.core.nodes_2d.node2d.Node2D

Ribbon trail that follows this node’s movement.

Records positions over time and renders a fading ribbon. Attach as child of a moving node for sword swipes, missile trails, movement effects, etc.

The core node manages the point buffer and geometry computation. Actual rendering is handled by the graphics backend reading get_trail_geometry().

Initialization

length

‘Property(…)’

width

‘Property(…)’

width_curve

‘Property(…)’

colour

‘Property(…)’

colour_end

‘Property(…)’

lifetime

‘Property(…)’

emit

‘Property(…)’

gizmo_colour

‘Property(…)’

process(dt: float)[source]

Record position, age points, and cull expired ones.

clear()[source]

Remove all trail points immediately.

get_trail_points() list[dict][source]

Return trail point data for rendering.

Each dict has: position (Vec2), normalized_age (0=new, 1=expired), width (float), colour (tuple).

get_trail_geometry() list[dict][source]

Return vertices for a triangle strip suitable for rendering.

Each vertex dict has: position (Vec2), colour (tuple). For each trail point, two vertices are generated offset perpendicular to the trail direction by +/- half the interpolated width.

get_gizmo_lines() list[tuple[simvx.core.math.types.Vec2, simvx.core.math.types.Vec2]][source]

Return the trail centerline as connected line segments for editor gizmos.

z_index

‘Property(…)’

z_as_relative

‘Property(…)’

render_layer

‘Property(…)’

set_render_layer(index: int, enabled: bool = True) None
is_on_render_layer(index: int) bool
property absolute_z_index: int
property position: simvx.core.math.types.Vec2
property rotation: float
property rotation_degrees: float
property scale: simvx.core.math.types.Vec2
property world_position: simvx.core.math.types.Vec2
property world_rotation: float
property world_scale: simvx.core.math.types.Vec2
property forward: simvx.core.math.types.Vec2
property right: simvx.core.math.types.Vec2
translate(offset: tuple[float, float] | numpy.ndarray)
rotate(radians: float)
rotate_deg(degrees: float)
look_at(target: tuple[float, float] | numpy.ndarray)
transform_points(points: list[simvx.core.math.types.Vec2]) list[simvx.core.math.types.Vec2]
draw_polygon(renderer, points: list[simvx.core.math.types.Vec2], closed=True, colour=None)
wrap_screen(margin: float = 20)
strict_errors: ClassVar[bool]

True

script_error_raised

‘Signal(…)’

classmethod __init_subclass__(**kwargs)
property name: str
property process_mode: simvx.core.descriptors.ProcessMode
reset_error() None
add_child(node: simvx.core.node.Node) simvx.core.node.Node
remove_child(node: simvx.core.node.Node)
reparent(new_parent: simvx.core.node.Node)
get_node(path: str) simvx.core.node.Node
find_child(name: str, recursive: bool = False) simvx.core.node.Node | None
find(node_type: type, recursive: bool = True) simvx.core.node.Node | None
find_all(node_type: type, recursive: bool = True) list
property path: str
add_to_group(group: str)
remove_from_group(group: str)
is_in_group(group: str) bool
ready() None
enter_tree() None
exit_tree() None
physics_process(dt: float) None
draw(renderer) None
input_event(event: simvx.core.events.InputEvent) None
input(event: simvx.core.events.TreeInputEvent) None
unhandled_input(event: simvx.core.events.TreeInputEvent) None
start_coroutine(gen: simvx.core.descriptors.Coroutine) simvx.core.descriptors.CoroutineHandle
stop_coroutine(gen_or_handle)
clear_children()
destroy()
property app
property tree: simvx.core.scene_tree.SceneTree
get_tree() simvx.core.scene_tree.SceneTree
__getitem__(key: str)
classmethod get_properties() dict[str, simvx.core.descriptors.Property]
__repr__()