# {py:mod}`simvx.core.nodes_2d.shapes` ```{py:module} simvx.core.nodes_2d.shapes ``` ```{autodoc2-docstring} simvx.core.nodes_2d.shapes :allowtitles: ``` ## Module Contents ### Classes ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`Line2D ` - ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D :summary: ``` * - {py:obj}`Polygon2D ` - ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Polygon2D :summary: ``` ```` ### API `````{py:class} Line2D(position=None, rotation: float = 0.0, scale=None, **kwargs) :canonical: simvx.core.nodes_2d.shapes.Line2D Bases: {py:obj}`simvx.core.nodes_2d.node2d.Node2D` ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D ``` ```{rubric} Initialization ``` ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D.__init__ ``` ````{py:attribute} points :canonical: simvx.core.nodes_2d.shapes.Line2D.points :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D.points ``` ```` ````{py:attribute} width :canonical: simvx.core.nodes_2d.shapes.Line2D.width :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D.width ``` ```` ````{py:attribute} colour :canonical: simvx.core.nodes_2d.shapes.Line2D.colour :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D.colour ``` ```` ````{py:attribute} joint_mode :canonical: simvx.core.nodes_2d.shapes.Line2D.joint_mode :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D.joint_mode ``` ```` ````{py:attribute} begin_cap_mode :canonical: simvx.core.nodes_2d.shapes.Line2D.begin_cap_mode :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D.begin_cap_mode ``` ```` ````{py:attribute} end_cap_mode :canonical: simvx.core.nodes_2d.shapes.Line2D.end_cap_mode :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D.end_cap_mode ``` ```` ````{py:attribute} gradient :canonical: simvx.core.nodes_2d.shapes.Line2D.gradient :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D.gradient ``` ```` ````{py:method} draw(renderer) :canonical: simvx.core.nodes_2d.shapes.Line2D.draw ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Line2D.draw ``` ```` ````{py:attribute} z_index :canonical: simvx.core.nodes_2d.shapes.Line2D.z_index :value: > 'Property(...)' ```` ````{py:attribute} z_as_relative :canonical: simvx.core.nodes_2d.shapes.Line2D.z_as_relative :value: > 'Property(...)' ```` ````{py:attribute} render_layer :canonical: simvx.core.nodes_2d.shapes.Line2D.render_layer :value: > 'Property(...)' ```` ````{py:method} set_render_layer(index: int, enabled: bool = True) -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.set_render_layer ```` ````{py:method} is_on_render_layer(index: int) -> bool :canonical: simvx.core.nodes_2d.shapes.Line2D.is_on_render_layer ```` ````{py:property} absolute_z_index :canonical: simvx.core.nodes_2d.shapes.Line2D.absolute_z_index :type: int ```` ````{py:property} position :canonical: simvx.core.nodes_2d.shapes.Line2D.position :type: simvx.core.math.types.Vec2 ```` ````{py:property} rotation :canonical: simvx.core.nodes_2d.shapes.Line2D.rotation :type: float ```` ````{py:property} rotation_degrees :canonical: simvx.core.nodes_2d.shapes.Line2D.rotation_degrees :type: float ```` ````{py:property} scale :canonical: simvx.core.nodes_2d.shapes.Line2D.scale :type: simvx.core.math.types.Vec2 ```` ````{py:property} world_position :canonical: simvx.core.nodes_2d.shapes.Line2D.world_position :type: simvx.core.math.types.Vec2 ```` ````{py:property} world_rotation :canonical: simvx.core.nodes_2d.shapes.Line2D.world_rotation :type: float ```` ````{py:property} world_scale :canonical: simvx.core.nodes_2d.shapes.Line2D.world_scale :type: simvx.core.math.types.Vec2 ```` ````{py:property} forward :canonical: simvx.core.nodes_2d.shapes.Line2D.forward :type: simvx.core.math.types.Vec2 ```` ````{py:property} right :canonical: simvx.core.nodes_2d.shapes.Line2D.right :type: simvx.core.math.types.Vec2 ```` ````{py:method} translate(offset: tuple[float, float] | numpy.ndarray) :canonical: simvx.core.nodes_2d.shapes.Line2D.translate ```` ````{py:method} rotate(radians: float) :canonical: simvx.core.nodes_2d.shapes.Line2D.rotate ```` ````{py:method} rotate_deg(degrees: float) :canonical: simvx.core.nodes_2d.shapes.Line2D.rotate_deg ```` ````{py:method} look_at(target: tuple[float, float] | numpy.ndarray) :canonical: simvx.core.nodes_2d.shapes.Line2D.look_at ```` ````{py:method} transform_points(points: list[simvx.core.math.types.Vec2]) -> list[simvx.core.math.types.Vec2] :canonical: simvx.core.nodes_2d.shapes.Line2D.transform_points ```` ````{py:method} draw_polygon(renderer, points: list[simvx.core.math.types.Vec2], closed=True, colour=None) :canonical: simvx.core.nodes_2d.shapes.Line2D.draw_polygon ```` ````{py:method} wrap_screen(margin: float = 20) :canonical: simvx.core.nodes_2d.shapes.Line2D.wrap_screen ```` ````{py:attribute} strict_errors :canonical: simvx.core.nodes_2d.shapes.Line2D.strict_errors :type: typing.ClassVar[bool] :value: > True ```` ````{py:attribute} script_error_raised :canonical: simvx.core.nodes_2d.shapes.Line2D.script_error_raised :value: > 'Signal(...)' ```` ````{py:method} __init_subclass__(**kwargs) :canonical: simvx.core.nodes_2d.shapes.Line2D.__init_subclass__ :classmethod: ```` ````{py:property} name :canonical: simvx.core.nodes_2d.shapes.Line2D.name :type: str ```` ````{py:property} process_mode :canonical: simvx.core.nodes_2d.shapes.Line2D.process_mode :type: simvx.core.descriptors.ProcessMode ```` ````{py:method} reset_error() -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.reset_error ```` ````{py:method} add_child(node: simvx.core.node.Node) -> simvx.core.node.Node :canonical: simvx.core.nodes_2d.shapes.Line2D.add_child ```` ````{py:method} remove_child(node: simvx.core.node.Node) :canonical: simvx.core.nodes_2d.shapes.Line2D.remove_child ```` ````{py:method} reparent(new_parent: simvx.core.node.Node) :canonical: simvx.core.nodes_2d.shapes.Line2D.reparent ```` ````{py:method} get_node(path: str) -> simvx.core.node.Node :canonical: simvx.core.nodes_2d.shapes.Line2D.get_node ```` ````{py:method} find_child(name: str, recursive: bool = False) -> simvx.core.node.Node | None :canonical: simvx.core.nodes_2d.shapes.Line2D.find_child ```` ````{py:method} find(node_type: type, recursive: bool = True) -> simvx.core.node.Node | None :canonical: simvx.core.nodes_2d.shapes.Line2D.find ```` ````{py:method} find_all(node_type: type, recursive: bool = True) -> list :canonical: simvx.core.nodes_2d.shapes.Line2D.find_all ```` ````{py:property} path :canonical: simvx.core.nodes_2d.shapes.Line2D.path :type: str ```` ````{py:method} add_to_group(group: str) :canonical: simvx.core.nodes_2d.shapes.Line2D.add_to_group ```` ````{py:method} remove_from_group(group: str) :canonical: simvx.core.nodes_2d.shapes.Line2D.remove_from_group ```` ````{py:method} is_in_group(group: str) -> bool :canonical: simvx.core.nodes_2d.shapes.Line2D.is_in_group ```` ````{py:method} ready() -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.ready ```` ````{py:method} enter_tree() -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.enter_tree ```` ````{py:method} exit_tree() -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.exit_tree ```` ````{py:method} process(dt: float) -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.process ```` ````{py:method} physics_process(dt: float) -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.physics_process ```` ````{py:method} input_event(event: simvx.core.events.InputEvent) -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.input_event ```` ````{py:method} input(event: simvx.core.events.TreeInputEvent) -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.input ```` ````{py:method} unhandled_input(event: simvx.core.events.TreeInputEvent) -> None :canonical: simvx.core.nodes_2d.shapes.Line2D.unhandled_input ```` ````{py:method} start_coroutine(gen: simvx.core.descriptors.Coroutine) -> simvx.core.descriptors.CoroutineHandle :canonical: simvx.core.nodes_2d.shapes.Line2D.start_coroutine ```` ````{py:method} stop_coroutine(gen_or_handle) :canonical: simvx.core.nodes_2d.shapes.Line2D.stop_coroutine ```` ````{py:method} clear_children() :canonical: simvx.core.nodes_2d.shapes.Line2D.clear_children ```` ````{py:method} destroy() :canonical: simvx.core.nodes_2d.shapes.Line2D.destroy ```` ````{py:property} app :canonical: simvx.core.nodes_2d.shapes.Line2D.app ```` ````{py:property} tree :canonical: simvx.core.nodes_2d.shapes.Line2D.tree :type: simvx.core.scene_tree.SceneTree ```` ````{py:method} get_tree() -> simvx.core.scene_tree.SceneTree :canonical: simvx.core.nodes_2d.shapes.Line2D.get_tree ```` ````{py:method} __getitem__(key: str) :canonical: simvx.core.nodes_2d.shapes.Line2D.__getitem__ ```` ````{py:method} get_properties() -> dict[str, simvx.core.descriptors.Property] :canonical: simvx.core.nodes_2d.shapes.Line2D.get_properties :classmethod: ```` ````{py:method} __repr__() :canonical: simvx.core.nodes_2d.shapes.Line2D.__repr__ ```` ````` `````{py:class} Polygon2D(position=None, rotation: float = 0.0, scale=None, **kwargs) :canonical: simvx.core.nodes_2d.shapes.Polygon2D Bases: {py:obj}`simvx.core.nodes_2d.node2d.Node2D` ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Polygon2D ``` ```{rubric} Initialization ``` ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Polygon2D.__init__ ``` ````{py:attribute} polygon :canonical: simvx.core.nodes_2d.shapes.Polygon2D.polygon :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Polygon2D.polygon ``` ```` ````{py:attribute} colour :canonical: simvx.core.nodes_2d.shapes.Polygon2D.colour :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Polygon2D.colour ``` ```` ````{py:attribute} uv :canonical: simvx.core.nodes_2d.shapes.Polygon2D.uv :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Polygon2D.uv ``` ```` ````{py:attribute} texture :canonical: simvx.core.nodes_2d.shapes.Polygon2D.texture :value: > 'Property(...)' ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Polygon2D.texture ``` ```` ````{py:method} draw(renderer) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.draw ```{autodoc2-docstring} simvx.core.nodes_2d.shapes.Polygon2D.draw ``` ```` ````{py:attribute} z_index :canonical: simvx.core.nodes_2d.shapes.Polygon2D.z_index :value: > 'Property(...)' ```` ````{py:attribute} z_as_relative :canonical: simvx.core.nodes_2d.shapes.Polygon2D.z_as_relative :value: > 'Property(...)' ```` ````{py:attribute} render_layer :canonical: simvx.core.nodes_2d.shapes.Polygon2D.render_layer :value: > 'Property(...)' ```` ````{py:method} set_render_layer(index: int, enabled: bool = True) -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.set_render_layer ```` ````{py:method} is_on_render_layer(index: int) -> bool :canonical: simvx.core.nodes_2d.shapes.Polygon2D.is_on_render_layer ```` ````{py:property} absolute_z_index :canonical: simvx.core.nodes_2d.shapes.Polygon2D.absolute_z_index :type: int ```` ````{py:property} position :canonical: simvx.core.nodes_2d.shapes.Polygon2D.position :type: simvx.core.math.types.Vec2 ```` ````{py:property} rotation :canonical: simvx.core.nodes_2d.shapes.Polygon2D.rotation :type: float ```` ````{py:property} rotation_degrees :canonical: simvx.core.nodes_2d.shapes.Polygon2D.rotation_degrees :type: float ```` ````{py:property} scale :canonical: simvx.core.nodes_2d.shapes.Polygon2D.scale :type: simvx.core.math.types.Vec2 ```` ````{py:property} world_position :canonical: simvx.core.nodes_2d.shapes.Polygon2D.world_position :type: simvx.core.math.types.Vec2 ```` ````{py:property} world_rotation :canonical: simvx.core.nodes_2d.shapes.Polygon2D.world_rotation :type: float ```` ````{py:property} world_scale :canonical: simvx.core.nodes_2d.shapes.Polygon2D.world_scale :type: simvx.core.math.types.Vec2 ```` ````{py:property} forward :canonical: simvx.core.nodes_2d.shapes.Polygon2D.forward :type: simvx.core.math.types.Vec2 ```` ````{py:property} right :canonical: simvx.core.nodes_2d.shapes.Polygon2D.right :type: simvx.core.math.types.Vec2 ```` ````{py:method} translate(offset: tuple[float, float] | numpy.ndarray) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.translate ```` ````{py:method} rotate(radians: float) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.rotate ```` ````{py:method} rotate_deg(degrees: float) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.rotate_deg ```` ````{py:method} look_at(target: tuple[float, float] | numpy.ndarray) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.look_at ```` ````{py:method} transform_points(points: list[simvx.core.math.types.Vec2]) -> list[simvx.core.math.types.Vec2] :canonical: simvx.core.nodes_2d.shapes.Polygon2D.transform_points ```` ````{py:method} draw_polygon(renderer, points: list[simvx.core.math.types.Vec2], closed=True, colour=None) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.draw_polygon ```` ````{py:method} wrap_screen(margin: float = 20) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.wrap_screen ```` ````{py:attribute} strict_errors :canonical: simvx.core.nodes_2d.shapes.Polygon2D.strict_errors :type: typing.ClassVar[bool] :value: > True ```` ````{py:attribute} script_error_raised :canonical: simvx.core.nodes_2d.shapes.Polygon2D.script_error_raised :value: > 'Signal(...)' ```` ````{py:method} __init_subclass__(**kwargs) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.__init_subclass__ :classmethod: ```` ````{py:property} name :canonical: simvx.core.nodes_2d.shapes.Polygon2D.name :type: str ```` ````{py:property} process_mode :canonical: simvx.core.nodes_2d.shapes.Polygon2D.process_mode :type: simvx.core.descriptors.ProcessMode ```` ````{py:method} reset_error() -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.reset_error ```` ````{py:method} add_child(node: simvx.core.node.Node) -> simvx.core.node.Node :canonical: simvx.core.nodes_2d.shapes.Polygon2D.add_child ```` ````{py:method} remove_child(node: simvx.core.node.Node) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.remove_child ```` ````{py:method} reparent(new_parent: simvx.core.node.Node) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.reparent ```` ````{py:method} get_node(path: str) -> simvx.core.node.Node :canonical: simvx.core.nodes_2d.shapes.Polygon2D.get_node ```` ````{py:method} find_child(name: str, recursive: bool = False) -> simvx.core.node.Node | None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.find_child ```` ````{py:method} find(node_type: type, recursive: bool = True) -> simvx.core.node.Node | None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.find ```` ````{py:method} find_all(node_type: type, recursive: bool = True) -> list :canonical: simvx.core.nodes_2d.shapes.Polygon2D.find_all ```` ````{py:property} path :canonical: simvx.core.nodes_2d.shapes.Polygon2D.path :type: str ```` ````{py:method} add_to_group(group: str) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.add_to_group ```` ````{py:method} remove_from_group(group: str) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.remove_from_group ```` ````{py:method} is_in_group(group: str) -> bool :canonical: simvx.core.nodes_2d.shapes.Polygon2D.is_in_group ```` ````{py:method} ready() -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.ready ```` ````{py:method} enter_tree() -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.enter_tree ```` ````{py:method} exit_tree() -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.exit_tree ```` ````{py:method} process(dt: float) -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.process ```` ````{py:method} physics_process(dt: float) -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.physics_process ```` ````{py:method} input_event(event: simvx.core.events.InputEvent) -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.input_event ```` ````{py:method} input(event: simvx.core.events.TreeInputEvent) -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.input ```` ````{py:method} unhandled_input(event: simvx.core.events.TreeInputEvent) -> None :canonical: simvx.core.nodes_2d.shapes.Polygon2D.unhandled_input ```` ````{py:method} start_coroutine(gen: simvx.core.descriptors.Coroutine) -> simvx.core.descriptors.CoroutineHandle :canonical: simvx.core.nodes_2d.shapes.Polygon2D.start_coroutine ```` ````{py:method} stop_coroutine(gen_or_handle) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.stop_coroutine ```` ````{py:method} clear_children() :canonical: simvx.core.nodes_2d.shapes.Polygon2D.clear_children ```` ````{py:method} destroy() :canonical: simvx.core.nodes_2d.shapes.Polygon2D.destroy ```` ````{py:property} app :canonical: simvx.core.nodes_2d.shapes.Polygon2D.app ```` ````{py:property} tree :canonical: simvx.core.nodes_2d.shapes.Polygon2D.tree :type: simvx.core.scene_tree.SceneTree ```` ````{py:method} get_tree() -> simvx.core.scene_tree.SceneTree :canonical: simvx.core.nodes_2d.shapes.Polygon2D.get_tree ```` ````{py:method} __getitem__(key: str) :canonical: simvx.core.nodes_2d.shapes.Polygon2D.__getitem__ ```` ````{py:method} get_properties() -> dict[str, simvx.core.descriptors.Property] :canonical: simvx.core.nodes_2d.shapes.Polygon2D.get_properties :classmethod: ```` ````{py:method} __repr__() :canonical: simvx.core.nodes_2d.shapes.Polygon2D.__repr__ ```` `````