Skip to content

CameraComponent

CameraComponent

enable property writable

enable: bool

Whether this component is active

is_main property writable

is_main: bool

Whether this is the active/main camera. Setting this to True on one camera does not automatically unset another camera's is_main.

owner property

owner: Object

The Object that owns this component

range property writable

range: float

Visible extent (view size/zoom) of the camera

add_child

add_child(obj: Object) -> Object

Add obj as a child of this component's owning Object

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

get_owner

get_owner() -> Object

The Object that owns this component

get_range

get_range() -> float

Get range. See the range property.

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

remove_object

remove_object(obj: Object) -> None

Remove an object from the scene

set_enable

set_enable(enable: bool) -> None

Set enable. See the enable property.

set_is_main

set_is_main(is_main: bool) -> None

Set is_main. See the is_main property.

set_range

set_range(range: SupportsFloat | SupportsIndex) -> None

Set range. See the range property.