RenderComponent¶
RenderComponent ¶
color
property
writable
¶
color: Vector4
Tint/fill color (RGBA, 0-1) applied to the shape and any texture
enable
property
writable
¶
enable: bool
Whether this component is active. Disabling hides the object's rendered shape.
shape
property
writable
¶
shape: PolygonShape | RectangleShape | CircleShape
The shape used to render this object. Accepts a RectangleShape, CircleShape, or PolygonShape. Equivalent to calling set_shape().
z_index
property
writable
¶
z_index: int
Draw order relative to other render components. Higher values draw on top.
add_component ¶
add_component(component_class: Any) -> typing.Any
Attach a new component of the given type to this component's owning Object.
Example
render = self.add_component(RenderComponent)
add_object ¶
add_object(obj: Object, parent: Object = None) -> Object
Add a newly created Object to the scene, optionally parented to another Object
get_component ¶
get_component(component_class: Any) -> typing.Any
Look up a component on this Object
has_component ¶
has_component(component_class: Any) -> bool
Check whether this component's owning Object has a component of the given type
remove_component ¶
remove_component(component_class: Any) -> None
Remove a component of the given type from this component's owning Object
set_shape ¶
set_shape(shape: PolygonShape | RectangleShape | CircleShape) -> None
Accepts a RectangleShape, CircleShape, or PolygonShape
set_texture ¶
set_texture(virtual_path: str) -> None
Load a texture from a res:// path (e.g. 'res://textures/wood.png'), or pass '' to clear it