seika.node

Node

Inherits: N/A.

Class used as an interface for scene node functionality. Base class for all scene node types.

Properties

name : str

Unique name of node once added to the scene.

entity_id : int

Unique id of entity.

tags : List[str]

List of tags that has been assigned to an entity.

visibility : bool

Visibility of a node. Also affects a node's children visibility.


Signals

None.


Methods

@classmethod
new() -> seika.node.Node:

Will create a new instance of either Node or any class that inherits it. Must be added to the scene tree from a node that exists within the scene with the add_child method.

queue_deletion() -> None:

Queues a node to be deleted and removed from a scene if it's currently added to the scene tree.

add_child(node: Node) -> None:

Adds a node as a child to the current node.

get_node(name: str) -> seika.node.Node:

Returns a node with the given name. Will be None if node is not found.

get_parent() -> seika.node.Node:

Returns the node's parent node. Will be None if node is root.

get_children() -> list:

Returns the node's children nodes. Won't return child's children.

create_signal(signal_id: str) -> None:

Creates a signal for subscribers to listen to.

connect_signal(signal_id: str, listener_node: seika.node.Node, function_name: str) -> None:

Connects source node's signal to listener node.

emit_signal(signal_id: str, args=[]) -> None:

Emits signal from source node.

show() -> None:

Makes a node visible.

hide() -> None:

Makes a node invisible.

_start() -> None:

Called when entity is loaded into scene tree with all dependencies and children.

_physics_process(delta_time: float) -> None:

Called every frame. delta_time is passed in to have a frame consistent with CPU speed.

_end() -> None:

Called before entity exits scene tree.


Timer

Inherits: Node

Class used as an interface for Timer functionality. Must be added to scene tree in order to be used.

Properties

wait_time: float

A timer's run time. For example, a wait_time of 3.5 is equivalent three and a half seconds.

time_left: float

How much time a timer has left to run. When time_left is zero, the timer is stopped.

loops: bool

If set to True the timer will start again after stopping.

is_stopped: bool

If True the timer is stopped.


Signals

timeout

Emitted when a timer's time_left reached zero.


Methods

start(wait_time: Optional[float] = None) -> None:

Will start a timer. Will update the wait_time property of a timer if the wait_time parameter is not None.

stop() -> None:

Will stop a timer. timeout signal will not be triggered.

pause() -> None:

Pauses a timer. Doesn't have an effect if paused already.

resume() -> None:

Resumes a paused timer.


Node2D

Inherits: Node

Class used as an interface for scene 2D functionality. Base class for all 2D scene node types.

Properties

position: seika.math.Vector2

Current position of entity.

rotation: float

Current rotation in degrees of entity.


Signals

None.


Methods

get_position() -> seika.math.Vector2:

Get node's current position.

set_position(value: seika.math.Vector2) -> None:

Set node's current position.

add_to_position(value: seika.math.Vector2) -> None:

Add to node's current position. For example, if this line of code is within the _process function, the output of this line of code node.add_to_position(Vector(5, 10)) within 3 frames will be [(5, 10), (10, 20), (15, 30)].


Sprite

Inherits: Node2D -> Node

Class used to render a sprite entity.

Properties

flip_h: bool

Determines whether the x axis is flipped.

flip_v: bool

Determines whether the y axis is flipped.

modulate: seika.color.Color

Node's color modulation.

texture: seika.assets.Texture

Node's texture.

draw_source: seika.math.Rect2

Node's draw source represented as a Rect2. Will draw the loaded texture that's within the bounds of the Rect2.


Signals

None.


Methods

None.


AnimatedSprite

Inherits: Node2D -> Node

Class used to render an animated sprite entity.

Properties

is_playing: bool

Returns True if an animation is currently playing.

modulate: seika.color.Color

Node's color modulation.

frame: int

Current frame of animation.

animation_frames: int

Amount of frames for current animation.

animation_speed: int

Speed of current animation in milliseconds per frame.

flip_h: bool

Detemines whether the x axis is flipped.

flip_v: bool

Detemines whether the y axis is flipped.


Signals

animation_finished

Emitted when an animations is finished.

frame_changed

Emitted when an animation frame changes.


Methods

play(animation_name: str, start_frame = 0) -> None:

Plays animation based on the name passed in.

set_animation(animation_name: str) -> None:

Sets the current animation based on the name passed in.

stop() -> None:

Stops the currently playing animation.


TextLabel

Inherits: Node2D -> Node

Class used to render font.

Properties

text: str

Text Label's text.

color: seika.color.Color

Color of the text.

font: seika.assets.Font

The font of the text.

word_wrap: bool

Determines if the textlabel has word wrapping enabled.

max_characters_per_line: int

How many characters per line a text label can display. Must have word_wrap set to True to take effect.

new_line_padding: int

Vertical padding for new lines. Must have word_wrap set to True to take effect.


Signals

None.


Methods

get_text() -> str:

Get node's label text.

set_text(value: str) -> None:

Set node's label text.


CollisionShape2D

Inherits: Node2D -> Node

Class used to define collision shapes defined as rectangles. May add other collision shapes in the future.

Properties

collider_rect: seika.math.Rect2

Collision shape's colliding rectangle.

color: seika.color.Color

A collider's color. Only shown when colliders_visible is enabled in project properties.

is_under_mouse: bool

Returns True if mouse cursor is on top of collider_rect.


Signals

None.


Methods

add_collision_exception(node: seika.node.Node) -> None:

Adds a node to an exception list to ignore collisions.

remove_collision_exception(node: seika.node.Node) -> None:

Removes a node from an exception list. Collisions between nodes are enabled.


Spatial

Inherits: Node

Base class for 3D entities.

Properties

position: seika.math.Vector3

Spatial's position represented as a Vector3.


Signals

None.


Methods

add_to_position(value: seika.math.Vector3) -> None:

Adds passed in value to the Spatial's position.


TextureCube

Inherits: Spatial -> Node

Class that represents 3D cubes with textures.

Properties

None.


Signals

None.


Methods

None.


DirectionalLight

Inherits: Spatial -> Node

Class representing a directional light.

Properties

direction: seika.math.Vector3

The direction that the light is pointing.


Signals

None.


Methods

None.


PointLight

Inherits: Spatial -> Node

Class representing a directional light.

Properties

cutoff: float

The cutoff for the light's inner cone.

outer_cutoff: float

The cutoff for the light's outer cone.


Signals

None.


Methods

None.


SpotLight

Inherits: Spatial -> Node

Class representing a spotlight.

Properties

direction: seika.math.Vector3

The direction that the light is pointing.


Signals

None.


Methods

None.