Skip to content

Python Scripting API

Welcome to the Foxvoid Engine Python API reference. All components and systems exposed here can be accessed directly in your Python scripts.

Animation2d

Bases: Component

Handles frame-by-frame animation by controlling a SpriteSheetRenderer. Performance is maximized as the timer logic runs natively in C++.

Source code in foxvoid/__init__.pyi
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
class Animation2d(Component):
    """
    Handles frame-by-frame animation by controlling a SpriteSheetRenderer.
    Performance is maximized as the timer logic runs natively in C++.
    """

    def __init__(self, frames: List[int], speed: float, loop: bool = True, flip_x: bool = False, flip_y: bool = False) -> None: 
        """
        Initializes the animation sequence.

        Args:
            frames: Sequence of frame indices to play (e.g., [0, 1, 2, 3]).
            speed: Time in seconds each frame is displayed.
            loop: If True, the animation repeats indefinitely.
        """
        ...

__init__(frames, speed, loop=True, flip_x=False, flip_y=False)

Initializes the animation sequence.

Parameters:

Name Type Description Default
frames List[int]

Sequence of frame indices to play (e.g., [0, 1, 2, 3]).

required
speed float

Time in seconds each frame is displayed.

required
loop bool

If True, the animation repeats indefinitely.

True
Source code in foxvoid/__init__.pyi
658
659
660
661
662
663
664
665
666
667
def __init__(self, frames: List[int], speed: float, loop: bool = True, flip_x: bool = False, flip_y: bool = False) -> None: 
    """
    Initializes the animation sequence.

    Args:
        frames: Sequence of frame indices to play (e.g., [0, 1, 2, 3]).
        speed: Time in seconds each frame is displayed.
        loop: If True, the animation repeats indefinitely.
    """
    ...

Animator2d

Bases: Component

Manages and plays 2D frame-based animations using an attached SpriteSheetRenderer.

Source code in foxvoid/__init__.pyi
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
class Animator2d(Component):
    """
    Manages and plays 2D frame-based animations using an attached SpriteSheetRenderer.
    """

    def __init__(self) -> None:
        """Initializes an empty Animator2d."""
        ...

    @property
    def playback_speed(self) -> float:
        """The global speed multiplier for the animator (1.0 is normal speed)."""
        ...

    @playback_speed.setter
    def playback_speed(self, value: float) -> None:
        ...

    def add_animation(self, name: str, frames: list[int], frame_duration: float, loop: bool, flip_x: bool = False, flip_y: bool = False, events: dict[int, List[str]] = {}) -> None:
        """
        Registers a new animation state.

        :param name: The identifier for the animation (e.g., "walk", "idle").
        :param frames: A list of frame indices in the sprite sheet.
        :param frame_duration: Time in seconds each frame is displayed.
        :param loop: If True, the animation restarts automatically.
        """
        ...

    def play(self, name: str) -> None:
        """
        Switches the current playback to the specified animation.
        Does nothing if the animation is already playing.
        """
        ...

    def pause(self) -> None:
        """Pauses the current animation. It can be resumed later."""
        ...

    def resume(self) -> None:
        """Resumes a paused animation from where it left off."""
        ...

    def stop(self) -> None:
        """Stops the animation and resets it to the first frame."""
        ...

    def is_playing(self) -> bool:
        """Returns True if an animation is currently playing and not paused/stopped."""
        ...

    def is_finished(self) -> bool:
        """
        Returns True if the current non-looping animation has reached its final frame,
        or if the animator is currently stopped.
        """
        ...

playback_speed property writable

The global speed multiplier for the animator (1.0 is normal speed).

__init__()

Initializes an empty Animator2d.

Source code in foxvoid/__init__.pyi
682
683
684
def __init__(self) -> None:
    """Initializes an empty Animator2d."""
    ...

add_animation(name, frames, frame_duration, loop, flip_x=False, flip_y=False, events={})

Registers a new animation state.

:param name: The identifier for the animation (e.g., "walk", "idle"). :param frames: A list of frame indices in the sprite sheet. :param frame_duration: Time in seconds each frame is displayed. :param loop: If True, the animation restarts automatically.

Source code in foxvoid/__init__.pyi
695
696
697
698
699
700
701
702
703
704
def add_animation(self, name: str, frames: list[int], frame_duration: float, loop: bool, flip_x: bool = False, flip_y: bool = False, events: dict[int, List[str]] = {}) -> None:
    """
    Registers a new animation state.

    :param name: The identifier for the animation (e.g., "walk", "idle").
    :param frames: A list of frame indices in the sprite sheet.
    :param frame_duration: Time in seconds each frame is displayed.
    :param loop: If True, the animation restarts automatically.
    """
    ...

is_finished()

Returns True if the current non-looping animation has reached its final frame, or if the animator is currently stopped.

Source code in foxvoid/__init__.pyi
729
730
731
732
733
734
def is_finished(self) -> bool:
    """
    Returns True if the current non-looping animation has reached its final frame,
    or if the animator is currently stopped.
    """
    ...

is_playing()

Returns True if an animation is currently playing and not paused/stopped.

Source code in foxvoid/__init__.pyi
725
726
727
def is_playing(self) -> bool:
    """Returns True if an animation is currently playing and not paused/stopped."""
    ...

pause()

Pauses the current animation. It can be resumed later.

Source code in foxvoid/__init__.pyi
713
714
715
def pause(self) -> None:
    """Pauses the current animation. It can be resumed later."""
    ...

play(name)

Switches the current playback to the specified animation. Does nothing if the animation is already playing.

Source code in foxvoid/__init__.pyi
706
707
708
709
710
711
def play(self, name: str) -> None:
    """
    Switches the current playback to the specified animation.
    Does nothing if the animation is already playing.
    """
    ...

resume()

Resumes a paused animation from where it left off.

Source code in foxvoid/__init__.pyi
717
718
719
def resume(self) -> None:
    """Resumes a paused animation from where it left off."""
    ...

stop()

Stops the animation and resets it to the first frame.

Source code in foxvoid/__init__.pyi
721
722
723
def stop(self) -> None:
    """Stops the animation and resets it to the first frame."""
    ...

Button

Bases: Component

Component that provides a clickable interaction area. If a ShapeRenderer is attached to the same GameObject, the Button will automatically update its color based on the current interaction state.

Source code in foxvoid/__init__.pyi
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
class Button(Component):
    """
    Component that provides a clickable interaction area.
    If a ShapeRenderer is attached to the same GameObject, the Button will 
    automatically update its color based on the current interaction state.
    """

    width: float
    """The width of the clickable hitbox."""

    height: float
    """The height of the clickable hitbox."""

    is_hud: bool
    """
    Determines how mouse coordinates are calculated.
    Ensure this matches the 'is_hud' property of your visual renderer (Text/Shape).
    """

    transition: ButtonTransition

    normal_color: Color
    """Color applied to an attached ShapeRenderer when inactive."""

    hover_color: Color
    """Color applied to an attached ShapeRenderer when the mouse hovers over it."""

    pressed_color: Color
    """Color applied to an attached ShapeRenderer when the mouse button is held down."""

    def __init__(self) -> None:
        """
        Initializes a Button with default dimensions and UI colors.
        """
        ...

    def is_clicked(self) -> bool:
        """
        Checks if the button was successfully clicked.

        Returns:
            bool: True only on the exact frame the user releases the left mouse button 
                  while still hovering the button bounds.
        """
        ...

    def get_state(self) -> ButtonState:
        """
        Retrieves the current visual state of the button.

        Returns:
            ButtonState: The interaction state (Normal, Hovered, or Pressed).
        """
        ...

height instance-attribute

The height of the clickable hitbox.

hover_color instance-attribute

Color applied to an attached ShapeRenderer when the mouse hovers over it.

is_hud instance-attribute

Determines how mouse coordinates are calculated. Ensure this matches the 'is_hud' property of your visual renderer (Text/Shape).

normal_color instance-attribute

Color applied to an attached ShapeRenderer when inactive.

pressed_color instance-attribute

Color applied to an attached ShapeRenderer when the mouse button is held down.

width instance-attribute

The width of the clickable hitbox.

__init__()

Initializes a Button with default dimensions and UI colors.

Source code in foxvoid/__init__.pyi
1188
1189
1190
1191
1192
def __init__(self) -> None:
    """
    Initializes a Button with default dimensions and UI colors.
    """
    ...

get_state()

Retrieves the current visual state of the button.

Returns:

Name Type Description
ButtonState ButtonState

The interaction state (Normal, Hovered, or Pressed).

Source code in foxvoid/__init__.pyi
1204
1205
1206
1207
1208
1209
1210
1211
def get_state(self) -> ButtonState:
    """
    Retrieves the current visual state of the button.

    Returns:
        ButtonState: The interaction state (Normal, Hovered, or Pressed).
    """
    ...

is_clicked()

Checks if the button was successfully clicked.

Returns:

Name Type Description
bool bool

True only on the exact frame the user releases the left mouse button while still hovering the button bounds.

Source code in foxvoid/__init__.pyi
1194
1195
1196
1197
1198
1199
1200
1201
1202
def is_clicked(self) -> bool:
    """
    Checks if the button was successfully clicked.

    Returns:
        bool: True only on the exact frame the user releases the left mouse button 
              while still hovering the button bounds.
    """
    ...

ButtonState

Represents the current interaction state of a Button component.

Source code in foxvoid/__init__.pyi
1145
1146
1147
1148
1149
class ButtonState:
    """Represents the current interaction state of a Button component."""
    Normal: 'ButtonState'
    Hovered: 'ButtonState'
    Pressed: 'ButtonState'

Camera2d

Bases: Component

Component that controls the viewport for rendering the game world. The camera automatically looks at the Transform2d of the GameObject it is attached to.

Source code in foxvoid/__init__.pyi
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
class Camera2d(Component):
    """
    Component that controls the viewport for rendering the game world.
    The camera automatically looks at the Transform2d of the GameObject it is attached to.
    """

    zoom: float
    """The zoom level of the camera. 1.0 is default, > 1.0 zooms in, < 1.0 zooms out."""

    offset: Vector2
    """
    Custom pixel offset applied ON TOP of the anchor point.
    Useful for shifting the camera view (e.g., aiming slightly higher or looking ahead).
    """

    anchor: Camera2dAnchor
    """The base screen alignment (default is CameraAnchor.Center)."""

    is_main: bool
    """
    If True, the Engine will use this camera to render the final Game View.
    Make sure only one active camera is marked as main at a time.
    """

    background_color: Color
    """
    The color used to clear the background before rendering the scene.
    Modify this to dynamically change the atmosphere or sky color of the level.
    """

    def __init__(self) -> None:
        """
        Initializes a Camera2d component with default values 
        (zoom=1.0, offset=(0,0), anchor=CameraAnchor.Center, is_main=True).
        """
        ...

    def shake(self, intensity: float, duration: float):
        """Triggers a screen shake (intensity, duration) """
        ...

anchor instance-attribute

The base screen alignment (default is CameraAnchor.Center).

background_color instance-attribute

The color used to clear the background before rendering the scene. Modify this to dynamically change the atmosphere or sky color of the level.

is_main instance-attribute

If True, the Engine will use this camera to render the final Game View. Make sure only one active camera is marked as main at a time.

offset instance-attribute

Custom pixel offset applied ON TOP of the anchor point. Useful for shifting the camera view (e.g., aiming slightly higher or looking ahead).

zoom instance-attribute

The zoom level of the camera. 1.0 is default, > 1.0 zooms in, < 1.0 zooms out.

__init__()

Initializes a Camera2d component with default values (zoom=1.0, offset=(0,0), anchor=CameraAnchor.Center, is_main=True).

Source code in foxvoid/__init__.pyi
851
852
853
854
855
856
def __init__(self) -> None:
    """
    Initializes a Camera2d component with default values 
    (zoom=1.0, offset=(0,0), anchor=CameraAnchor.Center, is_main=True).
    """
    ...

shake(intensity, duration)

Triggers a screen shake (intensity, duration)

Source code in foxvoid/__init__.pyi
858
859
860
def shake(self, intensity: float, duration: float):
    """Triggers a screen shake (intensity, duration) """
    ...

Camera2dAnchor

Bases: Enum

Defines the base screen position that the camera uses as its focal point.

Source code in foxvoid/__init__.pyi
809
810
811
812
813
814
815
816
817
818
class Camera2dAnchor(Enum):
    """
    Defines the base screen position that the camera uses as its focal point.
    """

    TopLeft = 0
    """Anchors the camera to the top-left corner of the screen (0, 0)."""

    Center = 1
    """Anchors the camera to the exact center of the screen."""

Center = 1 class-attribute instance-attribute

Anchors the camera to the exact center of the screen.

TopLeft = 0 class-attribute instance-attribute

Anchors the camera to the top-left corner of the screen (0, 0).

CapsuleCollider

Bases: Component

A capsule-shaped collider, consisting of a cylinder with hemispherical ends. This is the industry standard shape for 2D character controllers as it slides smoothly over small bumps and does not catch on tile edges.

Source code in foxvoid/__init__.pyi
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
class CapsuleCollider(Component):
    """
    A capsule-shaped collider, consisting of a cylinder with hemispherical ends.
    This is the industry standard shape for 2D character controllers as it slides
    smoothly over small bumps and does not catch on tile edges.
    """
    radius: float
    height: float
    offset: Vector2
    is_trigger: bool

    def __init__(self, radius: float = 25.0, height: float = 50.0) -> None: 
        """
        Initializes a CapsuleCollider. The height is the total vertical span
        and cannot be strictly smaller than radius * 2.
        """
        ...

__init__(radius=25.0, height=50.0)

Initializes a CapsuleCollider. The height is the total vertical span and cannot be strictly smaller than radius * 2.

Source code in foxvoid/__init__.pyi
1531
1532
1533
1534
1535
1536
def __init__(self, radius: float = 25.0, height: float = 50.0) -> None: 
    """
    Initializes a CapsuleCollider. The height is the total vertical span
    and cannot be strictly smaller than radius * 2.
    """
    ...

Checkbox

Bases: Component

A toggleable UI element. Triggers on_gui_click() when pressed.

Source code in foxvoid/__init__.pyi
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
class Checkbox(Component):
    """
    A toggleable UI element. Triggers on_gui_click() when pressed.
    """
    is_on: bool
    use_sprite: bool
    color_on: 'Color'
    color_off: 'Color'

    def __init__(self) -> None: ...

CircleCollider

Bases: Component

A perfect circle collider. Ideal for characters and rolling objects to prevent snagging on TileMap corners.

Source code in foxvoid/__init__.pyi
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
class CircleCollider(Component):
    """
    A perfect circle collider.
    Ideal for characters and rolling objects to prevent
    snagging on TileMap corners.
    """
    radius: float
    offset: Vector2
    is_trigger: bool

    def __init__(self, radius: float = 25.0) -> None: 
        """
        Initializes a CircleCollider with a given radius.
        """
        ...

__init__(radius=25.0)

Initializes a CircleCollider with a given radius.

Source code in foxvoid/__init__.pyi
1513
1514
1515
1516
1517
def __init__(self, radius: float = 25.0) -> None: 
    """
    Initializes a CircleCollider with a given radius.
    """
    ...

CloudManager

Manages communication with the Foxvoid Studio Backend-as-a-Service. Automatically handles Player JWT authentication and Game API keys.

Source code in foxvoid/__init__.pyi
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
class CloudManager:
    """
    Manages communication with the Foxvoid Studio Backend-as-a-Service.
    Automatically handles Player JWT authentication and Game API keys.
    """
    @staticmethod
    def is_authenticated() -> bool:
        """
        Returns True if the current player is authenticated via the Foxvoid platform.
        """
        ...

    @staticmethod
    def pull_save(key: str, on_success: Callable[[Dict[str, Any]], None], on_error: Optional[Callable[[str], None]] = None) -> None:
        """
        Asynchronously retrieves a ScriptableObject from the Foxvoid Cloud.

        :param key: The unique identifier for this save data (e.g., "player_stats").
        :param on_success: Callback receiving the JSON data as a Python dictionary.
        :param on_error: Callback triggered if the download fails or the player is not authenticated.
        """
        ...

    @staticmethod
    def push_save(key: str, data: Dict[str, Any], on_success: Optional[Callable[[Dict[str, Any]], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
        """
        Asynchronously pushes a Python dictionary to the Foxvoid Cloud as a ScriptableObject.

        :param key: The unique identifier for this save data.
        :param data: The Python dictionary containing the data to save.
        :param on_success: Optional callback triggered when the save is confirmed by the server.
        :param on_error: Optional callback triggered if the upload fails.
        """
        ...

    @staticmethod
    def push_scriptable_object(key: str, obj: 'ScriptableObject', on_success: Optional[Callable[[Dict[str, Any]], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
        """
        Asynchronously serializes a ScriptableObject and pushes it to the cloud.
        """
        ...

    @staticmethod
    def pull_scriptable_object(key: str, cls: type, on_success: Callable[['ScriptableObject'], None], on_error: Optional[Callable[[str], None]] = None) -> None:
        """
        Pulls JSON data from the cloud, instantiates the provided ScriptableObject class, 
        deserializes the data into it, and returns it via the success callback.

        Example:
            CloudManager.pull_scriptable_object("stats", PlayerStats, self.on_loaded)
        """
        ...

    @staticmethod
    def pull_into_scriptable_object(key: str, obj: 'ScriptableObject', on_success: Optional[Callable[[], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
        """
        Pulls JSON data from the cloud and overwrites the values of an existing ScriptableObject instance.
        """
        ...

    @staticmethod
    def pull_inventory(
        cls: type[TCloudItem],
        on_success: Callable[[List[TCloudItem]], None],
        on_error: Optional[Callable[[str], None]] = None
    ) -> None:
        """
        Retrieves the player's active and valid inventory for the current game from the Foxvoid Cloud.
        The response is automatically filtered by the 'category' attribute of the provided class 
        and parsed into a list of instantiated objects of that specific CloudItem subclass.

        :param cls: The Python class inheriting from CloudItem (e.g., PlaneSkin) to instantiate.
        :param on_success: Callback triggered when the inventory is successfully retrieved.
                           Receives a list containing instances of the requested class.
        :param on_error: Optional callback triggered if the HTTP request fails or parsing errors occur.
                         Receives a string containing the error message.
        """
        ...

    @staticmethod
    def equip_item(
        item_id: int, 
        category: str, 
        disable_all: bool = True, 
        on_success: Optional[Callable[[], None]] = None, 
        on_error: Optional[Callable[[str], None]] = None
    ) -> None:
        """
        Equips a specific item in the player's cloud inventory by setting its 'is_active' state to True.
        Makes an asynchronous HTTP POST request to the Foxvoid Studio backend.

        Args:
            item_id (int): The unique database ID of the item to equip.
            category (str): The category of the item (e.g., "plane_skin"). Used by the backend to scope the action.
            disable_all (bool): If True, un-equips (sets is_active=False) all other items in the same category 
                                before equipping the requested one. Defaults to True.
            on_success (Callable[[], None], optional): Callback triggered when the server successfully registers the equipment.
            on_error (Callable[[str], None], optional): Callback triggered if the network request fails, receiving the error string.
        """
        ...

equip_item(item_id, category, disable_all=True, on_success=None, on_error=None) staticmethod

Equips a specific item in the player's cloud inventory by setting its 'is_active' state to True. Makes an asynchronous HTTP POST request to the Foxvoid Studio backend.

Parameters:

Name Type Description Default
item_id int

The unique database ID of the item to equip.

required
category str

The category of the item (e.g., "plane_skin"). Used by the backend to scope the action.

required
disable_all bool

If True, un-equips (sets is_active=False) all other items in the same category before equipping the requested one. Defaults to True.

True
on_success Callable[[], None]

Callback triggered when the server successfully registers the equipment.

None
on_error Callable[[str], None]

Callback triggered if the network request fails, receiving the error string.

None
Source code in foxvoid/__init__.pyi
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
@staticmethod
def equip_item(
    item_id: int, 
    category: str, 
    disable_all: bool = True, 
    on_success: Optional[Callable[[], None]] = None, 
    on_error: Optional[Callable[[str], None]] = None
) -> None:
    """
    Equips a specific item in the player's cloud inventory by setting its 'is_active' state to True.
    Makes an asynchronous HTTP POST request to the Foxvoid Studio backend.

    Args:
        item_id (int): The unique database ID of the item to equip.
        category (str): The category of the item (e.g., "plane_skin"). Used by the backend to scope the action.
        disable_all (bool): If True, un-equips (sets is_active=False) all other items in the same category 
                            before equipping the requested one. Defaults to True.
        on_success (Callable[[], None], optional): Callback triggered when the server successfully registers the equipment.
        on_error (Callable[[str], None], optional): Callback triggered if the network request fails, receiving the error string.
    """
    ...

is_authenticated() staticmethod

Returns True if the current player is authenticated via the Foxvoid platform.

Source code in foxvoid/__init__.pyi
1648
1649
1650
1651
1652
1653
@staticmethod
def is_authenticated() -> bool:
    """
    Returns True if the current player is authenticated via the Foxvoid platform.
    """
    ...

pull_into_scriptable_object(key, obj, on_success=None, on_error=None) staticmethod

Pulls JSON data from the cloud and overwrites the values of an existing ScriptableObject instance.

Source code in foxvoid/__init__.pyi
1696
1697
1698
1699
1700
1701
@staticmethod
def pull_into_scriptable_object(key: str, obj: 'ScriptableObject', on_success: Optional[Callable[[], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
    """
    Pulls JSON data from the cloud and overwrites the values of an existing ScriptableObject instance.
    """
    ...

pull_inventory(on_success, on_error=None) staticmethod

Retrieves the player's active and valid inventory for the current game from the Foxvoid Cloud. The response is automatically filtered by the 'category' attribute of the provided class and parsed into a list of instantiated objects of that specific CloudItem subclass.

:param cls: The Python class inheriting from CloudItem (e.g., PlaneSkin) to instantiate. :param on_success: Callback triggered when the inventory is successfully retrieved. Receives a list containing instances of the requested class. :param on_error: Optional callback triggered if the HTTP request fails or parsing errors occur. Receives a string containing the error message.

Source code in foxvoid/__init__.pyi
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
@staticmethod
def pull_inventory(
    cls: type[TCloudItem],
    on_success: Callable[[List[TCloudItem]], None],
    on_error: Optional[Callable[[str], None]] = None
) -> None:
    """
    Retrieves the player's active and valid inventory for the current game from the Foxvoid Cloud.
    The response is automatically filtered by the 'category' attribute of the provided class 
    and parsed into a list of instantiated objects of that specific CloudItem subclass.

    :param cls: The Python class inheriting from CloudItem (e.g., PlaneSkin) to instantiate.
    :param on_success: Callback triggered when the inventory is successfully retrieved.
                       Receives a list containing instances of the requested class.
    :param on_error: Optional callback triggered if the HTTP request fails or parsing errors occur.
                     Receives a string containing the error message.
    """
    ...

pull_save(key, on_success, on_error=None) staticmethod

Asynchronously retrieves a ScriptableObject from the Foxvoid Cloud.

:param key: The unique identifier for this save data (e.g., "player_stats"). :param on_success: Callback receiving the JSON data as a Python dictionary. :param on_error: Callback triggered if the download fails or the player is not authenticated.

Source code in foxvoid/__init__.pyi
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
@staticmethod
def pull_save(key: str, on_success: Callable[[Dict[str, Any]], None], on_error: Optional[Callable[[str], None]] = None) -> None:
    """
    Asynchronously retrieves a ScriptableObject from the Foxvoid Cloud.

    :param key: The unique identifier for this save data (e.g., "player_stats").
    :param on_success: Callback receiving the JSON data as a Python dictionary.
    :param on_error: Callback triggered if the download fails or the player is not authenticated.
    """
    ...

pull_scriptable_object(key, cls, on_success, on_error=None) staticmethod

Pulls JSON data from the cloud, instantiates the provided ScriptableObject class, deserializes the data into it, and returns it via the success callback.

Example

CloudManager.pull_scriptable_object("stats", PlayerStats, self.on_loaded)

Source code in foxvoid/__init__.pyi
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
@staticmethod
def pull_scriptable_object(key: str, cls: type, on_success: Callable[['ScriptableObject'], None], on_error: Optional[Callable[[str], None]] = None) -> None:
    """
    Pulls JSON data from the cloud, instantiates the provided ScriptableObject class, 
    deserializes the data into it, and returns it via the success callback.

    Example:
        CloudManager.pull_scriptable_object("stats", PlayerStats, self.on_loaded)
    """
    ...

push_save(key, data, on_success=None, on_error=None) staticmethod

Asynchronously pushes a Python dictionary to the Foxvoid Cloud as a ScriptableObject.

:param key: The unique identifier for this save data. :param data: The Python dictionary containing the data to save. :param on_success: Optional callback triggered when the save is confirmed by the server. :param on_error: Optional callback triggered if the upload fails.

Source code in foxvoid/__init__.pyi
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
@staticmethod
def push_save(key: str, data: Dict[str, Any], on_success: Optional[Callable[[Dict[str, Any]], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
    """
    Asynchronously pushes a Python dictionary to the Foxvoid Cloud as a ScriptableObject.

    :param key: The unique identifier for this save data.
    :param data: The Python dictionary containing the data to save.
    :param on_success: Optional callback triggered when the save is confirmed by the server.
    :param on_error: Optional callback triggered if the upload fails.
    """
    ...

push_scriptable_object(key, obj, on_success=None, on_error=None) staticmethod

Asynchronously serializes a ScriptableObject and pushes it to the cloud.

Source code in foxvoid/__init__.pyi
1678
1679
1680
1681
1682
1683
@staticmethod
def push_scriptable_object(key: str, obj: 'ScriptableObject', on_success: Optional[Callable[[Dict[str, Any]], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
    """
    Asynchronously serializes a ScriptableObject and pushes it to the cloud.
    """
    ...

Collision2D

Contains information about a physics collision event.

Source code in foxvoid/__init__.pyi
196
197
198
199
200
201
202
203
class Collision2D:
    """Contains information about a physics collision event."""

    other: GameObject | None
    """The GameObject collided with. Will be None if the collision was with the static TileMap."""

    normal: Vector2
    """The direction vector of the surface hit. e.g., (0, -1) means you hit the floor."""

normal instance-attribute

The direction vector of the surface hit. e.g., (0, -1) means you hit the floor.

other instance-attribute

The GameObject collided with. Will be None if the collision was with the static TileMap.

Color

Represents an RGBA color.

Source code in foxvoid/__init__.pyi
798
799
800
801
802
803
804
805
806
class Color:
    """Represents an RGBA color."""
    r: int
    g: int
    b: int
    a: int

    def __init__(self, r: int = 0, g: int = 0, b: int = 0, a: int = 255) -> None: ...
    def __repr__(self) -> str: ...

Component

Base class for all engine scripts and components.

Source code in foxvoid/__init__.pyi
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
class Component:
    """Base class for all engine scripts and components."""

    __categories__: Dict[str, List[str]]
    """
    (Optional) Editor metadata to group variables in the Inspector.
    Format: {"Category Name": ["var1", "var2"]}

    Example:
        __categories__ = {
            "Movement": ["speed", "jump_force"],
            "Combat": ["health", "damage"]
        }
    """

    __tooltips__: Dict[str, str]
    """
    (Optional) Editor metadata to display help text when hovering over variables in the Inspector.
    Format: {"variable_name": "Help text"}

    Example:
        __tooltips__ = {
            "is_wanderer": "Enables or disables random wandering.",
            "speed": "Movement speed in pixels per second."
        }
    """

    __ranges__: Dict[str, Tuple[float, float]]
    """
    (Optional) Editor metadata to clamp numerical variables (int or float) in the Inspector.
    Format: {"variable_name": (min_value, max_value)}

    Example:
        __ranges__ = {
            "speed": (10.0, 500.0),
            "wander_radius": (50.0, 1000.0)
        }
    """

    __multiline__: List[str]
    """
    (Optional) Editor metadata to render string variables as a multiline text area in the Inspector.
    Format: ["var_name_1", "var_name_2"]

    Example:
        __multiline__ = ["quest_description", "npc_dialogue"]
    """

    __readonly__: List[str]
    """
    (Optional) Editor metadata to render variables as read-only (grayed out) in the Inspector.
    Useful for exposing internal state or dynamic values for debugging purposes without risking accidental edits.
    Format: ["var_name_1", "var_name_2"]

    Example:
        __readonly__ = ["current_health", "target_distance"]
    """

    __actions__: List[str]
    """
    (Optional) Editor metadata to expose Python methods as clickable buttons at the bottom of the Inspector.
    Format: ["method_name_1", "method_name_2"]

    Example:
        __actions__ = ["heal_instantly", "level_up"]
    """

    __require_components__: List[Union[Type['Component'], List[Type['Component']]]]
    """
    (Optional) Editor metadata to enforce Component dependencies.
    You can use sublists to create an "OR" condition.

    Example:
        __require_components__ = [Transform2d, [RectCollider, CircleCollider]]
    """

    def __init__(self) -> None: 
        """Initializes the C++ base component memory."""
        ...

    @property
    def game_object(self) -> GameObject:
        """The owning GameObject of this component (Read-only)."""
        ...

    def start(self) -> None: 
        """Called once when the component is initialized."""
        ...

    def update(self, delta_time: float) -> None: 
        """Called every frame for logic and physics."""
        ...

    def on_collision(self, collision: 'Collision2D') -> None: 
        """Called when this object's collider intersects with another."""
        ...

    def on_animation_event(self, event_name: str) -> None:
        """
        Called automatically by an attached Animator2d when a specific frame is reached.
        Override this method in your script to handle animation events (e.g., footsteps, attacks).
        """
        ...

    def on_gui_click(self, button_name: str) -> None:
        """
        Called when a Button component on the same GameObject is clicked
        """
        ...

__actions__ instance-attribute

(Optional) Editor metadata to expose Python methods as clickable buttons at the bottom of the Inspector. Format: ["method_name_1", "method_name_2"]

Example

actions = ["heal_instantly", "level_up"]

__categories__ instance-attribute

(Optional) Editor metadata to group variables in the Inspector. Format: {"Category Name": ["var1", "var2"]}

Example

categories = { "Movement": ["speed", "jump_force"], "Combat": ["health", "damage"] }

__multiline__ instance-attribute

(Optional) Editor metadata to render string variables as a multiline text area in the Inspector. Format: ["var_name_1", "var_name_2"]

Example

multiline = ["quest_description", "npc_dialogue"]

__ranges__ instance-attribute

(Optional) Editor metadata to clamp numerical variables (int or float) in the Inspector. Format: {"variable_name": (min_value, max_value)}

Example

ranges = { "speed": (10.0, 500.0), "wander_radius": (50.0, 1000.0) }

__readonly__ instance-attribute

(Optional) Editor metadata to render variables as read-only (grayed out) in the Inspector. Useful for exposing internal state or dynamic values for debugging purposes without risking accidental edits. Format: ["var_name_1", "var_name_2"]

Example

readonly = ["current_health", "target_distance"]

__require_components__ instance-attribute

(Optional) Editor metadata to enforce Component dependencies. You can use sublists to create an "OR" condition.

Example

require_components = [Transform2d, [RectCollider, CircleCollider]]

__tooltips__ instance-attribute

(Optional) Editor metadata to display help text when hovering over variables in the Inspector. Format: {"variable_name": "Help text"}

Example

tooltips = { "is_wanderer": "Enables or disables random wandering.", "speed": "Movement speed in pixels per second." }

game_object property

The owning GameObject of this component (Read-only).

__init__()

Initializes the C++ base component memory.

Source code in foxvoid/__init__.pyi
282
283
284
def __init__(self) -> None: 
    """Initializes the C++ base component memory."""
    ...

on_animation_event(event_name)

Called automatically by an attached Animator2d when a specific frame is reached. Override this method in your script to handle animation events (e.g., footsteps, attacks).

Source code in foxvoid/__init__.pyi
303
304
305
306
307
308
def on_animation_event(self, event_name: str) -> None:
    """
    Called automatically by an attached Animator2d when a specific frame is reached.
    Override this method in your script to handle animation events (e.g., footsteps, attacks).
    """
    ...

on_collision(collision)

Called when this object's collider intersects with another.

Source code in foxvoid/__init__.pyi
299
300
301
def on_collision(self, collision: 'Collision2D') -> None: 
    """Called when this object's collider intersects with another."""
    ...

on_gui_click(button_name)

Called when a Button component on the same GameObject is clicked

Source code in foxvoid/__init__.pyi
310
311
312
313
314
def on_gui_click(self, button_name: str) -> None:
    """
    Called when a Button component on the same GameObject is clicked
    """
    ...

start()

Called once when the component is initialized.

Source code in foxvoid/__init__.pyi
291
292
293
def start(self) -> None: 
    """Called once when the component is initialized."""
    ...

update(delta_time)

Called every frame for logic and physics.

Source code in foxvoid/__init__.pyi
295
296
297
def update(self, delta_time: float) -> None: 
    """Called every frame for logic and physics."""
    ...

DataManager

Global system responsible for loading, caching, and saving ScriptableObject assets.

Source code in foxvoid/__init__.pyi
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
class DataManager:
    """
    Global system responsible for loading, caching, and saving ScriptableObject assets.
    """

    @staticmethod
    def load_asset(filepath: str) -> Optional[ScriptableObject]:
        """
        Loads a .asset file from disk. If the asset has already been loaded, 
        it returns the cached instance to save memory and performance.

        Args:
            filepath: The relative path to the .asset file (e.g., 'assets/data/sword.asset').

        Returns:
            The fully instantiated Python object, or None if loading failed.
        """
        ...

    @staticmethod
    def save_asset(asset: ScriptableObject, filepath: str) -> None:
        """
        Serializes a ScriptableObject instance and saves it to a .asset JSON file.
        """
        ...

    @staticmethod
    def clear_cache() -> None:
        """
        Clears all loaded assets from memory. 
        Usually called by the engine during scene transitions.
        """
        ...

clear_cache() staticmethod

Clears all loaded assets from memory. Usually called by the engine during scene transitions.

Source code in foxvoid/__init__.pyi
1318
1319
1320
1321
1322
1323
1324
@staticmethod
def clear_cache() -> None:
    """
    Clears all loaded assets from memory. 
    Usually called by the engine during scene transitions.
    """
    ...

load_asset(filepath) staticmethod

Loads a .asset file from disk. If the asset has already been loaded, it returns the cached instance to save memory and performance.

Parameters:

Name Type Description Default
filepath str

The relative path to the .asset file (e.g., 'assets/data/sword.asset').

required

Returns:

Type Description
Optional[ScriptableObject]

The fully instantiated Python object, or None if loading failed.

Source code in foxvoid/__init__.pyi
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
@staticmethod
def load_asset(filepath: str) -> Optional[ScriptableObject]:
    """
    Loads a .asset file from disk. If the asset has already been loaded, 
    it returns the cached instance to save memory and performance.

    Args:
        filepath: The relative path to the .asset file (e.g., 'assets/data/sword.asset').

    Returns:
        The fully instantiated Python object, or None if loading failed.
    """
    ...

save_asset(asset, filepath) staticmethod

Serializes a ScriptableObject instance and saves it to a .asset JSON file.

Source code in foxvoid/__init__.pyi
1311
1312
1313
1314
1315
1316
@staticmethod
def save_asset(asset: ScriptableObject, filepath: str) -> None:
    """
    Serializes a ScriptableObject instance and saves it to a .asset JSON file.
    """
    ...

Debug

Source code in foxvoid/__init__.pyi
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Debug:
    @staticmethod
    def log(msg: str) -> None:
        """
        Prints a message directly to the C++ engine console.
        Bypasses Python's standard stdout to prevent crashes with graphics libraries.
        """
        ...

    @staticmethod
    def error(msg: str) -> None:
        """
        Prints an error directly to the C++ engine console.
        Bypasses Python's standard stdout to prevent crashes with graphics libraries.
        """
        ...

error(msg) staticmethod

Prints an error directly to the C++ engine console. Bypasses Python's standard stdout to prevent crashes with graphics libraries.

Source code in foxvoid/__init__.pyi
22
23
24
25
26
27
28
@staticmethod
def error(msg: str) -> None:
    """
    Prints an error directly to the C++ engine console.
    Bypasses Python's standard stdout to prevent crashes with graphics libraries.
    """
    ...

log(msg) staticmethod

Prints a message directly to the C++ engine console. Bypasses Python's standard stdout to prevent crashes with graphics libraries.

Source code in foxvoid/__init__.pyi
14
15
16
17
18
19
20
@staticmethod
def log(msg: str) -> None:
    """
    Prints a message directly to the C++ engine console.
    Bypasses Python's standard stdout to prevent crashes with graphics libraries.
    """
    ...

EventBus

Global event bus for decoupled communication between C++ and Python, or between different Python scripts. Uses JSON-serializable payloads.

Source code in foxvoid/__init__.pyi
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
class EventBus:
    """
    Global event bus for decoupled communication between C++ and Python, 
    or between different Python scripts. Uses JSON-serializable payloads.
    """

    @staticmethod
    def subscribe(event_name: str, callback: Callable[[Dict[str, Any]], None]) -> int:
        """
        Subscribes a callback function to a specific event.

        :param event_name: The name of the event to listen to.
        :param callback: A function that takes a dictionary (the parsed JSON payload) as its single argument.
        :return: A unique listener ID, which must be used to unsubscribe later.
        """
        ...

    @staticmethod
    def unsubscribe(event_name: str, listener_id: int) -> None:
        """
        Removes a specific listener from an event to prevent memory leaks and ghost calls.
        Should typically be called in the on_destroy() method of a ScriptComponent.

        :param event_name: The name of the event.
        :param listener_id: The unique ID returned by subscribe().
        """
        ...

    @staticmethod
    def publish(event_name: str, payload: Dict[str, Any]) -> None:
        """
        Publishes an event to all subscribers with a data payload.

        :param event_name: The name of the event.
        :param payload: A dictionary representing the data to send. It must be fully JSON serializable.
        """
        ...

    @staticmethod
    def publish_empty(event_name: str) -> None:
        """
        Publishes an event to all subscribers without a specific payload.
        Note: The subscribed callbacks will receive an empty dictionary {}.

        :param event_name: The name of the event.
        """
        ...

publish(event_name, payload) staticmethod

Publishes an event to all subscribers with a data payload.

:param event_name: The name of the event. :param payload: A dictionary representing the data to send. It must be fully JSON serializable.

Source code in foxvoid/__init__.pyi
1567
1568
1569
1570
1571
1572
1573
1574
1575
@staticmethod
def publish(event_name: str, payload: Dict[str, Any]) -> None:
    """
    Publishes an event to all subscribers with a data payload.

    :param event_name: The name of the event.
    :param payload: A dictionary representing the data to send. It must be fully JSON serializable.
    """
    ...

publish_empty(event_name) staticmethod

Publishes an event to all subscribers without a specific payload. Note: The subscribed callbacks will receive an empty dictionary {}.

:param event_name: The name of the event.

Source code in foxvoid/__init__.pyi
1577
1578
1579
1580
1581
1582
1583
1584
1585
@staticmethod
def publish_empty(event_name: str) -> None:
    """
    Publishes an event to all subscribers without a specific payload.
    Note: The subscribed callbacks will receive an empty dictionary {}.

    :param event_name: The name of the event.
    """
    ...

subscribe(event_name, callback) staticmethod

Subscribes a callback function to a specific event.

:param event_name: The name of the event to listen to. :param callback: A function that takes a dictionary (the parsed JSON payload) as its single argument. :return: A unique listener ID, which must be used to unsubscribe later.

Source code in foxvoid/__init__.pyi
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
@staticmethod
def subscribe(event_name: str, callback: Callable[[Dict[str, Any]], None]) -> int:
    """
    Subscribes a callback function to a specific event.

    :param event_name: The name of the event to listen to.
    :param callback: A function that takes a dictionary (the parsed JSON payload) as its single argument.
    :return: A unique listener ID, which must be used to unsubscribe later.
    """
    ...

unsubscribe(event_name, listener_id) staticmethod

Removes a specific listener from an event to prevent memory leaks and ghost calls. Should typically be called in the on_destroy() method of a ScriptComponent.

:param event_name: The name of the event. :param listener_id: The unique ID returned by subscribe().

Source code in foxvoid/__init__.pyi
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
@staticmethod
def unsubscribe(event_name: str, listener_id: int) -> None:
    """
    Removes a specific listener from an event to prevent memory leaks and ghost calls.
    Should typically be called in the on_destroy() method of a ScriptComponent.

    :param event_name: The name of the event.
    :param listener_id: The unique ID returned by subscribe().
    """
    ...

GameObject

Source code in foxvoid/__init__.pyi
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
class GameObject:
    name: str

    # Tag used to group and identify objects (e.g., "Enemy", "Player", "Projectile")
    # Defaults to "Untagged"
    tag: str

    # Allow enabling or disabling the GameObject and its components
    is_active: bool

    # Read-only unique identifier
    @property
    def id(self) -> int: ...

    def is_active_in_hierarchy(self) -> bool:
        """
        Checks if this object is currently active in the scene.
        Returns False if this object OR any of its parents are inactive.
        """
        ...

    def set_parent(self, new_parent: Optional['GameObject']) -> None:
        """Attaches this object to a new parent. Pass None to unparent (move to root)."""
        ...

    def get_parent(self) -> Optional['GameObject']:
        """Returns the current parent of this object, or None if it's at the root."""
        ...

    def get_children(self) -> List['GameObject']:
        """Returns a list of all direct children attached to this object."""
        ...

    def get_child_by_name(self) -> Optional['GameObject']:
        """Recursively searches for a child GameObject by its name."""
        ...

    """Represents an entity within the engine's scene."""
    @staticmethod
    def spawn(name: str) -> GameObject:
        """
        Creates a new empty GameObject in the active scene.

        Args:
            name: The name of the new entity.

        Returns:
            The newly created GameObject instance.
        """
        ...

    @staticmethod
    def instantiate(prefab_path: str) -> Optional[GameObject]:
        """
        Instantiates a new GameObject from a saved JSON prefab file.

        Args:
            prefab_path: The relative path to the .json prefab file (e.g., 'assets/prefabs/Bullet.json').

        Returns:
            The newly instantiated GameObject instance, or None if the file could not be loaded.
        """
        ...

    def destroy(self) -> None:
        """
        Marks this GameObject for destruction. 
        It will be safely removed from memory at the end of the current C++ frame.
        """
        ...

    def get_component(self, type_obj: Type[T]) -> Optional[T]:
        """
        Retrieves a component attached to this GameObject.

        Args:
            type_obj: The class type of the component to retrieve (e.g., Transform2d).

        Returns:
            The component instance if found, otherwise None.
        """
        ...

    def add_component(self, type_obj: Type[T], *args) -> T:
        """
        Dynamically instantiates and attaches a new component to this GameObject.

        Args:
            type_obj: The class type of the component to create.
            *args: Variable arguments passed directly to the C++ constructor of the component.

        Returns:
            The newly created and attached component instance.
        """
        ...

add_component(type_obj, *args)

Dynamically instantiates and attaches a new component to this GameObject.

Parameters:

Name Type Description Default
type_obj Type[T]

The class type of the component to create.

required
*args

Variable arguments passed directly to the C++ constructor of the component.

()

Returns:

Type Description
T

The newly created and attached component instance.

Source code in foxvoid/__init__.pyi
129
130
131
132
133
134
135
136
137
138
139
140
def add_component(self, type_obj: Type[T], *args) -> T:
    """
    Dynamically instantiates and attaches a new component to this GameObject.

    Args:
        type_obj: The class type of the component to create.
        *args: Variable arguments passed directly to the C++ constructor of the component.

    Returns:
        The newly created and attached component instance.
    """
    ...

destroy()

Marks this GameObject for destruction. It will be safely removed from memory at the end of the current C++ frame.

Source code in foxvoid/__init__.pyi
110
111
112
113
114
115
def destroy(self) -> None:
    """
    Marks this GameObject for destruction. 
    It will be safely removed from memory at the end of the current C++ frame.
    """
    ...

get_child_by_name()

Recursively searches for a child GameObject by its name.

Source code in foxvoid/__init__.pyi
79
80
81
def get_child_by_name(self) -> Optional['GameObject']:
    """Recursively searches for a child GameObject by its name."""
    ...

get_children()

Returns a list of all direct children attached to this object.

Source code in foxvoid/__init__.pyi
75
76
77
def get_children(self) -> List['GameObject']:
    """Returns a list of all direct children attached to this object."""
    ...

get_component(type_obj)

Retrieves a component attached to this GameObject.

Parameters:

Name Type Description Default
type_obj Type[T]

The class type of the component to retrieve (e.g., Transform2d).

required

Returns:

Type Description
Optional[T]

The component instance if found, otherwise None.

Source code in foxvoid/__init__.pyi
117
118
119
120
121
122
123
124
125
126
127
def get_component(self, type_obj: Type[T]) -> Optional[T]:
    """
    Retrieves a component attached to this GameObject.

    Args:
        type_obj: The class type of the component to retrieve (e.g., Transform2d).

    Returns:
        The component instance if found, otherwise None.
    """
    ...

get_parent()

Returns the current parent of this object, or None if it's at the root.

Source code in foxvoid/__init__.pyi
71
72
73
def get_parent(self) -> Optional['GameObject']:
    """Returns the current parent of this object, or None if it's at the root."""
    ...

instantiate(prefab_path) staticmethod

Instantiates a new GameObject from a saved JSON prefab file.

Parameters:

Name Type Description Default
prefab_path str

The relative path to the .json prefab file (e.g., 'assets/prefabs/Bullet.json').

required

Returns:

Type Description
Optional[GameObject]

The newly instantiated GameObject instance, or None if the file could not be loaded.

Source code in foxvoid/__init__.pyi
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def instantiate(prefab_path: str) -> Optional[GameObject]:
    """
    Instantiates a new GameObject from a saved JSON prefab file.

    Args:
        prefab_path: The relative path to the .json prefab file (e.g., 'assets/prefabs/Bullet.json').

    Returns:
        The newly instantiated GameObject instance, or None if the file could not be loaded.
    """
    ...

is_active_in_hierarchy()

Checks if this object is currently active in the scene. Returns False if this object OR any of its parents are inactive.

Source code in foxvoid/__init__.pyi
60
61
62
63
64
65
def is_active_in_hierarchy(self) -> bool:
    """
    Checks if this object is currently active in the scene.
    Returns False if this object OR any of its parents are inactive.
    """
    ...

set_parent(new_parent)

Attaches this object to a new parent. Pass None to unparent (move to root).

Source code in foxvoid/__init__.pyi
67
68
69
def set_parent(self, new_parent: Optional['GameObject']) -> None:
    """Attaches this object to a new parent. Pass None to unparent (move to root)."""
    ...

spawn(name) staticmethod

Creates a new empty GameObject in the active scene.

Parameters:

Name Type Description Default
name str

The name of the new entity.

required

Returns:

Type Description
GameObject

The newly created GameObject instance.

Source code in foxvoid/__init__.pyi
84
85
86
87
88
89
90
91
92
93
94
95
@staticmethod
def spawn(name: str) -> GameObject:
    """
    Creates a new empty GameObject in the active scene.

    Args:
        name: The name of the new entity.

    Returns:
        The newly created GameObject instance.
    """
    ...

Globals

Access global game variables managed in the Editor.

Source code in foxvoid/__init__.pyi
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
class Globals:
    """Access global game variables managed in the Editor."""
    @staticmethod
    def set_int(key: str, value: int) -> None: ...

    @staticmethod
    def get_int(key: str, default_val: int = 0) -> int: ...

    @staticmethod
    def set_float(key: str, value: float) -> None: ...

    @staticmethod
    def get_float(key: str, default_val: float = 0.0) -> float: ...

    @staticmethod
    def set_bool(key: str, value: int) -> None: ...

    @staticmethod
    def get_bool(key: str, default_val: bool = False) -> bool: ...

    @staticmethod
    def set_string(key: str, value: str) -> None: ...

    @staticmethod
    def get_string(key: str, default_val: str = "") -> str: ...

HBoxContainer

Bases: Component

Automatically aligns child UI elements horizontally based on their RectTransforms. Perfect for toolbars, dialog buttons, and side-by-side layouts.

Source code in foxvoid/__init__.pyi
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
class HBoxContainer(Component):
    """
    Automatically aligns child UI elements horizontally based on their RectTransforms.
    Perfect for toolbars, dialog buttons, and side-by-side layouts.
    """

    # Space between each child element in pixels
    spacing: float

    # Inner margins at the left and right
    padding_left: float
    padding_right: float

    # Forces vertical alignment of children (0.0 = Top, 0.5 = Center, 1.0 = Bottom)
    vertical_alignment: float

    def __init__(self) -> None: ...

HttpClient

A cross-platform asynchronous HTTP client. Allows Python scripts to perform GET and POST requests without blocking the game loop.

Source code in foxvoid/__init__.pyi
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
class HttpClient:
    """
    A cross-platform asynchronous HTTP client.
    Allows Python scripts to perform GET and POST requests without blocking the game loop.
    """
    @staticmethod
    def get(url: str, headers: Dict[str, str] = {}, on_success: Optional[Callable[[HttpResponse], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
        """
        Performs an asynchronous HTTP GET request.

        :param url: The target URL.
        :param headers: A dictionary of HTTP headers.
        :param on_success: Callback triggered when the request finishes successfully.
        :param on_error: Callback triggered if the request fails (network error, timeout, etc.).
        """
        ...

    @staticmethod
    def post(url: str, headers: Dict[str, str] = {}, body: str = "", on_success: Optional[Callable[[HttpResponse], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
        """
        Performs an asynchronous HTTP POST request.

        :param url: The target URL.
        :param headers: A dictionary of HTTP headers.
        :param body: The string payload to send (usually JSON).
        :param on_success: Callback triggered when the request finishes successfully.
        :param on_error: Callback triggered if the request fails.
        """
        ...

get(url, headers={}, on_success=None, on_error=None) staticmethod

Performs an asynchronous HTTP GET request.

:param url: The target URL. :param headers: A dictionary of HTTP headers. :param on_success: Callback triggered when the request finishes successfully. :param on_error: Callback triggered if the request fails (network error, timeout, etc.).

Source code in foxvoid/__init__.pyi
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
@staticmethod
def get(url: str, headers: Dict[str, str] = {}, on_success: Optional[Callable[[HttpResponse], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
    """
    Performs an asynchronous HTTP GET request.

    :param url: The target URL.
    :param headers: A dictionary of HTTP headers.
    :param on_success: Callback triggered when the request finishes successfully.
    :param on_error: Callback triggered if the request fails (network error, timeout, etc.).
    """
    ...

post(url, headers={}, body='', on_success=None, on_error=None) staticmethod

Performs an asynchronous HTTP POST request.

:param url: The target URL. :param headers: A dictionary of HTTP headers. :param body: The string payload to send (usually JSON). :param on_success: Callback triggered when the request finishes successfully. :param on_error: Callback triggered if the request fails.

Source code in foxvoid/__init__.pyi
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
@staticmethod
def post(url: str, headers: Dict[str, str] = {}, body: str = "", on_success: Optional[Callable[[HttpResponse], None]] = None, on_error: Optional[Callable[[str], None]] = None) -> None:
    """
    Performs an asynchronous HTTP POST request.

    :param url: The target URL.
    :param headers: A dictionary of HTTP headers.
    :param body: The string payload to send (usually JSON).
    :param on_success: Callback triggered when the request finishes successfully.
    :param on_error: Callback triggered if the request fails.
    """
    ...

HttpResponse

Represents the result of an HTTP request.

Source code in foxvoid/__init__.pyi
1588
1589
1590
1591
1592
1593
class HttpResponse:
    """
    Represents the result of an HTTP request.
    """
    status_code: int
    body: str

ImageRenderer

Bases: Component

Renders an image/texture. Uses RectTransform if is_hud is True (Screen Space), or Transform2d if is_hud is False (World Space).

Source code in foxvoid/__init__.pyi
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
class ImageRenderer(Component):
    """
    Renders an image/texture. Uses RectTransform if is_hud is True (Screen Space), 
    or Transform2d if is_hud is False (World Space).
    """

    # Color tint applied to the image
    color: Color

    # Determines if the image is drawn in UI space or world space
    is_hud: bool

    def __init__(self, texture_path: str = "") -> None:
        """Initializes the ImageRenderer, optionally loading a texture immediately."""
        ...

    def set_texture(self, path: str) -> None:
        """
        Updates the displayed texture from a file path.
        Example: self.image.set_texture("assets/textures/menu_bg.png")
        """
        ...

__init__(texture_path='')

Initializes the ImageRenderer, optionally loading a texture immediately.

Source code in foxvoid/__init__.pyi
1372
1373
1374
def __init__(self, texture_path: str = "") -> None:
    """Initializes the ImageRenderer, optionally loading a texture immediately."""
    ...

set_texture(path)

Updates the displayed texture from a file path. Example: self.image.set_texture("assets/textures/menu_bg.png")

Source code in foxvoid/__init__.pyi
1376
1377
1378
1379
1380
1381
def set_texture(self, path: str) -> None:
    """
    Updates the displayed texture from a file path.
    Example: self.image.set_texture("assets/textures/menu_bg.png")
    """
    ...

Input

Handles keyboard and mouse inputs from the engine.

Source code in foxvoid/__init__.pyi
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
class Input:
    """Handles keyboard and mouse inputs from the engine."""

    @staticmethod
    def is_key_down(key: int) -> bool:
        """
        Checks if a key is currently being held down.
        Returns True every frame the key remains pressed.
        """
        ...

    @staticmethod
    def is_key_pressed(key: int) -> bool:
        """
        Checks if a key has been pressed once.
        Returns True only on the exact frame the key was pushed down.
        """
        ...

    @staticmethod
    def is_action_down(action: str) -> bool:
        """
        Checks if ANY of the keys bound to this named action are currently held down.
        Useful for continuous movement (e.g., Input.is_action_down("MoveRight")).
        """
        ...

    @staticmethod
    def is_action_pressed(action: str) -> bool:
        """
        Checks if ANY of the keys bound to this named action were pressed this frame.
        Useful for single actions like jumping or shooting (e.g., Input.is_action_pressed("Jump")).
        """
        ...

is_action_down(action) staticmethod

Checks if ANY of the keys bound to this named action are currently held down. Useful for continuous movement (e.g., Input.is_action_down("MoveRight")).

Source code in foxvoid/__init__.pyi
501
502
503
504
505
506
507
@staticmethod
def is_action_down(action: str) -> bool:
    """
    Checks if ANY of the keys bound to this named action are currently held down.
    Useful for continuous movement (e.g., Input.is_action_down("MoveRight")).
    """
    ...

is_action_pressed(action) staticmethod

Checks if ANY of the keys bound to this named action were pressed this frame. Useful for single actions like jumping or shooting (e.g., Input.is_action_pressed("Jump")).

Source code in foxvoid/__init__.pyi
509
510
511
512
513
514
515
@staticmethod
def is_action_pressed(action: str) -> bool:
    """
    Checks if ANY of the keys bound to this named action were pressed this frame.
    Useful for single actions like jumping or shooting (e.g., Input.is_action_pressed("Jump")).
    """
    ...

is_key_down(key) staticmethod

Checks if a key is currently being held down. Returns True every frame the key remains pressed.

Source code in foxvoid/__init__.pyi
485
486
487
488
489
490
491
@staticmethod
def is_key_down(key: int) -> bool:
    """
    Checks if a key is currently being held down.
    Returns True every frame the key remains pressed.
    """
    ...

is_key_pressed(key) staticmethod

Checks if a key has been pressed once. Returns True only on the exact frame the key was pushed down.

Source code in foxvoid/__init__.pyi
493
494
495
496
497
498
499
@staticmethod
def is_key_pressed(key: int) -> bool:
    """
    Checks if a key has been pressed once.
    Returns True only on the exact frame the key was pushed down.
    """
    ...

Keys

Raylib keyboard key codes.

Source code in foxvoid/__init__.pyi
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
class Keys:
    """Raylib keyboard key codes."""
    KEY_NULL: int
    KEY_APOSTROPHE: int
    KEY_COMMA: int
    KEY_MINUS: int
    KEY_PERIOD: int
    KEY_SLASH: int

    KEY_ZERO: int
    KEY_ONE: int
    KEY_TWO: int
    KEY_THREE: int
    KEY_FOUR: int
    KEY_FIVE: int
    KEY_SIX: int
    KEY_SEVEN: int
    KEY_EIGHT: int
    KEY_NINE: int

    KEY_SEMICOLON: int
    KEY_EQUAL: int

    KEY_A: int
    KEY_B: int
    KEY_C: int
    KEY_D: int
    KEY_E: int
    KEY_F: int
    KEY_G: int
    KEY_H: int
    KEY_I: int
    KEY_J: int
    KEY_K: int
    KEY_L: int
    KEY_M: int
    KEY_N: int
    KEY_O: int
    KEY_P: int
    KEY_Q: int
    KEY_R: int
    KEY_S: int
    KEY_T: int
    KEY_U: int
    KEY_V: int
    KEY_W: int
    KEY_X: int
    KEY_Y: int
    KEY_Z: int

    KEY_LEFT_BRACKET: int
    KEY_BACKSLASH: int
    KEY_RIGHT_BRACKET: int
    KEY_GRAVE: int

    KEY_SPACE: int
    KEY_ESCAPE: int
    KEY_ENTER: int
    KEY_TAB: int
    KEY_BACKSPACE: int
    KEY_INSERT: int
    KEY_DELETE: int
    RIGHT: int
    LEFT: int
    DOWN: int
    UP: int
    KEY_PAGE_UP: int
    KEY_PAGE_DOWN: int
    KEY_HOME: int
    KEY_END: int
    KEY_CAPS_LOCK: int
    KEY_SCROLL_LOCK: int
    KEY_NUM_LOCK: int
    KEY_PRINT_SCREEN: int
    KEY_PAUSE: int

    KEY_F1: int
    KEY_F2: int
    KEY_F3: int
    KEY_F4: int
    KEY_F5: int
    KEY_F6: int
    KEY_F7: int
    KEY_F8: int
    KEY_F9: int
    KEY_F10: int
    KEY_F11: int
    KEY_F12: int

    KEY_LEFT_SHIFT: int
    KEY_LEFT_CONTROL: int
    KEY_LEFT_ALT: int
    KEY_LEFT_SUPER: int
    KEY_RIGHT_SHIFT: int
    KEY_RIGHT_CONTROL: int
    KEY_RIGHT_ALT: int
    KEY_RIGHT_SUPER: int
    KEY_KB_MENU: int

    KEY_KP_0: int
    KEY_KP_1: int
    KEY_KP_2: int
    KEY_KP_3: int
    KEY_KP_4: int
    KEY_KP_5: int
    KEY_KP_6: int
    KEY_KP_7: int
    KEY_KP_8: int
    KEY_KP_9: int

    KEY_KP_DECIMAL: int
    KEY_KP_DIVIDE: int
    KEY_KP_MULTIPLY: int
    KEY_KP_SUBTRACT: int
    KEY_KP_ADD: int
    KEY_KP_ENTER: int
    KEY_KP_EQUAL: int

    KEY_BACK: int
    KEY_MENU: int
    KEY_VOLUME_UP: int
    KEY_VOLUME_DOWN: int

LoopMode

Bases: Enum

Defines how an animation should behave when it reaches the end.

Source code in foxvoid/__init__.pyi
670
671
672
673
674
class LoopMode(Enum):
    """Defines how an animation should behave when it reaches the end."""
    Once = 0
    Loop = 1
    PingPong = 2

Mask

Bases: Component

Clips (hides) all child UI elements that render outside of this GameObject's RectTransform bounds.

Source code in foxvoid/__init__.pyi
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
class Mask(Component):
    """
    Clips (hides) all child UI elements that render outside of 
    this GameObject's RectTransform bounds.
    """

    # Allows turning the clipping effect on or off
    is_active: bool

    def __init__(self) -> None: ...

ParticleSystem2d

Bases: Component

A versatile 2D particle emitter for creating visual effects like fire, rain, and explosions. All properties can be modified in real-time from Python to dynamically animate the emitter.

Source code in foxvoid/__init__.pyi
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
class ParticleSystem2d(Component):
    """
    A versatile 2D particle emitter for creating visual effects like fire, rain, and explosions.
    All properties can be modified in real-time from Python to dynamically animate the emitter.
    """

    is_emitting: bool
    """If True, the system continuously spawns particles according to the emission_rate."""

    emission_rate: float
    """Number of particles generated per second."""

    life_min: float
    """Minimum lifetime of a generated particle in seconds."""

    life_max: float
    """Maximum lifetime of a generated particle in seconds."""

    speed_min: float
    """Minimum initial speed of a particle."""

    speed_max: float
    """Maximum initial speed of a particle."""

    emission_angle: float
    """The main direction the particles are fired in degrees (-90.0 is straight up)."""

    angle_spread: float
    """The cone width in degrees where particles can randomly spawn around the emission_angle."""

    gravity: float
    """Downward force applied to particles over time. Use negative values to make them float up."""

    start_color: Color
    """The color of the particle when it is born."""

    end_color: Color
    """The color of the particle when it dies (useful for fading out with alpha)."""

    start_size: float
    """The size in pixels of the particle when it is born."""

    end_size: float
    """The size in pixels of the particle when it dies."""

    def __init__(self) -> None:
        """Initializes a new ParticleSystem2d with default values."""
        ...

    def emit_burst(self, count: int) -> None:
        """
        Instantly fires a specific number of particles, ignoring the is_emitting state.
        Perfect for instantaneous effects like explosions, hit sparks, or item collection.

        Args:
            count: The number of particles to spawn immediately.
        """
        ...

angle_spread instance-attribute

The cone width in degrees where particles can randomly spawn around the emission_angle.

emission_angle instance-attribute

The main direction the particles are fired in degrees (-90.0 is straight up).

emission_rate instance-attribute

Number of particles generated per second.

end_color instance-attribute

The color of the particle when it dies (useful for fading out with alpha).

end_size instance-attribute

The size in pixels of the particle when it dies.

gravity instance-attribute

Downward force applied to particles over time. Use negative values to make them float up.

is_emitting instance-attribute

If True, the system continuously spawns particles according to the emission_rate.

life_max instance-attribute

Maximum lifetime of a generated particle in seconds.

life_min instance-attribute

Minimum lifetime of a generated particle in seconds.

speed_max instance-attribute

Maximum initial speed of a particle.

speed_min instance-attribute

Minimum initial speed of a particle.

start_color instance-attribute

The color of the particle when it is born.

start_size instance-attribute

The size in pixels of the particle when it is born.

__init__()

Initializes a new ParticleSystem2d with default values.

Source code in foxvoid/__init__.pyi
1259
1260
1261
def __init__(self) -> None:
    """Initializes a new ParticleSystem2d with default values."""
    ...

emit_burst(count)

Instantly fires a specific number of particles, ignoring the is_emitting state. Perfect for instantaneous effects like explosions, hit sparks, or item collection.

Parameters:

Name Type Description Default
count int

The number of particles to spawn immediately.

required
Source code in foxvoid/__init__.pyi
1263
1264
1265
1266
1267
1268
1269
1270
1271
def emit_burst(self, count: int) -> None:
    """
    Instantly fires a specific number of particles, ignoring the is_emitting state.
    Perfect for instantaneous effects like explosions, hit sparks, or item collection.

    Args:
        count: The number of particles to spawn immediately.
    """
    ...

Physics

Global physics engine.

Source code in foxvoid/__init__.pyi
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
class Physics:
    """Global physics engine."""

    @staticmethod
    def raycast(origin: Tuple[float, float], direction: Tuple[float, float], distance: float) -> RaycastHit:
        """
        Casts an invisible ray into the scene to detect collisions.

        Example: Physics.raycast((x, y), (0, 1), 100.0) casts a ray downwards.
        """
        ...

raycast(origin, direction, distance) staticmethod

Casts an invisible ray into the scene to detect collisions.

Example: Physics.raycast((x, y), (0, 1), 100.0) casts a ray downwards.

Source code in foxvoid/__init__.pyi
1135
1136
1137
1138
1139
1140
1141
1142
@staticmethod
def raycast(origin: Tuple[float, float], direction: Tuple[float, float], distance: float) -> RaycastHit:
    """
    Casts an invisible ray into the scene to detect collisions.

    Example: Physics.raycast((x, y), (0, 1), 100.0) casts a ray downwards.
    """
    ...

PolygonCollider

Bases: Component

A custom polygonal shape collider. Warning: The shape MUST be convex (no hollow parts/indentations), and the vertices should ideally be defined in a clockwise order.

Source code in foxvoid/__init__.pyi
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
class PolygonCollider(Component):
    """
    A custom polygonal shape collider.
    Warning: The shape MUST be convex (no hollow parts/indentations),
    and the vertices should ideally be defined in a clockwise order.
    """
    local_vertices: list[Vector2]
    offset: Vector2
    is_trigger: bool

    def __init__(self) -> None: 
        """
        Initializes a PolygonCollider with a default triangle shape.
        """
        ...

__init__()

Initializes a PolygonCollider with a default triangle shape.

Source code in foxvoid/__init__.pyi
1497
1498
1499
1500
1501
def __init__(self) -> None: 
    """
    Initializes a PolygonCollider with a default triangle shape.
    """
    ...

PubManager

Cross-platform Advertisement Manager. Handles the initialization and display of rewarded video ads. Abstracts the underlying implementation (Emscripten HTML5, Android JNI, or Desktop browser polling).

Source code in foxvoid/__init__.pyi
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
class PubManager:
    """
    Cross-platform Advertisement Manager.
    Handles the initialization and display of rewarded video ads.
    Abstracts the underlying implementation (Emscripten HTML5, Android JNI, or Desktop browser polling).
    """

    @staticmethod
    def show_rewarded_ad(
        placement_id: str, 
        on_reward: Optional[Callable[[], None]] = None, 
        on_error: Optional[Callable[[str], None]] = None
    ) -> None:
        """
        Requests and displays a rewarded video ad based on the active platform.

        - WebAssembly: Triggers a JavaScript HTML5 overlay.
        - Android: Triggers native AdMob UI via JNI (Deferred).
        - Desktop (Linux/Windows): Opens the system browser to a Django-hosted ad page and polls the API.

        Args:
            placement_id: The unique string identifier for the ad placement (e.g., "tappy_plane_revive").
            on_reward: Callback triggered asynchronously on the Main Thread when the ad is fully watched.
            on_error: Callback triggered asynchronously on the Main Thread if the ad fails, is closed early, or times out. Receives an error message string.
        """
        ...

show_rewarded_ad(placement_id, on_reward=None, on_error=None) staticmethod

Requests and displays a rewarded video ad based on the active platform.

  • WebAssembly: Triggers a JavaScript HTML5 overlay.
  • Android: Triggers native AdMob UI via JNI (Deferred).
  • Desktop (Linux/Windows): Opens the system browser to a Django-hosted ad page and polls the API.

Parameters:

Name Type Description Default
placement_id str

The unique string identifier for the ad placement (e.g., "tappy_plane_revive").

required
on_reward Optional[Callable[[], None]]

Callback triggered asynchronously on the Main Thread when the ad is fully watched.

None
on_error Optional[Callable[[str], None]]

Callback triggered asynchronously on the Main Thread if the ad fails, is closed early, or times out. Receives an error message string.

None
Source code in foxvoid/__init__.pyi
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
@staticmethod
def show_rewarded_ad(
    placement_id: str, 
    on_reward: Optional[Callable[[], None]] = None, 
    on_error: Optional[Callable[[str], None]] = None
) -> None:
    """
    Requests and displays a rewarded video ad based on the active platform.

    - WebAssembly: Triggers a JavaScript HTML5 overlay.
    - Android: Triggers native AdMob UI via JNI (Deferred).
    - Desktop (Linux/Windows): Opens the system browser to a Django-hosted ad page and polls the API.

    Args:
        placement_id: The unique string identifier for the ad placement (e.g., "tappy_plane_revive").
        on_reward: Callback triggered asynchronously on the Main Thread when the ad is fully watched.
        on_error: Callback triggered asynchronously on the Main Thread if the ad fails, is closed early, or times out. Receives an error message string.
    """
    ...

RaycastHit

Contains information about a raycast impact.

Source code in foxvoid/__init__.pyi
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
class RaycastHit:
    """Contains information about a raycast impact."""

    hit: bool
    """True if the ray hit a solid object or a TileMap."""

    collider: Optional[GameObject]
    """The object hit by the ray (can be None if nothing was hit)."""

    point: Tuple[float, float]
    """The exact (x, y) world coordinates of the impact point."""

    distance: float
    """The distance between the ray's origin and the impact point."""

collider instance-attribute

The object hit by the ray (can be None if nothing was hit).

distance instance-attribute

The distance between the ray's origin and the impact point.

hit instance-attribute

True if the ray hit a solid object or a TileMap.

point instance-attribute

The exact (x, y) world coordinates of the impact point.

RectCollider

Bases: Component

Component that defines a 2D rectangular collision shape. It does not apply physics forces by itself, it only defines the boundary.

Source code in foxvoid/__init__.pyi
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
class RectCollider(Component):
    """
    Component that defines a 2D rectangular collision shape.
    It does not apply physics forces by itself, it only defines the boundary.
    """

    size: Vector2
    """The width and height of the collision box (default is 50x50)."""

    offset: Vector2
    """The local offset of the collider relative to the GameObject's center position."""

    is_trigger: bool
    """
    If true, this collider will not physically block or bounce off other objects.
    It will only be used to detect overlapping areas (e.g., coins, checkpoints, damage zones).
    """

    def __init__(self, width: float = 50.0, height: float = 50.0) -> None:
        """
        Initializes a RectCollider.
        :param width: The width of the collision bounding box.
        :param height: The height of the collision bounding box.
        """
        ...

is_trigger instance-attribute

If true, this collider will not physically block or bounce off other objects. It will only be used to detect overlapping areas (e.g., coins, checkpoints, damage zones).

offset instance-attribute

The local offset of the collider relative to the GameObject's center position.

size instance-attribute

The width and height of the collision box (default is 50x50).

__init__(width=50.0, height=50.0)

Initializes a RectCollider. :param width: The width of the collision bounding box. :param height: The height of the collision bounding box.

Source code in foxvoid/__init__.pyi
755
756
757
758
759
760
761
def __init__(self, width: float = 50.0, height: float = 50.0) -> None:
    """
    Initializes a RectCollider.
    :param width: The width of the collision bounding box.
    :param height: The height of the collision bounding box.
    """
    ...

RectTransform

Bases: Component

Component responsible for UI layout, managing anchors, pivots, and screen-space coordinates. Replaces Transform2d for HUD elements.

Source code in foxvoid/__init__.pyi
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
class RectTransform(Component):
    """
    Component responsible for UI layout, managing anchors, pivots, and screen-space coordinates.
    Replaces Transform2d for HUD elements.
    """

    # The width and height of the UI element in pixels
    size: Vector2

    # The pixel offset relative to the calculated anchor point
    position: Vector2

    # Normalized screen anchor point (0.0 to 1.0)
    # (0,0) is top-left, (1,1) is bottom-right, (0.5, 0.5) is center
    anchor: Vector2

    # Normalized pivot point on the element itself (0.0 to 1.0)
    # Determines which part of the element corresponds to the 'position'
    pivot: Vector2

    def __init__(self) -> None:
        """Initializes a new RectTransform with default centered values."""
        ...

    def get_screen_rect(self) -> Rectangle:
        """
        Calculates the absolute pixel coordinates of the element on the screen.

        :return: A Rectangle object containing (x, y, width, height) ready for Raylib drawing.
        """
        ...

__init__()

Initializes a new RectTransform with default centered values.

Source code in foxvoid/__init__.pyi
1347
1348
1349
def __init__(self) -> None:
    """Initializes a new RectTransform with default centered values."""
    ...

get_screen_rect()

Calculates the absolute pixel coordinates of the element on the screen.

:return: A Rectangle object containing (x, y, width, height) ready for Raylib drawing.

Source code in foxvoid/__init__.pyi
1351
1352
1353
1354
1355
1356
1357
def get_screen_rect(self) -> Rectangle:
    """
    Calculates the absolute pixel coordinates of the element on the screen.

    :return: A Rectangle object containing (x, y, width, height) ready for Raylib drawing.
    """
    ...

Rectangle

A standard Raylib Rectangle containing x, y, width and height

Source code in foxvoid/__init__.pyi
185
186
187
188
189
190
191
192
193
class Rectangle:
    """A standard Raylib Rectangle containing x, y, width and height"""
    x: float
    y: float
    width: float
    height: float

    def __init__(self, x: float = 0.0, y: float = 0.0, width: float = 0.0, height: float = 0.0):
        ...

RigidBody2d

Bases: Component

Component that puts the GameObject under the control of the physics engine. It requires a Collider component on the same GameObject to actually hit things.

Source code in foxvoid/__init__.pyi
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
class RigidBody2d(Component):
    """
    Component that puts the GameObject under the control of the physics engine.
    It requires a Collider component on the same GameObject to actually hit things.
    """

    velocity: Vector2
    """The current linear speed and direction of the object."""

    mass: float
    """The weight of the object. Heavier objects push lighter objects during collisions."""

    gravity_scale: float
    """
    Multiplier applied to the world's gravity. 
    1.0 is normal gravity, 0.0 means the object floats, negative values make it fall upwards.
    """

    is_kinematic: bool
    """
    If true, the physics engine will NOT apply forces, gravity, or push this object during collisions.
    Useful for moving platforms or objects controlled entirely by animations/scripts.
    """

    @property
    def is_grounded(self) -> bool: ...

    def __init__(self) -> None:
        """
        Initializes a RigidBody2d with default values (mass=1.0, gravity=1.0, non-kinematic).
        """
        ...

gravity_scale instance-attribute

Multiplier applied to the world's gravity. 1.0 is normal gravity, 0.0 means the object floats, negative values make it fall upwards.

is_kinematic instance-attribute

If true, the physics engine will NOT apply forces, gravity, or push this object during collisions. Useful for moving platforms or objects controlled entirely by animations/scripts.

mass instance-attribute

The weight of the object. Heavier objects push lighter objects during collisions.

velocity instance-attribute

The current linear speed and direction of the object.

__init__()

Initializes a RigidBody2d with default values (mass=1.0, gravity=1.0, non-kinematic).

Source code in foxvoid/__init__.pyi
791
792
793
794
795
def __init__(self) -> None:
    """
    Initializes a RigidBody2d with default values (mass=1.0, gravity=1.0, non-kinematic).
    """
    ...

Scene

Represents the currently active game scene, containing all active GameObjects. Provides global access and search utilities.

Source code in foxvoid/__init__.pyi
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
class Scene:
    """
    Represents the currently active game scene, containing all active GameObjects.
    Provides global access and search utilities.
    """

    @staticmethod
    def find_object_by_name(name: str) -> Optional[GameObject]:
        """
        Searches for a GameObject by its exact name across the entire active scene.
        This is a global search and will find the object regardless of its parent.

        Args:
            name (str): The exact name of the GameObject to search for.

        Returns:
            Optional[GameObject]: The found GameObject instance, or None if no object matches the name.

        Example:
            camera = Scene.find_object_by_name("Main Camera")
            if camera:
                print("Camera found!")
        """
        ...

    @staticmethod
    def find_objects_with_tag(target_tag: str) -> List[GameObject]:
        """
        Searches for all active GameObjects matching the given tag across the entire scene.
        This method is highly optimized in C++ for fast radar and collision queries.

        Args:
            target_tag (str): The tag to search for (e.g., "Enemy").

        Returns:
            List[GameObject]: A list of all active GameObjects that possess the requested tag.
                              Returns an empty list if no objects match.

        Example:
            enemies = Scene.find_objects_with_tag("Enemy")
            for enemy in enemies:
                enemy_transform = enemy.get_component(Transform2d)
                # Calculate distance...
        """
        ...

    @staticmethod
    def get_all_objects() -> List[GameObject]:
        """
        Retrieves all GameObjects currently present in the active scene.
        Useful for broad queries or manual spatial checks.

        Returns:
            List[GameObject]: A list containing all GameObjects in the scene.

        Example:
            all_objs = Scene.get_all_objects()
            for obj in all_objs:
                print(obj.name)
        """
        ...

find_object_by_name(name) staticmethod

Searches for a GameObject by its exact name across the entire active scene. This is a global search and will find the object regardless of its parent.

Parameters:

Name Type Description Default
name str

The exact name of the GameObject to search for.

required

Returns:

Type Description
Optional[GameObject]

Optional[GameObject]: The found GameObject instance, or None if no object matches the name.

Example

camera = Scene.find_object_by_name("Main Camera") if camera: print("Camera found!")

Source code in foxvoid/__init__.pyi
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
@staticmethod
def find_object_by_name(name: str) -> Optional[GameObject]:
    """
    Searches for a GameObject by its exact name across the entire active scene.
    This is a global search and will find the object regardless of its parent.

    Args:
        name (str): The exact name of the GameObject to search for.

    Returns:
        Optional[GameObject]: The found GameObject instance, or None if no object matches the name.

    Example:
        camera = Scene.find_object_by_name("Main Camera")
        if camera:
            print("Camera found!")
    """
    ...

find_objects_with_tag(target_tag) staticmethod

Searches for all active GameObjects matching the given tag across the entire scene. This method is highly optimized in C++ for fast radar and collision queries.

Parameters:

Name Type Description Default
target_tag str

The tag to search for (e.g., "Enemy").

required

Returns:

Type Description
List[GameObject]

List[GameObject]: A list of all active GameObjects that possess the requested tag. Returns an empty list if no objects match.

Example

enemies = Scene.find_objects_with_tag("Enemy") for enemy in enemies: enemy_transform = enemy.get_component(Transform2d) # Calculate distance...

Source code in foxvoid/__init__.pyi
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
@staticmethod
def find_objects_with_tag(target_tag: str) -> List[GameObject]:
    """
    Searches for all active GameObjects matching the given tag across the entire scene.
    This method is highly optimized in C++ for fast radar and collision queries.

    Args:
        target_tag (str): The tag to search for (e.g., "Enemy").

    Returns:
        List[GameObject]: A list of all active GameObjects that possess the requested tag.
                          Returns an empty list if no objects match.

    Example:
        enemies = Scene.find_objects_with_tag("Enemy")
        for enemy in enemies:
            enemy_transform = enemy.get_component(Transform2d)
            # Calculate distance...
    """
    ...

get_all_objects() staticmethod

Retrieves all GameObjects currently present in the active scene. Useful for broad queries or manual spatial checks.

Returns:

Type Description
List[GameObject]

List[GameObject]: A list containing all GameObjects in the scene.

Example

all_objs = Scene.get_all_objects() for obj in all_objs: print(obj.name)

Source code in foxvoid/__init__.pyi
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
@staticmethod
def get_all_objects() -> List[GameObject]:
    """
    Retrieves all GameObjects currently present in the active scene.
    Useful for broad queries or manual spatial checks.

    Returns:
        List[GameObject]: A list containing all GameObjects in the scene.

    Example:
        all_objs = Scene.get_all_objects()
        for obj in all_objs:
            print(obj.name)
    """
    ...

SceneManager

Handles loading and transitioning between different scenes/levels.

Source code in foxvoid/__init__.pyi
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
class SceneManager:
    """Handles loading and transitioning between different scenes/levels."""

    @staticmethod
    def load_scene(name: str) -> None:
        """
        Requests the engine to load a new scene at the start of the next frame.
        The name should not include the extension or path (e.g., 'main_menu', 'level_01').
        """
        ...

load_scene(name) staticmethod

Requests the engine to load a new scene at the start of the next frame. The name should not include the extension or path (e.g., 'main_menu', 'level_01').

Source code in foxvoid/__init__.pyi
1007
1008
1009
1010
1011
1012
1013
@staticmethod
def load_scene(name: str) -> None:
    """
    Requests the engine to load a new scene at the start of the next frame.
    The name should not include the extension or path (e.g., 'main_menu', 'level_01').
    """
    ...

ScriptableObject

Base class for all data-driven assets in Foxvoid Engine. Inherit from this class to create custom data containers (e.g., Items, Stats, Quests). The engine will automatically inspect your custom properties and generate an ImGui interface.

Source code in foxvoid/__init__.pyi
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
class ScriptableObject:
    """
    Base class for all data-driven assets in Foxvoid Engine.
    Inherit from this class to create custom data containers (e.g., Items, Stats, Quests).
    The engine will automatically inspect your custom properties and generate an ImGui interface.
    """

    asset_id: str
    """The unique string identifier used to load this asset from disk."""

    name: str
    """The display name of the asset."""

    def __init__(self) -> None: 
        """Initializes an empty ScriptableObject."""
        ...

asset_id instance-attribute

The unique string identifier used to load this asset from disk.

name instance-attribute

The display name of the asset.

__init__()

Initializes an empty ScriptableObject.

Source code in foxvoid/__init__.pyi
1287
1288
1289
def __init__(self) -> None: 
    """Initializes an empty ScriptableObject."""
    ...

ShapeRenderer

Bases: Component

Component that renders a basic geometric rectangle. It can be drawn in world space or locked to the screen as a HUD element.

Source code in foxvoid/__init__.pyi
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
class ShapeRenderer(Component):
    """
    Component that renders a basic geometric rectangle.
    It can be drawn in world space or locked to the screen as a HUD element.
    """

    width: float
    """The base width of the shape in pixels (before Transform scale)."""

    height: float
    """The base height of the shape in pixels (before Transform scale)."""

    color: Color
    """The RGBA color of the shape."""

    is_hud: bool
    """
    If True, the shape is rendered in Screen Space (sticks to the camera viewport).
    If False, it is rendered in World Space.
    """

    def __init__(self) -> None:
        """
        Initializes a ShapeRenderer with default values (50x50, white).
        """
        ...

color instance-attribute

The RGBA color of the shape.

height instance-attribute

The base height of the shape in pixels (before Transform scale).

is_hud instance-attribute

If True, the shape is rendered in Screen Space (sticks to the camera viewport). If False, it is rendered in World Space.

width instance-attribute

The base width of the shape in pixels (before Transform scale).

__init__()

Initializes a ShapeRenderer with default values (50x50, white).

Source code in foxvoid/__init__.pyi
645
646
647
648
649
def __init__(self) -> None:
    """
    Initializes a ShapeRenderer with default values (50x50, white).
    """
    ...

Slider

Bases: Component

An interactive UI element that allows selecting a numerical value by dragging a handle along a track. Triggers on_gui_click() dynamically.

Source code in foxvoid/__init__.pyi
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
class Slider(Component):
    """
    An interactive UI element that allows selecting a numerical value 
    by dragging a handle along a track. Triggers on_gui_click() dynamically.
    """
    value: float
    min_value: float
    max_value: float

    track_color: 'Color'
    handle_color: 'Color'
    active_handle_color: 'Color'

    def __init__(self) -> None: ...

SpriteRenderer

Bases: Component

Renders a 2D texture at the position defined by the entity's Transform2d.

Source code in foxvoid/__init__.pyi
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
class SpriteRenderer(Component):
    """Renders a 2D texture at the position defined by the entity's Transform2d."""

    def __init__(self, texture_path: str) -> None: 
        """
        Loads an image file into GPU memory for rendering.

        Args:
            texture_path: The relative path to the image file (e.g., 'assets/player.png').
        """
        ...

    @property
    def width(self) -> float: ...

    @property
    def height(self) -> float: ...

    def set_tint(self, r: int, g: int, b: int, a: int = 255) -> None:
        """Sets the RGBA multiplication tint color for the sprite rendering."""
        ...

    def set_opacity(self, alpha: float) -> None:
        """Sets the transparency of the sprite (0.0 to 1.0)."""
        ...

    def set_visible(self, visible: bool) -> None:
        """Shows or hides the sprite."""
        ...

__init__(texture_path)

Loads an image file into GPU memory for rendering.

Parameters:

Name Type Description Default
texture_path str

The relative path to the image file (e.g., 'assets/player.png').

required
Source code in foxvoid/__init__.pyi
521
522
523
524
525
526
527
528
def __init__(self, texture_path: str) -> None: 
    """
    Loads an image file into GPU memory for rendering.

    Args:
        texture_path: The relative path to the image file (e.g., 'assets/player.png').
    """
    ...

set_opacity(alpha)

Sets the transparency of the sprite (0.0 to 1.0).

Source code in foxvoid/__init__.pyi
540
541
542
def set_opacity(self, alpha: float) -> None:
    """Sets the transparency of the sprite (0.0 to 1.0)."""
    ...

set_tint(r, g, b, a=255)

Sets the RGBA multiplication tint color for the sprite rendering.

Source code in foxvoid/__init__.pyi
536
537
538
def set_tint(self, r: int, g: int, b: int, a: int = 255) -> None:
    """Sets the RGBA multiplication tint color for the sprite rendering."""
    ...

set_visible(visible)

Shows or hides the sprite.

Source code in foxvoid/__init__.pyi
544
545
546
def set_visible(self, visible: bool) -> None:
    """Shows or hides the sprite."""
    ...

SpriteSheetRenderer

Bases: Component

Renders a specific frame from a grid-based spritesheet texture.

Source code in foxvoid/__init__.pyi
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
class SpriteSheetRenderer(Component):
    """Renders a specific frame from a grid-based spritesheet texture."""

    def __init__(self, texture_path: str, columns: int, rows: int) -> None: 
        """
        Loads a spritesheet into GPU memory.

        Args:
            texture_path: The relative path to the image file.
            columns: The number of columns in the spritesheet grid.
            rows: The number of rows in the spritesheet grid.
        """
        ...

    is_hud: bool
    """
    Determines if the sprite is rendered in screen space as a UI element (True) 
    or in world space using standard camera transformations (False).
    """

    preserve_aspect: bool
    """
    Determines whether the sprite maintains its original aspect ratio when rendered 
    in the UI (HUD mode). If True, the image will scale to fit inside its RectTransform 
    bounds without stretching, automatically centering itself within the available space.
    """

    def set_texture(self, path: str) -> None:
        """
        Safely unloads the current texture reference and loads a new one.
        Automatically resolves the given path through the engine's Asset Registry.

        Args:
            path: The relative path to the new image file (e.g., 'assets/textures/new_icon.png').
        """
        ...

    @property
    def frame(self) -> int:
        """The current frame index being rendered (0 to frame_count - 1)."""
        ...

    @frame.setter
    def frame(self, value: int) -> None: ...

    @property
    def frame_count(self) -> int:
        """Total number of frames in the spritesheet (Read-only)."""
        ...

    def set_tint(self, r: int, g: int, b: int, a: int = 255) -> None:
        """
        Sets the RGBA multiplication tint color for the sprite rendering.
        Values must be between 0 and 255.
        Default is pure white (255, 255, 255, 255), meaning no alteration.
        """
        ...

    def set_opacity(self, alpha: float) -> None:
        """
        Quickly modifies the transparency of the sprite.

        Args:
            alpha: A float between 0.0 (fully transparent) and 1.0 (fully opaque).
        """
        ...

    def set_visible(self, visible: bool) -> None:
        """
        Instantly toggles the rendering of this sprite on or off 
        without destroying the GameObject.
        """
        ...

frame property writable

The current frame index being rendered (0 to frame_count - 1).

frame_count property

Total number of frames in the spritesheet (Read-only).

is_hud instance-attribute

Determines if the sprite is rendered in screen space as a UI element (True) or in world space using standard camera transformations (False).

preserve_aspect instance-attribute

Determines whether the sprite maintains its original aspect ratio when rendered in the UI (HUD mode). If True, the image will scale to fit inside its RectTransform bounds without stretching, automatically centering itself within the available space.

__init__(texture_path, columns, rows)

Loads a spritesheet into GPU memory.

Parameters:

Name Type Description Default
texture_path str

The relative path to the image file.

required
columns int

The number of columns in the spritesheet grid.

required
rows int

The number of rows in the spritesheet grid.

required
Source code in foxvoid/__init__.pyi
552
553
554
555
556
557
558
559
560
561
def __init__(self, texture_path: str, columns: int, rows: int) -> None: 
    """
    Loads a spritesheet into GPU memory.

    Args:
        texture_path: The relative path to the image file.
        columns: The number of columns in the spritesheet grid.
        rows: The number of rows in the spritesheet grid.
    """
    ...

set_opacity(alpha)

Quickly modifies the transparency of the sprite.

Parameters:

Name Type Description Default
alpha float

A float between 0.0 (fully transparent) and 1.0 (fully opaque).

required
Source code in foxvoid/__init__.pyi
607
608
609
610
611
612
613
614
def set_opacity(self, alpha: float) -> None:
    """
    Quickly modifies the transparency of the sprite.

    Args:
        alpha: A float between 0.0 (fully transparent) and 1.0 (fully opaque).
    """
    ...

set_texture(path)

Safely unloads the current texture reference and loads a new one. Automatically resolves the given path through the engine's Asset Registry.

Parameters:

Name Type Description Default
path str

The relative path to the new image file (e.g., 'assets/textures/new_icon.png').

required
Source code in foxvoid/__init__.pyi
576
577
578
579
580
581
582
583
584
def set_texture(self, path: str) -> None:
    """
    Safely unloads the current texture reference and loads a new one.
    Automatically resolves the given path through the engine's Asset Registry.

    Args:
        path: The relative path to the new image file (e.g., 'assets/textures/new_icon.png').
    """
    ...

set_tint(r, g, b, a=255)

Sets the RGBA multiplication tint color for the sprite rendering. Values must be between 0 and 255. Default is pure white (255, 255, 255, 255), meaning no alteration.

Source code in foxvoid/__init__.pyi
599
600
601
602
603
604
605
def set_tint(self, r: int, g: int, b: int, a: int = 255) -> None:
    """
    Sets the RGBA multiplication tint color for the sprite rendering.
    Values must be between 0 and 255.
    Default is pure white (255, 255, 255, 255), meaning no alteration.
    """
    ...

set_visible(visible)

Instantly toggles the rendering of this sprite on or off without destroying the GameObject.

Source code in foxvoid/__init__.pyi
616
617
618
619
620
621
def set_visible(self, visible: bool) -> None:
    """
    Instantly toggles the rendering of this sprite on or off 
    without destroying the GameObject.
    """
    ...

TextInput

Bases: Component

An interactive text field. Captures keyboard input when clicked. Triggers on_gui_click() when the user presses 'Enter'.

Source code in foxvoid/__init__.pyi
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
class TextInput(Component):
    """
    An interactive text field. Captures keyboard input when clicked.
    Triggers on_gui_click() when the user presses 'Enter'.
    """
    text: str
    max_length: int
    font_size: int
    spacing: float

    text_color: 'Color'
    bg_color: 'Color'
    focused_bg_color: 'Color'

    def __init__(self) -> None: ...
    def is_focused(self) -> bool: ...

    def set_font(self, path: str) -> None:
        """
        Updates the font used by the text input.
        Example: self.input.set_font("assets/fonts/arial.ttf")
        """
        ...

set_font(path)

Updates the font used by the text input. Example: self.input.set_font("assets/fonts/arial.ttf")

Source code in foxvoid/__init__.pyi
1479
1480
1481
1482
1483
1484
def set_font(self, path: str) -> None:
    """
    Updates the font used by the text input.
    Example: self.input.set_font("assets/fonts/arial.ttf")
    """
    ...

TextRenderer

Bases: Component

Renders text either in the game world or attached to the screen (HUD).

Source code in foxvoid/__init__.pyi
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
class TextRenderer(Component):
    """
    Renders text either in the game world or attached to the screen (HUD).
    """

    text: str
    """The string of text to display. Supports line breaks (\\n)."""

    font_size: float
    """The size of the rendered text."""

    is_hud: bool
    """If True, renders in screen space (ignoring the camera). If False, renders in world space."""

    font_path: str
    """The path to the custom .ttf or .otf font file. Leave empty to use the default engine font."""

    def __init__(self) -> None:
        """Initializes a new TextRenderer."""
        ...

font_path instance-attribute

The path to the custom .ttf or .otf font file. Leave empty to use the default engine font.

font_size instance-attribute

The size of the rendered text.

is_hud instance-attribute

If True, renders in screen space (ignoring the camera). If False, renders in world space.

text instance-attribute

The string of text to display. Supports line breaks (\n).

__init__()

Initializes a new TextRenderer.

Source code in foxvoid/__init__.pyi
 999
1000
1001
def __init__(self) -> None:
    """Initializes a new TextRenderer."""
    ...

TileLayer

Represents a single layer of tiles within a TileMap.

Source code in foxvoid/__init__.pyi
863
864
865
866
867
868
869
870
871
872
873
class TileLayer:
    """Represents a single layer of tiles within a TileMap."""

    name: str
    """The display name of the layer."""

    is_visible: bool
    """Determines if the layer is currently rendered on screen."""

    is_solid: bool
    """Determines if the layer generates collision boxes for the physics engine."""

is_solid instance-attribute

Determines if the layer generates collision boxes for the physics engine.

is_visible instance-attribute

Determines if the layer is currently rendered on screen.

name instance-attribute

The display name of the layer.

TileMap

Bases: Component

Manages a grid-based tile map with multiple layers, multi-tileset support, and physics collision. Useful for level design and procedural generation.

Source code in foxvoid/__init__.pyi
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
class TileMap(Component):
    """
    Manages a grid-based tile map with multiple layers, multi-tileset support, 
    and physics collision. Useful for level design and procedural generation.
    """

    grid_width: int
    """The number of columns in the grid."""

    grid_height: int
    """The number of rows in the grid."""

    tile_spacing: int
    """The gap in pixels between each tile in the source textures."""

    def __init__(self) -> None:
        """Initializes a new TileMap with a default 'Background' layer."""
        ...

    def add_tileset(self, path: str) -> None:
        """
        Appends a new tileset texture from the specified file path.
        The tileset is assigned a specific range of Global IDs based on its size.
        """
        ...

    def clear_tilesets(self) -> None:
        """
        Clears all loaded tilesets and frees the associated texture memory.
        """
        ...

    def get_tilesets(self) -> List[Tileset]:
        """
        Returns a list of all currently loaded Tilesets. 
        Useful for retrieving the 'first_tile_id' ranges during procedural generation.
        """
        ...

    def resize(self, new_width: int, new_height: int) -> None:
        """
        Resizes the map grid while safely preserving existing tile data.
        """
        ...

    def add_layer(self, name: str) -> None:
        """
        Adds a new empty layer on top of the existing ones.
        """
        ...

    def get_tile(self, layer_index: int, x: int, y: int) -> int:
        """
        Returns the Global Tile ID at the given grid coordinates.
        Returns -1 if the tile is empty or if the coordinates are out of bounds.
        """
        ...

    def set_tile(self, layer_index: int, x: int, y: int, global_tile_id: int) -> None:
        """
        Sets the Global Tile ID at the given grid coordinates on a specific layer.
        Use -1 as the global_tile_id to erase a tile.
        """
        ...

    @overload
    def get_layer(self, index: int) -> Optional[TileLayer]:
        """
        Retrieves a layer by its numerical index (0 is the bottom layer).
        Returns None if the index is out of bounds.
        """
        ...

    @overload
    def get_layer(self, name: str) -> Optional[TileLayer]:
        """
        Retrieves a layer by its assigned name.
        Returns None if no layer with this name exists.
        """
        ...

grid_height instance-attribute

The number of rows in the grid.

grid_width instance-attribute

The number of columns in the grid.

tile_spacing instance-attribute

The gap in pixels between each tile in the source textures.

__init__()

Initializes a new TileMap with a default 'Background' layer.

Source code in foxvoid/__init__.pyi
915
916
917
def __init__(self) -> None:
    """Initializes a new TileMap with a default 'Background' layer."""
    ...

add_layer(name)

Adds a new empty layer on top of the existing ones.

Source code in foxvoid/__init__.pyi
945
946
947
948
949
def add_layer(self, name: str) -> None:
    """
    Adds a new empty layer on top of the existing ones.
    """
    ...

add_tileset(path)

Appends a new tileset texture from the specified file path. The tileset is assigned a specific range of Global IDs based on its size.

Source code in foxvoid/__init__.pyi
919
920
921
922
923
924
def add_tileset(self, path: str) -> None:
    """
    Appends a new tileset texture from the specified file path.
    The tileset is assigned a specific range of Global IDs based on its size.
    """
    ...

clear_tilesets()

Clears all loaded tilesets and frees the associated texture memory.

Source code in foxvoid/__init__.pyi
926
927
928
929
930
def clear_tilesets(self) -> None:
    """
    Clears all loaded tilesets and frees the associated texture memory.
    """
    ...

get_tile(layer_index, x, y)

Returns the Global Tile ID at the given grid coordinates. Returns -1 if the tile is empty or if the coordinates are out of bounds.

Source code in foxvoid/__init__.pyi
951
952
953
954
955
956
def get_tile(self, layer_index: int, x: int, y: int) -> int:
    """
    Returns the Global Tile ID at the given grid coordinates.
    Returns -1 if the tile is empty or if the coordinates are out of bounds.
    """
    ...

get_tilesets()

Returns a list of all currently loaded Tilesets. Useful for retrieving the 'first_tile_id' ranges during procedural generation.

Source code in foxvoid/__init__.pyi
932
933
934
935
936
937
def get_tilesets(self) -> List[Tileset]:
    """
    Returns a list of all currently loaded Tilesets. 
    Useful for retrieving the 'first_tile_id' ranges during procedural generation.
    """
    ...

resize(new_width, new_height)

Resizes the map grid while safely preserving existing tile data.

Source code in foxvoid/__init__.pyi
939
940
941
942
943
def resize(self, new_width: int, new_height: int) -> None:
    """
    Resizes the map grid while safely preserving existing tile data.
    """
    ...

set_tile(layer_index, x, y, global_tile_id)

Sets the Global Tile ID at the given grid coordinates on a specific layer. Use -1 as the global_tile_id to erase a tile.

Source code in foxvoid/__init__.pyi
958
959
960
961
962
963
def set_tile(self, layer_index: int, x: int, y: int, global_tile_id: int) -> None:
    """
    Sets the Global Tile ID at the given grid coordinates on a specific layer.
    Use -1 as the global_tile_id to erase a tile.
    """
    ...

Tileset

Represents a texture atlas loaded into a TileMap. Read-only.

Source code in foxvoid/__init__.pyi
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
class Tileset:
    """Represents a texture atlas loaded into a TileMap. Read-only."""

    @property
    def name(self) -> str:
        """The name of the tileset (usually the filename)."""
        ...

    @property
    def first_tile_id(self) -> int:
        """The starting Global ID for the first tile of this specific texture."""
        ...

    @property
    def tile_count(self) -> int:
        """The total number of tiles contained in this texture."""
        ...

    @property
    def columns(self) -> int:
        """The number of columns of tiles in this texture."""
        ...

columns property

The number of columns of tiles in this texture.

first_tile_id property

The starting Global ID for the first tile of this specific texture.

name property

The name of the tileset (usually the filename).

tile_count property

The total number of tiles contained in this texture.

Transform2d

Bases: Component

Component managing spatial position, rotation, and scale.

Source code in foxvoid/__init__.pyi
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
class Transform2d(Component):
    """Component managing spatial position, rotation, and scale."""

    position: Vector2 # Local position
    scale: Vector2    # Local scale
    rotation: float   # Local rotation
    z_index: int      # Local z-index order

    def __init__(self, x: float = 0.0, y: float = 0.0) -> None: 
        """Creates a new Transform2d component."""
        ...

    def get_global_position(self) -> Vector2:
        """Returns the true world position, taking all parent transforms into account."""
        ...

    def get_global_rotation(self) -> float:
        """Returns the true world rotation in degrees."""
        ...

    def get_global_scale(self) -> Vector2:
        """Returns the true world scale."""
        ...

    def get_global_z_index(self) -> int:
        """Returns the accumulated rendering order."""
        ...

    def set_global_position(self, target_global_pos: Vector2) -> None:
        """Moves the object to a world position by automatically calculating the required local position."""
        ...

    def set_global_rotation(self, target_global_rot: float) -> None:
        """Sets the world rotation by automatically calculating the required local rotation."""
        ...

    def set_global_scale(self, target_global_scale: Vector2) -> None:
        """Sets the world scale by automatically calculating the required local scale."""
        ...

__init__(x=0.0, y=0.0)

Creates a new Transform2d component.

Source code in foxvoid/__init__.pyi
325
326
327
def __init__(self, x: float = 0.0, y: float = 0.0) -> None: 
    """Creates a new Transform2d component."""
    ...

get_global_position()

Returns the true world position, taking all parent transforms into account.

Source code in foxvoid/__init__.pyi
329
330
331
def get_global_position(self) -> Vector2:
    """Returns the true world position, taking all parent transforms into account."""
    ...

get_global_rotation()

Returns the true world rotation in degrees.

Source code in foxvoid/__init__.pyi
333
334
335
def get_global_rotation(self) -> float:
    """Returns the true world rotation in degrees."""
    ...

get_global_scale()

Returns the true world scale.

Source code in foxvoid/__init__.pyi
337
338
339
def get_global_scale(self) -> Vector2:
    """Returns the true world scale."""
    ...

get_global_z_index()

Returns the accumulated rendering order.

Source code in foxvoid/__init__.pyi
341
342
343
def get_global_z_index(self) -> int:
    """Returns the accumulated rendering order."""
    ...

set_global_position(target_global_pos)

Moves the object to a world position by automatically calculating the required local position.

Source code in foxvoid/__init__.pyi
345
346
347
def set_global_position(self, target_global_pos: Vector2) -> None:
    """Moves the object to a world position by automatically calculating the required local position."""
    ...

set_global_rotation(target_global_rot)

Sets the world rotation by automatically calculating the required local rotation.

Source code in foxvoid/__init__.pyi
349
350
351
def set_global_rotation(self, target_global_rot: float) -> None:
    """Sets the world rotation by automatically calculating the required local rotation."""
    ...

set_global_scale(target_global_scale)

Sets the world scale by automatically calculating the required local scale.

Source code in foxvoid/__init__.pyi
353
354
355
def set_global_scale(self, target_global_scale: Vector2) -> None:
    """Sets the world scale by automatically calculating the required local scale."""
    ...

VBoxContainer

Bases: Component

Automatically aligns child UI elements vertically based on their RectTransforms. Perfect for lists, menus, and inventories.

Source code in foxvoid/__init__.pyi
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
class VBoxContainer(Component):
    """
    Automatically aligns child UI elements vertically based on their RectTransforms.
    Perfect for lists, menus, and inventories.
    """

    # Space between each child element in pixels
    spacing: float

    # Inner margins at the top and bottom
    padding_top: float
    padding_bottom: float

    # Forces horizontal alignment of children (0.0 = Left, 0.5 = Center, 1.0 = Right)
    horizontal_alignment: float

    def __init__(self) -> None: ...

Vector2

A 2D vector representing mathematical points or directions.

Source code in foxvoid/__init__.pyi
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
class Vector2:
    """A 2D vector representing mathematical points or directions."""
    x: float
    y: float

    def __init__(self, x: float = 0.0, y: float = 0.0) -> None:
        """Initializes the vector with the given x and y coordinates."""
        ...

    def __add__(self, other: 'Vector2') -> 'Vector2':
        """Adds another Vector2 to this one and returns a new Vector2."""
        ...

    def __sub__(self, other: 'Vector2') -> 'Vector2':
        """Subtracts another Vector2 from this one and returns a new Vector2."""
        ...

    def __mul__(self, scalar: float) -> 'Vector2':
        """Multiplies the vector by a scalar value and returns a new Vector2."""
        ...

    def __truediv__(self, scalar: float) -> 'Vector2':
        """Divides the vector by a scalar value and returns a new Vector2. Prevents division by zero."""
        ...

    def length(self) -> float:
        """Calculates and returns the magnitude (length) of the vector."""
        ...

    def distance_to(self, other: 'Vector2') -> float:
        """Calculates the exact distance between this vector and another Vector2."""
        ...

    def normalized(self) -> 'Vector2':
        """Returns a new Vector2 with a length of exactly 1.0 (maintaining the same direction)."""
        ...

    def __repr__(self) -> str:
        """Returns a string representation of the vector for debugging (e.g., 'Vector2(1.0, 2.5)')."""
        ...

__add__(other)

Adds another Vector2 to this one and returns a new Vector2.

Source code in foxvoid/__init__.pyi
152
153
154
def __add__(self, other: 'Vector2') -> 'Vector2':
    """Adds another Vector2 to this one and returns a new Vector2."""
    ...

__init__(x=0.0, y=0.0)

Initializes the vector with the given x and y coordinates.

Source code in foxvoid/__init__.pyi
148
149
150
def __init__(self, x: float = 0.0, y: float = 0.0) -> None:
    """Initializes the vector with the given x and y coordinates."""
    ...

__mul__(scalar)

Multiplies the vector by a scalar value and returns a new Vector2.

Source code in foxvoid/__init__.pyi
160
161
162
def __mul__(self, scalar: float) -> 'Vector2':
    """Multiplies the vector by a scalar value and returns a new Vector2."""
    ...

__repr__()

Returns a string representation of the vector for debugging (e.g., 'Vector2(1.0, 2.5)').

Source code in foxvoid/__init__.pyi
180
181
182
def __repr__(self) -> str:
    """Returns a string representation of the vector for debugging (e.g., 'Vector2(1.0, 2.5)')."""
    ...

__sub__(other)

Subtracts another Vector2 from this one and returns a new Vector2.

Source code in foxvoid/__init__.pyi
156
157
158
def __sub__(self, other: 'Vector2') -> 'Vector2':
    """Subtracts another Vector2 from this one and returns a new Vector2."""
    ...

__truediv__(scalar)

Divides the vector by a scalar value and returns a new Vector2. Prevents division by zero.

Source code in foxvoid/__init__.pyi
164
165
166
def __truediv__(self, scalar: float) -> 'Vector2':
    """Divides the vector by a scalar value and returns a new Vector2. Prevents division by zero."""
    ...

distance_to(other)

Calculates the exact distance between this vector and another Vector2.

Source code in foxvoid/__init__.pyi
172
173
174
def distance_to(self, other: 'Vector2') -> float:
    """Calculates the exact distance between this vector and another Vector2."""
    ...

length()

Calculates and returns the magnitude (length) of the vector.

Source code in foxvoid/__init__.pyi
168
169
170
def length(self) -> float:
    """Calculates and returns the magnitude (length) of the vector."""
    ...

normalized()

Returns a new Vector2 with a length of exactly 1.0 (maintaining the same direction).

Source code in foxvoid/__init__.pyi
176
177
178
def normalized(self) -> 'Vector2':
    """Returns a new Vector2 with a length of exactly 1.0 (maintaining the same direction)."""
    ...

is_pixel_art_mode()

Returns whether the engine is currently in pixel art mode.

Source code in foxvoid/__init__.pyi
41
42
43
def is_pixel_art_mode() -> bool:
    """Returns whether the engine is currently in pixel art mode."""
    ...

set_pixel_art_mode(enable)

Globally configures texture filtering. Call this BEFORE instantiating GameObjects with sprites. - True: Nearest-neighbor filtering (Sharp, blocky, perfect for pixel art). - False: Bilinear filtering (Smooth, interpolated edges).

Source code in foxvoid/__init__.pyi
31
32
33
34
35
36
37
38
def set_pixel_art_mode(enable: bool) -> None:
    """
    Globally configures texture filtering. 
    Call this BEFORE instantiating GameObjects with sprites.
    - True: Nearest-neighbor filtering (Sharp, blocky, perfect for pixel art).
    - False: Bilinear filtering (Smooth, interpolated edges).
    """
    ...