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 | |
__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 | |
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 | |
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 | |
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 | |
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 | |
is_playing()
Returns True if an animation is currently playing and not paused/stopped.
Source code in foxvoid/__init__.pyi
725 726 727 | |
pause()
Pauses the current animation. It can be resumed later.
Source code in foxvoid/__init__.pyi
713 714 715 | |
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 | |
resume()
Resumes a paused animation from where it left off.
Source code in foxvoid/__init__.pyi
717 718 719 | |
stop()
Stops the animation and resets it to the first frame.
Source code in foxvoid/__init__.pyi
721 722 723 | |
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 | |
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 | |
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 | |
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 | |
ButtonState
Represents the current interaction state of a Button component.
Source code in foxvoid/__init__.pyi
1145 1146 1147 1148 1149 | |
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 | |
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 | |
shake(intensity, duration)
Triggers a screen shake (intensity, duration)
Source code in foxvoid/__init__.pyi
858 859 860 | |
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 | |
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 | |
__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 | |
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 | |
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 | |
__init__(radius=25.0)
Initializes a CircleCollider with a given radius.
Source code in foxvoid/__init__.pyi
1513 1514 1515 1516 1517 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
Collision2D
Contains information about a physics collision event.
Source code in foxvoid/__init__.pyi
196 197 198 199 200 201 202 203 | |
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 | |
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 | |
__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 | |
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 | |
on_collision(collision)
Called when this object's collider intersects with another.
Source code in foxvoid/__init__.pyi
299 300 301 | |
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 | |
start()
Called once when the component is initialized.
Source code in foxvoid/__init__.pyi
291 292 293 | |
update(delta_time)
Called every frame for logic and physics.
Source code in foxvoid/__init__.pyi
295 296 297 | |
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 | |
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 | |
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 | |
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 | |
Debug
Source code in foxvoid/__init__.pyi
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
get_child_by_name()
Recursively searches for a child GameObject by its name.
Source code in foxvoid/__init__.pyi
79 80 81 | |
get_children()
Returns a list of all direct children attached to this object.
Source code in foxvoid/__init__.pyi
75 76 77 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
HttpResponse
Represents the result of an HTTP request.
Source code in foxvoid/__init__.pyi
1588 1589 1590 1591 1592 1593 | |
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 | |
__init__(texture_path='')
Initializes the ImageRenderer, optionally loading a texture immediately.
Source code in foxvoid/__init__.pyi
1372 1373 1374 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
Physics
Global physics engine.
Source code in foxvoid/__init__.pyi
1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 | |
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 | |
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 | |
__init__()
Initializes a PolygonCollider with a default triangle shape.
Source code in foxvoid/__init__.pyi
1497 1498 1499 1500 1501 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
__init__()
Initializes a new RectTransform with default centered values.
Source code in foxvoid/__init__.pyi
1347 1348 1349 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
__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 | |
set_opacity(alpha)
Sets the transparency of the sprite (0.0 to 1.0).
Source code in foxvoid/__init__.pyi
540 541 542 | |
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 | |
set_visible(visible)
Shows or hides the sprite.
Source code in foxvoid/__init__.pyi
544 545 546 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
clear_tilesets()
Clears all loaded tilesets and frees the associated texture memory.
Source code in foxvoid/__init__.pyi
926 927 928 929 930 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
__init__(x=0.0, y=0.0)
Creates a new Transform2d component.
Source code in foxvoid/__init__.pyi
325 326 327 | |
get_global_position()
Returns the true world position, taking all parent transforms into account.
Source code in foxvoid/__init__.pyi
329 330 331 | |
get_global_rotation()
Returns the true world rotation in degrees.
Source code in foxvoid/__init__.pyi
333 334 335 | |
get_global_scale()
Returns the true world scale.
Source code in foxvoid/__init__.pyi
337 338 339 | |
get_global_z_index()
Returns the accumulated rendering order.
Source code in foxvoid/__init__.pyi
341 342 343 | |
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 | |
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 | |
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 | |
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 | |
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 | |
__add__(other)
Adds another Vector2 to this one and returns a new Vector2.
Source code in foxvoid/__init__.pyi
152 153 154 | |
__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 | |
__mul__(scalar)
Multiplies the vector by a scalar value and returns a new Vector2.
Source code in foxvoid/__init__.pyi
160 161 162 | |
__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 | |
__sub__(other)
Subtracts another Vector2 from this one and returns a new Vector2.
Source code in foxvoid/__init__.pyi
156 157 158 | |
__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 | |
distance_to(other)
Calculates the exact distance between this vector and another Vector2.
Source code in foxvoid/__init__.pyi
172 173 174 | |
length()
Calculates and returns the magnitude (length) of the vector.
Source code in foxvoid/__init__.pyi
168 169 170 | |
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 | |
is_pixel_art_mode()
Returns whether the engine is currently in pixel art mode.
Source code in foxvoid/__init__.pyi
41 42 43 | |
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 | |