Cave Python API
(Based on Cave Engine v1.6.1)
A structured reference for scripting gameplay, scenes, components, assets, math, data, and engine systems in Python.
Quick Navigation
Welcome to the Cave Python API Reference. Here you will find the information you need to write Python scripts more efficiently for the engine.
If you are just getting started with Cave, we recommend following the First Steps getting started guide in the Learn quests first. If you are not familiar with Python yet, you will also find a full programming language guide in the same Learn section.
To help you navigate, the API is organized into three main categories: Main Reference, with scenes, entities, components, and the component classes used to compose entities; Miscellaneous, with engine utilities and supporting APIs; and Assets, with the asset reference for when you need direct access to those types. Use the cards below to jump through the API reference quickly.
Main Reference
The objects you use most while building gameplay: scenes, entities, components, and input events.
Core
Scene structure and the base entity/component model.
ClassScene
cave.Scene
Scene
cave.Scene
Represents a Cave Scene.
A Scene is the runtime container where gameplay happens. It owns the entities in the current level, menu, or playable area, and provides access to scene-wide state, queries, properties, and entity creation methods.
Use cave.getScene() to access the active scene.
CameraCameraType
"Camera" class Enumeration.
Adds an existing Entity to the Scene.
Draws a Debug Arrow in the 3D Space, from the origin to the target position. This is only visible while in the Editor, meaning that it won't appear in the Game's runtime (exported project).
Draws a Debug Circle in the 3D Space. This is only visible while in the Editor, meaning that it won't appear in the Game's runtime (exported project).
Draws a Debug Circle in the 3D Space. This is only visible while in the Editor, meaning that it won't appear in the Game's runtime (exported project).
Draws a Debug Cube in the 3D Space. This is only visible while in the Editor, meaning that it won't appear in the Game's runtime (exported project).
Draws a Debug Line in the 3D Space, from the origin to the target position. This is only visible while in the Editor, meaning that it won't appear in the Game's runtime (exported project).
Draws a Debug Point in the 3D Space. This is only visible while in the Editor, meaning that it won't appear in the Game's runtime (exported project).
Draws a Debug Sphere in the 3D Space. This is only visible while in the Editor, meaning that it won't appear in the Game's runtime (exported project).
Creates and returns a new Entity built from the given Entity Template.
You can use this method to do Collision queries using a Box (defined by the transform you pass).
You can use this method to do Collision queries using a Box (defined by the position, rotation and scale you pass).
You can use this method to do Collision queries using a Sphere (defined by the position and radius you pass).
Creates a new Entity by Copying an existing one.
Gets an Entity by its ID. Average Time Complexity is O(1), worst case is O(logN).
Gets and Entity by its Name. Time Complexity is O(N), so avoid using this too much!
Returns the Approximate Bounding Box of the Entire Scene, representing everything that is Visual in it.
Returns the Approximate Bounding Box of the Entire Scene, representing the Physics Colliders.
Gets the Scene's camera instance. This is the actual camera used by the Engine to render the Scene.
Returns the Data over that specific position on Screen, based on the currently Rendered Data on Screen.
Returns the getDataOver(...) using the Mouse Position.
Returns all Entities in the Scene.
Returns all Entities that inherits from a given Entity Template. Time Complexity is O(N).
Returns all Entities that have the given Component. Time Complexity is O(NC) where C is the Component count. Note: this is probably very slow...
Returns all Entities with this specific Name. Time Complexity is O(N).
Returns all Entities with this specific Property. Time Complexity is O(N). Note: since it uses Python to lookup this information, it may be slower than the Tags.
Returns all Entities with this specific Tag. Time Complexity is O(N).
Returns all Entities in the Scene. A Root Entity is an Entity without a Parent.
Returns all Entities with this specific Property. Time Complexity is O(N). Note: since it uses Python to lookup this information, it may be slower than the Tags.
Returns all Entities with this specific Tag. Time Complexity is O(N).
Checks if this Scene is the active one.
Checks if a specific Timeline is being played by its Asset name.
Creates a new Empty Entity.
Plays a specific Timeline (Cutscene) by its Asset name.
Queues an Entity to be removed and deleted from Scene.
ClassEntity
cave.Entity
Entity
cave.Entity
Represents an Entity in a Cave Scene.
Entities are scene-owned objects used to compose your game world. They can contain components, child entities, tags, custom properties, and an active state. Do not subclass or instantiate Entity directly, instead you should create entities through Scene methods or by instantiating Entity Templates.
To get the Entity owner of the component you're creating (if any), use self.entity. To get an Entity from the scene, once you get the scene itself, use scene.get('Entity Name').
CameraCameraType
"Camera" class Enumeration.
Activates the Entity in the given Scene.
Deactivates the Entity in the given Scene.
Same as isActive()
Returns the number of Children (not recursive) this Entity have.
Returns the first match in the Components list with this same given name. It will also search for the Python created Components.
Returns None if it's not templated or the Template Asset otherwise.
A fast (and cached) alternative to get the main Entity's Transform Component. This is better than using "get(...)" since it's cached.
Returns True if the Entity is Active. It being active means that it is actually being taken into account by the Engine's Systems (such as rendering, logic, physics, etc). A disabled Entity is almost the same as an Entity that 'doesn't exist'.
Checks to see if the Entity is scheduled to be Killed.
Checks if this Entity uses a Template or not. If you set "parentRecursive" to True, it will also recursively check its parents, since an Entity that is a Child of a Templated Scene might also be considered Templated.
Immediately adds this Entity to the killing queue, meaning that this Entity (and its children) will be completely killed and deleted by the end of the current frame. Due to how Cave works, calling this method won't immediately destroy the entity, so this internal queue is needed. You can use the method 'isAlive()' to check if the Entity is in the queue to be killed this frame or not.
Reloads the current Entity's template. You can pass None if the Entity already belongs to a Scene.
Instead of immediately killing the Entity, you may want to schedule for the Entity to automatically kill itself after a given amount of Seconds. Use this method for it.
Sets the Entity's activation state, equivalent to the activate/deactivate methods and that's why it requires the activation Scene.
Use this with CAUTION! It will brute force change the Entity ID. It may result into incorrect behaviours. This method is usually used internally.
Checks and fixes invalid Template, returns True if the Template was valid, False if it had to be fixed.
ClassComponent
cave.Component
Component
cave.Component
Base class for all Cave Components.
Custom Python components should inherit from this class. Components are attached to entities and can implement lifecycle methods such as start(), update(), lateUpdate(), pausedUpdate(), editorUpdate(), and end(). All base Component methods and variables are available to custom components.
To get a specific Component from an Entity, once youg et the entity reference, use entity.get('Name Of The Component').
CameraCameraType
"Camera" class Enumeration.
This method is meant for debug only. It will be called every frame while in the editor mode, even if the game is not being played. Never gets called on standalone (exported game) mode.
This is called once right after the component's owning Entity gets removed and/or deactivated from a given scene.
Called after all the component's owning Entity other components gets their start methods called. You can use this to late initialize stuff that relies on other component's initializations. It's garanteed that it will always be called after the other component's start and before any updates.
Returns the Entity currently owning this component. Same as the entity variable.
Called every frame if the scene IS paused.
Reloads the Component by calling its end() and then its start() methods. It only works if the Component's Entity already belongs to a Scene. Nothing will happen otherwise.
Meant for internal Cave use. Changing the owning Entity by this method may cause undefined behaviour.
This is called once right after the component's owning Entity gets added and/or activated to a given scene.
Called every frame if the scene IS NOT paused.
Components
Reusable gameplay, rendering, physics, audio, UI, and controller components.
ClassAnimationComponent
cave.AnimationComponent
AnimationComponent
cave.AnimationComponent
Used to animate a Mesh, given an Armature and an Animation. It supports animation blending, filtering and multiple stacked layers of concurrent animations being played and interpolated together.
Requires a valid Mesh Component in order to work properly.
TimelineChannelBlend
"Timeline" class Enumeration.
Adds a function pointer to be called after the Animation Component evaluates the Armature pose.
Enables Ragdoll Physics for this Armature. Note: EXPERIMENTAL FEATURE! Be aware that it may not function as expected.
Read back the ragdoll position from the Physics World and applies to the Armature. This is automatically called by the engine after Evaluating the Animation Pose, so you don't need to worry about calling it by hand.
ClassAnimationSocketComponent
cave.AnimationSocketComponent
AnimationSocketComponent
cave.AnimationSocketComponent
You can use this Component to copy a given Armature Bone's transform. It will attempt to copy that from its parent Entity.
TimelineChannelBlend
"Timeline" class Enumeration.
ClassAudioComponent
cave.AudioComponent
AudioComponent
cave.AudioComponent
ClassCameraComponent
cave.CameraComponent
CameraComponent
cave.CameraComponent
This Component, if enabled, will assign its current Transform and Settings to the main Scene Camera.
TimelineChannelBlend
"Timeline" class Enumeration.
ClassCharacterComponent
cave.CharacterComponent
CharacterComponent
cave.CharacterComponent
Provides a basic but functional Character Physics behaviour for you to use.
Ideal for your Player, Enemies, NPCs and other character-like entities.
UIElementComponentStatus
"UIElementComponent" class Enumeration.
Returns True if the Character collided with any other Entity in the Scene that contains the given tag.
Returns a list with all the collision between the owning Entity and others. It could contain multiple collisions between the same Entities.
Returns a list with all the collision between the owning Entity and others that contains the given tag. It could contain multiple collisions between the same Entities.
Returns the gravity direction and force added together (as the length of the vector).
Applies any changes you made to the gravity or gravityDirection to the Character Physics itself. You don't need to call this every frame, only when you update the gravityDirection.
ClassEditorComponent
cave.EditorComponent
EditorComponent
cave.EditorComponent
This is a Subclass of the Component class that is meant for you to override (Python) and create Editor Tools that are component level.
When you add an editor component, it will run like any other Components, except that it will also run while in the Editor (without the game enabled). Its editorUpdate method will also be called.
If you want to write custom Interfaces for it, override the updateInterface method. To initialize persistent variables, either use the Entity's properties OR create an __init__ method.
Called when the Component's Interface tab is being rendered (Editor). You can safely use cave.ui functions here to draw custom Interfaces.
ClassFirstPersonCamComponent
cave.FirstPersonCamComponent
FirstPersonCamComponent
cave.FirstPersonCamComponent
ClassLightComponent
cave.LightComponent
LightComponent
cave.LightComponent
Provides Point Light Settings to light the scene.
TimelineChannelBlend
"Timeline" class Enumeration.
ClassLogicBricksComponent
cave.LogicBricksComponent
LogicBricksComponent
cave.LogicBricksComponent
TimelineChannelBlend
"Timeline" class Enumeration.
ClassMeshComponent
cave.MeshComponent
MeshComponent
cave.MeshComponent
The Mesh Component is the main renderable in the Engine.
If you want to render anything into the world, that's probably the component you want.
It takes a Mesh, a Material and a Tint Color (optional) to render.
TimelineChannelBlend
"Timeline" class Enumeration.
ClassMeshProxyComponent
cave.MeshProxyComponent
MeshProxyComponent
cave.MeshProxyComponent
Creates a Proxy Mesh from a given set of Mesh Components (experimental).
This is meant to be used as an Optimization method for heavy scenes with a lot of small objects that can be batched together when being rendered from a distance to reduce draw calls.
MeshProxyComponentPassMask
"MeshProxyComponent" class Enumeration.
ClassMouselookComponent
cave.MouselookComponent
MouselookComponent
cave.MouselookComponent
Provides a simple Mouselook implementation to your Entity.
ThirdPersonCamComponentAlignPlayerRule
"ThirdPersonCamComponent" class Enumeration.
ClassParticleComponent
cave.ParticleComponent
ParticleComponent
cave.ParticleComponent
Renders Particles to the Scene.
MeshProxyComponentPassMask
"MeshProxyComponent" class Enumeration.
ClassPathComponent
cave.PathComponent
PathComponent
cave.PathComponent
A graph-based path system component that stores 3D points connected by edges (straight lines or Bezier curves). Provides navigation, pathfinding, and sampling functionality for AI, procedural generation, and gameplay mechanics.
MeshProxyComponentPassMask
"MeshProxyComponent" class Enumeration.
Reassigns edge directions in a forest to minimize multiple edges pointing toward or away from the same node.
Deletes all Points and Edges of the Path.
Finds the shortest path between two points using A* pathfinding algorithm. Uses edge lengths as costs and Euclidean distance as heuristic. Returns list of point IDs.
Generates a new path by offsetting each edge of the original path to both left and right sides by the specified width, preserving connectivity at intersections where edges meet.
Finds the closest point on a specific edge to a given world position. More efficient than full path search when you know the relevant edge.
Finds the closest point on the entire path to a given world position. Returns a PathQueryResult with the closest point, which edge/pathpoint it belongs to, parametric value, and distance.
Returns separate disconnected graph sections. Each component is a list of point IDs that are connected to each other but isolated from other components.
Gets the normalized direction vector at any point along an edge. Parameter t ranges from 0.0 (start) to 1.0 (end). Handles both straight lines and Bezier curves.
Returns the cumulative distance along the path to the closest point from a world position. Useful for tracking progress along a route.
Calculates the length of a specific edge. For straight lines, returns Euclidean distance. For Bezier curves, uses numerical integration with bezierResolution subdivisions.
Gets a normal vector perpendicular to the path direction at a specific point. Uses up vector as reference, switching to forward if path is vertical.
Calculates tight bounding box of the entire path in world space. Includes all points and accurately accounts for Bezier curve extents.
Calculates the total length of all edges in the path. Uses caching for performance - result is cached until path structure changes.
Walks along connected edges from a start point for a specified distance. Returns the position and details of where the distance ends along the path.
You can use this to make the character walk the path. It walks or backward if advance is negative) along the path by the specified distance, starting from the closest point.
Finds the shortest path and generates detailed samples along each edge. Combines pathfinding with sampling to provide positions, directions, and distances.
Gets the tangent (direction) vector at a specific point along an edge. Same as getDirectionAtPoint - provides normalized forward vector.
Fast connectivity check using breadth-first search to determine if one point can reach another following edge connections and directional constraints.
Merges points that are within the specified distance of each other
Generates evenly spaced samples along a specific edge. Handles both straight lines and Bezier curves with accurate interpolation.
Generates evenly spaced samples along the entire path. Each sample includes position, direction, normal vector, and cumulative distance from start.
ClassPhysicsConstraintComponent
cave.PhysicsConstraintComponent
PhysicsConstraintComponent
cave.PhysicsConstraintComponent
ClassPlayerComponent
cave.PlayerComponent
PlayerComponent
cave.PlayerComponent
Provides a basic Player Controller component. Given a Character Component, moves it with W,A,S,D and jumps with Space (optionally).
If you need more control, consider writting your own controller in Python.
ThirdPersonCamComponentAlignPlayerRule
"ThirdPersonCamComponent" class Enumeration.
ClassPythonCodeComponent
cave.PythonCodeComponent
PythonCodeComponent
cave.PythonCodeComponent
The Python Code Component allows you to write small python code snippets for local usage.
It's similar to the PythonComponent, except that you don't have to create an entire class (it handles that for you).
The downside is that it's not as reusable as the PythonComponent.
PythonCodeComponentOptimizationPolicy
"PythonCodeComponent" class Enumeration.
ClassPythonComponent
cave.PythonComponent
PythonComponent
cave.PythonComponent
Main Python Component class. Allows you to create your own custom components (in Python).
Notice that this is a wrapper to your components and you should NOT inherit from this when writting them (inherit from cave.Component instead).
ClassRigidBodyComponent
cave.RigidBodyComponent
RigidBodyComponent
cave.RigidBodyComponent
General Purpose Physics Component. It can be used for Static (non movable) or Dynamic (movable) Entities.
It handles Gravity, collision detection and resolution and so on.
RigidBodyShape
Returns True if the Rigid Body collided with any other Entity in the Scene that contains the given tag.
Returns a list with all the collision between the owning Entity and others. It could contain multiple collisions between the same Entities.
Returns a list with all the collision between the owning Entity and others that contains the given tag. It could contain multiple collisions between the same Entities.
A Static (non movable) body have ZERO mass. Any value greater than that means that the Body is Dynamic (movable). You can also use this information to toggle between static and dynamic.
ClassStateMachineComponent
cave.StateMachineComponent
StateMachineComponent
cave.StateMachineComponent
This is meant to be used in order to properly run a State Machine (Asset) to a given Entity.
PythonCodeComponentOptimizationPolicy
"PythonCodeComponent" class Enumeration.
ClassTerrainChunk
cave.TerrainChunk
TerrainChunk
cave.TerrainChunk
Component Class used internally by the Terrain Component to render the diffent Chunks (Components) that composes the actual Terrain. You should not have to worry about this yourself.
PythonCodeComponentOptimizationPolicy
"PythonCodeComponent" class Enumeration.
ClassTerrainComponent
cave.TerrainComponent
TerrainComponent
cave.TerrainComponent
This Component handles Terrain Rendering and Physics based on a Height Map.
PythonCodeComponentOptimizationPolicy
"PythonCodeComponent" class Enumeration.
Creates a new Height Map texture to be used by the Component. It's done by using cave.random.terrain() function plus some erosion steps.
Raycasts the Terrain and returns the position and normal of the hit (if any).
ClassThirdPersonCamComponent
cave.ThirdPersonCamComponent
ThirdPersonCamComponent
cave.ThirdPersonCamComponent
ThirdPersonCamComponentAlignPlayerRule
"ThirdPersonCamComponent" class Enumeration.
ClassTopDownCamComponent
cave.TopDownCamComponent
TopDownCamComponent
cave.TopDownCamComponent
ThirdPersonCamComponentAlignPlayerRule
"ThirdPersonCamComponent" class Enumeration.
ClassTransformComponent
cave.TransformComponent
TransformComponent
cave.TransformComponent
ClassUIElementComponent
cave.UIElementComponent
UIElementComponent
cave.UIElementComponent
Cave's User Interface (UI) Element. This is meant to be renderer to de screen as an UI in order to create texts, boxes, images, buttons or any other element you want.
It also handles anchoring and PARENTING for you, meaning that it will take parent UIElements into account and will affect child ones.
UIElementComponentStatus
"UIElementComponent" class Enumeration.
ClassVehicleComponent
cave.VehicleComponent
VehicleComponent
cave.VehicleComponent
RigidBodyShape
Manually sets the Wheel Steering. It will automatically e clamped by the maximum steering defined.
This needs to be called while the Vehicle is not steering in order to make the Wheels turn straight again.
ClassVehicleControllerComponent
cave.VehicleControllerComponent
VehicleControllerComponent
cave.VehicleControllerComponent
ClassWheelComponent
cave.WheelComponent
WheelComponent
cave.WheelComponent
RigidBodyShape
If enabled, it will be able to turn.
Events
Event helpers plus the keyboard, mouse, and controller constants in cave.event.
ClassEvents
cave.Events
Events
cave.Events
ClassEventsJoystick
cave.EventsJoystick
EventsJoystick
cave.EventsJoystick
cave.event
Python Stub File for the Cave Engine's EVENT API
The code here is available at cave.event. submodule
This is intended to be used with cave.getEvents()
Controller (Joystick):
Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button
Xbox Elite paddle P1 (upper left, facing the back)
Xbox Elite paddle P3 (upper right, facing the back)
Xbox Elite paddle P2 (lower left, facing the back)
Xbox Elite paddle P4 (lower right, facing the back)
PS4/PS5 touchpad button
0
1
2
3
4
5
6
7
8
9
A
Ac Back
Ac Bookmarks
Ac Forward
Ac Home
Ac Refresh
Ac Search
Ac Stop
Again (Redo)
Alterase
Ampersand
Application / Compose / Context Menu (Windows) Key
Asterisk
At
Mute Volume
Next Track
Play Media
Previous Track
Stop Media
B
Backquote
Backslash
Backspace
Brightnessdown
Brightnessup
C
Calculator
Cancel
Capslock
Caret
Clear
Clearagain
Colon
Comma
Computer
Copy
Crsel
Currencysubunit
Currencyunit
Cut
D
Decimalseparator
Delete
Displayswitch
Dollar
Down
E
Eject
End
Equals
Escape
Exclaim
Execute
Exsel
F
F1
F10
F11
F12
F13
F14
F15
F16
F17
F18
F19
F2
F20
F21
F22
F23
F24
F3
F4
F5
F6
F7
F8
F9
Find
G
Greater
H
Hash
Help
Home
I
Insert
J
K
Kbdillumdown
Kbdillumtoggle
Kbdillumup
Keypad 0
Keypad 00
Keypad 000
Keypad 1
Keypad 2
Keypad 3
Keypad 4
Keypad 5
Keypad 6
Keypad 7
Keypad 8
Keypad 9
Keypad A
Keypad Ampersand
Keypad At
Keypad B
Keypad Backspace
Keypad Binary
Keypad C
Keypad Clear
Keypad Clear Entry
Keypad Colon
Keypad Comma
Keypad D
Keypad Dblampersand
Keypad Dblverticalbar
Keypad Decimal
Keypad Divide
Keypad E
Keypad Enter
Keypad Equals
Keypad Equalsas400
Keypad Exclam
Keypad F
Keypad Greater
Keypad Hash
Keypad Hexadecimal
Keypad Leftbrace
Keypad Leftparen
Keypad Less
Keypad Memadd
Keypad Memclear
Keypad Memdivide
Keypad Memmultiply
Keypad Memrecall
Keypad Memstore
Keypad Memsubtract
Keypad Minus
Keypad Multiply
Keypad Octal
Keypad Percent
Keypad Period
Keypad Plus
Keypad Plusminus
Keypad Power
Keypad Rightbrace
Keypad Rightparen
Keypad Space
Keypad Tab
Keypad Verticalbar
Keypad Xor
L
Left Alt
Left Ctrl
Left
Left Bracket "{"
Left Parenthesis "("
Less
Lgui
Left Shift
M
Media Select
Menu
Minus
Mode
Mute
N
Num Lock Clear
O
Oper
Out
P
Page Down
Page Up
Paste
Pause
Percent
Period
Plus
Power
Print Screen
Prior
Q
Question
Quote
Quotedbl
R
Right Alt
Right Ctrl
Return
Return2
Rgui
Right
Right Bracket "}"
Right Parenthesis ")"
Right Shift
S
Scroll Lock
Select
Semicolon
Separator
Size
Slash
Sleep
Space
Stop
Sysreq
T
Tab
Thousands Separator
U
Undo
Unknown
Up
V
Volume Down
Volume Up
W
Www
X
Y
Z
Left Mouse Button
Middle Mouse Button
Right Mouse Button
Miscellaneous
Utility APIs for math, data, random numbers, networking, Steam, file paths, windows, and editor helpers.
Engine Utils
Root cave functions, constants, and enumerations.
AnimationInterpolation
PhysicsConstraintType
RigidBodyShape
ShaderLocations
The ShaderLocations enum specifies where to bind each Texture in the main render pass. It's used internally by the engine.
ShaderProgramMacros
UIEntityPresets
Creates a new Material Asset and adds it to the Engine's Asset Data Subsystem. Returns the newly created Material.
Creates a new Mesh Asset and adds it to the Engine's Asset Data Subsystem. Returns the newly created Mesh.
Creates a new ImageTexture Asset and adds it to the Engine's Asset Data Subsystem. Returns the newly created ImageTexture.
Given a Text, copies it to the OS Clipboard.
Multisample Anti-Aliasing (MSAA):
Returns true if the given string ends with the provided 'ending'.
Returns true if the given string ends with one of the the provided 'endings' in the list.
Givem a number of bytes, formats it as a String with the appropriate (and best match) measurements: B, KiB, MiB, GiB, TiB.
Formats the given float number as a string, only keeping the specified number of digits of the fraction (and discarding the rest).
Formats the given integer number as a string, adding dots after each 3 characters (right to left).
Formats the given integer number as a string, adding dots after each 3 characters (right to left).
Formats a given time in Ns to ms, only keeping two digits of the fraction.
Returns the base Path of where the application was launched. Could be the Editor path OR the Player path depending if you're on runtime or not.
Returns the default path that the Cave Editor uses to serialize common stuff. Plus the localPath you provide.
Returns the Absolute path from the Editor's location + the localPath you provide.
Given a full path, extracts the filename.
Returns a list of all files at the given path (from the Asset Browser). Folders always ends with "/". It must always start at "Content/".
Get the current FPS thast the game is running at
Returns the Game's current path + the localPath
This dictionary is persistent during the entire gameplay
Returns the index of the first invalid character found in the path string or npos if none.
If enabled, Cave will try to limit the FPS to the MaxFPS.
Get the Max FPS allowed. This won't have any effect if the FPS Limiter is disabled.
This one takes the Editor UI into account and is always like the UI Elements!
Returns a list with all Regex matches in the source string, given the Regex pattern.
Returns the default recommended OS Path that is typically used to save local user data. On Windows, its %%AppData%%, on Linux, its HOME, etc. Plus the localPath you provide.
If V-Sync is enabled, the FPS won't be higher than it.
Returns True if cave is in Editor mode, False if it's a standalone game!
Imports all the Default Assets (the ones you see when you create a new Project, such as the Default Cube, Material, etc) into the Project.
Returns True if MSAA is enabled. Note: if MSAA is enabled but not supported, it won't work.
Returns True is MSAA is supported in the current machine.
Returns True if the game is currently being played in the editor. It's always true on standalone.
Returns True if all characters in the 'path' string are valid characters that can be used as a System filepath. If not fullPath, it will return False if it has '\' or '/'.
Allows you to outputs a given message to Cave's Editor Console but with more control over it, such as the message Title and if you want to supress it in the exported game or not. If you choose to NOT supress, it will show in the Exported game as an Info Modal (using the OS's api).
Given the message, outputs it to the Cave's Editor Console. If the game is exported (so there is no Editor), it will not show anything.
Helper function to create a new Empty Entity (meaning an Entity with a Transform). It does not add it to anything and it's up to you to handle it.
Internal Usage.
Helper function to create a new Light Entity (meaning an Entity with a Transform + Light Component). It does not add it to anything and it's up to you to handle it.
Helper function to create a new Mesh Entity (meaning an Entity with a Transform + Mesh Component) and will set the Mesh to the one you pass as a parameter. It does not add it to anything and it's up to you to handle it.
Creates a new Script (string) with the default new Script text (with the Component definition, etc) and sets the component name to the one you provide as a parameter. Returns the result as a string.
Same as the newScript, except that it will create the default DebugTab code instead of the Component one.
Executes a new Standalone and Independent Application given its path. This Application doesn't need to be related to Cave.
Opens the given URL in the user's default web browser.
Imports again all the default Meshes.
Removed Special characters (that are not supported in most OS as file names) from the input fileName.
Set the Max FPS allowed. This won't have any effect if the FPS Limiter is disabled.
Internal Usage.
Internal Usage.
Returns true if the given string starts with the provided 'prefix'.
Math
Vector, matrix, quaternion, constants, and math utility functions.
ClassIntVector2
cave.IntVector2
IntVector2
cave.IntVector2
[x,y] or [s,t] or [u,v] are equivalents!
ClassIntVector3
cave.IntVector3
IntVector3
cave.IntVector3
[x,y,z] or [r,g,b] are equivalents!
ClassIntVector4
cave.IntVector4
IntVector4
cave.IntVector4
[x,y,z,w] or [r,g,b,a] are equivalents!
ClassVector2
cave.Vector2
Vector2
cave.Vector2
[x,y] or [s,t] or [u,v] are equivalents!
ClassVector3
cave.Vector3
Vector3
cave.Vector3
[x,y,z] or [r,g,b] are equivalents!
ClassVector4
cave.Vector4
Vector4
cave.Vector4
[x,y,z,w] or [r,g,b,a] are equivalents!
ClassQuaternion
cave.Quaternion
Quaternion
cave.Quaternion
cave.math
Python Stub File for the Cave Engine's MATH API
The code here is available at cave.math. submodule
Vector3( 0.0, 0.0,-1.0)
PI / 180.0
Vector3( 0.0,-1.0, 0.0)
Vector3( 0.0, 0.0, 1.0)
1.5707963267948966
Vector3( 1.0, 0.0, 0.0)
3.141592653589793
180.0 / PI
Vector3(-1.0, 0.0, 0.0)
6.283185307179586
Vector3( 0.0, 1.0, 0.0)
Clamps the euler angle, works with negative eulers too!
Bezier:
Same as the closestPointOnTriangle, except that it returns the Barycentric coordinates to that closest point related to the triangle instead.
Returns t and the distance between the closest point and the given point.
Given a pos and a line segment (a,b), returns the closest point within this line segment to that given pos.
Same as getClosestPointOnLine, except that it returns two values with how much of each point (a, b) needs to be added together to result in the closest point.
Given a pos and a triangle (a,b,c), returns the closest point within this triangle to that given pos.
AABB and Bounding Box:
Returns a list of tuples containing the intersection positions and normals!
Regular Lerpings:
Quaternion Lerpings:
Ease Lerpings:
Euler Lerpings:
Quadric Lerpings:
Deprecated:
Returns the angle in range [0, 360]
Projects a direction vector onto the plane of the given triangle.
Converts Radians to Euler Angles (same as toEuler)
Converts Radians to Euler Angles
Converts Euler Angles to Radians
Random
Random number and choice helpers.
cave.random
Given a list, choices a random element from it and returns it.
Randomly shuffles the given list, randomizing the elements order.
Networking
Client, server, package, and peer communication APIs.
cave.network
ClassClient
cave.network.Client
Client
cave.network.Client
Client class that allows you to connect to a Cave or Enet Server, sending and receiving, reliable or unreliable, messages over network.
Creates the client and starts the attempt to connect to the provided Server (by the address and port).
Returns True if the Client successfully managed to connect to the provided server. A valid Client may still return False here while it is attempting to connect, since this relies on the internet connection and many other factors to successfully connect to the Server. You should handle this "waiting to Connect..." time in your Game code.
Returns True if the Client host is valid. If it's false, it means that there was some internal network error that caused it to fail to create the host and/or sockets.
Returns a list of all cave.network.Package received from the Server since the last time you called this method.
Given a Package, sends it to the server. If reliable is set to True, it will guarantee that the Package arrives to the server. If not, it will simply send it once and that's it. Please notice that, due to how internet works, reliable packages are considerably slower.
For the Client to function properly, you **MUST** call this once at the end of every frame.
ClassPackage
cave.network.Package
Package
cave.network.Package
Package class that allows you to pack regular data into a network friendly binary format by writting the data to it and/or unpack this same data by reading from it.
If you need to know more about the internal format, here is the explanation: For each data, it first writes the data type as a `char`, then the data itself. The package does not have any header or extra data other than the one you write to it.
networkPackageDataType
"Package" class Enumeration, specifies the supported data types. This is usually handled by you automatically by the Package methods.
networkPackagePackageMode
"Package" class Enumeration that specifies if the Package is set to Read or Write mode. Only the corresponding read/write methods will work.
Default Package constructor. It sets the Package mode to WRITE by default, unless you pass True as a parameter (for readMode), then it will be set to READ.
Returns the size of the current Read/Write buffer of the Package.
If the mode is set to READ, returns the next data type about to be read. Returns TYPE_INVALID, otherwise.
Reads a 32 bit integer from the Package.
Reads a 64 bit unsigned integer (size_t) from the Package.
Reads a regular string from the Package.
Writes a 32 bit integer into the Package. Note that python integers may be higher than 32 bits and it will cause an error.
Writes a 64 bit unsigned integer (size_t) to the Package.
Writes a regular string to the Package. If it's important for you to know it internally, it will write the TYPE_STRING, followed by the string length N and then N char representing the string itself.
ClassPackageException
cave.network.PackageException
PackageException
cave.network.PackageException
ClassServer
cave.network.Server
Server
cave.network.Server
The main Cave's Network Server class that allows you to open a Server that Cave (or Enet) Clients can connect to, sending and receiving, reliable or unreliable, messages over network.
Creates the Server and binds it to the provided address and port number. You can use "localhost" (default) address to make the Server visible to the machine currently running it only or "0.0.0.0" to make it visible to the entire network.
Returns a list of all connected cave.network.ServerPeer (Clients).
Returns True if this Server is valid. If False, something wrong happened when creating it and it won't function at all.
Returns a list of all cave.network.ServerPackage received from the Clients (Peers) since the last time you called this method.
Given a Package, sends it to ALL connected Peers (Clients). As of in all other sending methods, you can also choose if you want this to be reliable or not.
For the Server to function properly, you **MUST** call this once at the end of every frame.
ClassServerPackage
cave.network.ServerPackage
ServerPackage
cave.network.ServerPackage
When receiving Packages in the Server, since they can arrive from multiple different Peers, they get wrapped around this ServerPackage class to properly identify its sender (origin).
networkPackageDataType
"Package" class Enumeration, specifies the supported data types. This is usually handled by you automatically by the Package methods.
ClassServerPeer
cave.network.ServerPeer
ServerPeer
cave.network.ServerPeer
When a Client connects to a Cave Server, it is considered by the server as a Peer and this is the class that handles it.
Returns the Peer's Address, usually represented by its ip + port, e.g.: "123.123.1.7:33333".
Returns the Peer's host name (IP) as a string.
Returns the Peer's port number.
Sends the given Package to this Peer alone, allowing the Server to directly communicate to a single Client. If reliable is set to True, it will guarantee that the Package arrives to the server. If not, it will simply send it once and that's it. Please notice that, due to how internet works, reliable packages are considerably slower.
Steam
Steam platform integration helpers.
cave.steam
Due to Steamworks SDK TOS, Cave can't publicly redistribute Steam APIs, so in order to use
Cave Engine's Steam Integration, make sure you first:
- Have a valid Steamworks Account with a valid App and APPID (https://partner.steamgames.com/)
- Have downloaded the Steamworks SDK: https://partner.steamgames.com/doc/sdk
- Understand how the Steam API works: https://partner.steamgames.com/doc/sdk/api
After that, you will need to extract the steam_api64.dll (Windows) or libsteam_api.so (Linux)
into the same folder that Cave is located. Then Cave should be able to dinamically load the
SDK and enable the APIs bellow for you. If you don't, they will silently fail to execute.
Please read and refer to Steamworks SDK Documentation to better understand it. Cave's Integration
was built on top ot Steamworks SDK v1.6.1 and it simplifies it a bit. If you miss certain
functionality from the SDK, please contact us and explain which functionality you want and
the use case for it.
IMPORTANT (from Steam Docs):
The Steamworks API will not initialize if it does not know the App ID of your game.
When you launch your app from Steam itself then it will automatically have the App ID available.
While developing you will need to hint this to Steam with a text file. Create the a text file called
"steam_appid.txt" next to your executable containing just the App ID and nothing else.
This overrides the value that Steam provides. You should not ship this with your builds.
You can use the App ID "480" for testing purposes. Good to read:
https://partner.steamgames.com/doc/features/achievements/ach_guide
For Cave Engine, the "steam_appid.txt" should be located at the same directory as the engine, not
your project directory. This is due to how Steam API works and can't be changed.
Returns the current user's Steam name.
Initializes Steam and setup everything for you. You MUST call this before starting to use the other interfaces. You only need to call this once, unless you shut it down.
Checks if the Steam API was initialized (init) and the SDK (dll/so) was loaded properly.
Checks if your executable was launched through Steam and relaunches it through Steam if it wasn't. This is optional but highly recommended as the Steam context associated with your application (including your App ID) will not be set up if the user launches the executable directly. If you choose to use this then it should be the first Steamworks function call you make, right before cave.steam.init. If it returns true, you should consider quitting the game since Steam will already reopen it.
When you are done using the Steamworks API you should call shutdown to release the resources used by your application internally within Steam. You should call this during process shutdown if possible, when you're about to close the game'.
Data
Asset file, folder, package, and content database helpers.
cave.data
Deletes the given Asset or Folder if it exists and returns True. False on failure. Root must be Content/.
Checks if a file (or folder) exists. Root must be Content/.
Returns the AssetFile for that specific Asset. None if it doesn't exist or if it's a Folder. Root must be Content/.
Returns the AssetFile for that specific folder. None if it doesn't exist or if it's an Asset. Root must be Content/.
Returns the Root folder. All sources are inside if it. The root Path is "Content/".
Creates the specified Asset and returns it. Creates the Path if it doesn't exist. Returns None if that path is an Asset or invalid. Root must be Content/.
Creates the specified Folder and returns it. Works recursively (if none of the folders exist), also works if the folder path already exists. Returns None if that path is an Asset. Root must be Content/.
ClassAssetData
cave.data.AssetData
AssetData
cave.data.AssetData
ClassAssetFile
cave.data.AssetFile
AssetFile
cave.data.AssetFile
In Cave, every Asset from the Asset Data, in order to appear in the Asset Browser, have an 1-1 connection to an AssetFile (you can access it from the Asset's debug.handler property).
The AssetFile may not be connected to any Asset as well. In this case, it will be considered a Folder and could have Child Asset Files. Everything you see in the Asset Browser is just Asset Files, including the Assets itself. In this case, the Asset Files are mapped to the actual Assets, as explained.
Asset Files can be Exported as a Cave Package, hence why you'll see the Package Descriptor API near by.
It will organize all the children into folders by type.
Will move all the folder content to its parent. Does nothing if this is not a folder or don't have a parent. Returns True on success.
Exports the asset (recursively, if it's a folder) into a standalone Cave Package that can be later imported into another project. If the 'all' parameter is True, it will also save the asset datas itself.
Use this to get the actual Asset class instance that this AssetFile represents (if it's an Asset). If it's a Folder, it will return None.
Returns True if this Asset File is mapped to an actual Asset.
Returns True if the corresponding Asset (or Folder) needs to be Serialized (Saved).
Returns True if this Asset File is a folder (meaning that it could have Child Asset Files and that it is not mapped to an actual Asset).
An Orphan AssetFile is a corrupted file that was meant to be an Asset, but lost its references. This is not supposed to happen and if it does, it probably means that your project files got messed up.
It will sort the children by name, then by type.
ClassAssetMap
cave.data.AssetMap
AssetMap
cave.data.AssetMap
ClassCavePackageDescriptor
cave.data.CavePackageDescriptor
CavePackageDescriptor
cave.data.CavePackageDescriptor
As the name suggests, its a Descriptor class used by Cave to store Cave Package specific information, meant to be used when exporting/importing a Package. Internal Use.
Who made the Package.
Creation/Export date of the Package.
Description of the Package.
The Package name.
An Asset Handler for a Texture to be used as the Package Thumbnail. Note: This will not be saved/loaded as a regular Handler!
A direct pointer to the loaded Thumbnail Texture. This will not be serialized and not freed! (up to you), it's here to store the thumbnail when package is loaded.
Assets
Asset classes and the remaining lower-level types used by Cave Engine systems.
Main Assets
The primary asset types used directly in Cave projects.
ClassEntityTemplate
cave.EntityTemplate
EntityTemplate
cave.EntityTemplate
ClassPythonScript
cave.PythonScript
PythonScript
cave.PythonScript
LogicBricksException
"LogicBricks" class Enumeration.
ClassStateMachine
cave.StateMachine
StateMachine
cave.StateMachine
Allows you to create Hierarchical State Machines (HSM) for custom game logics to your Entity. Ideal for NPCs, AI agents, etc. Use this in combination with Components to get the best out of the System.
SourceCodeSourceType
"SourceCode" class Enumeration.
ClassTexture
cave.Texture
Texture
cave.Texture
ShaderLocations
The ShaderLocations enum specifies where to bind each Texture in the main render pass. It's used internally by the engine.
ClassMaterial
cave.Material
Material
cave.Material
Material class is used to define the visuals for any given Mesh.
It allows you to specify custom colors, textures, settings and Shaders to render the Meshes.
AnimationInterpolation
ClassShaderProgram
cave.ShaderProgram
ShaderProgram
cave.ShaderProgram
ShaderLocations
The ShaderLocations enum specifies where to bind each Texture in the main render pass. It's used internally by the engine.
ClassUIStyle
cave.UIStyle
UIStyle
cave.UIStyle
AnimationInterpolation
ClassPostProcessing
cave.PostProcessing
PostProcessing
cave.PostProcessing
ClassTimeline
cave.Timeline
Timeline
cave.Timeline
The Timeline is meant for you to Design Cutscenes and/or Scripted Events. Keyframe Entity Transforms and Components, play Animations, trigger Scripts, and even run multiple Timelines together.
In order to play a timeline, get the current scene and call scene.playTimeline('Timeline Name').
TimelineChannelBlend
"Timeline" class Enumeration.
ClassDocumentation
cave.Documentation
Documentation
cave.Documentation
You can use this Documentation asset to write any custom docs, reminders, tutorials, lists you want to help you during development.
It uses Markdown to format it for you.
AnimationInterpolation
ClassImageTexture
cave.ImageTexture
ImageTexture
cave.ImageTexture
ClassProceduralTexture
cave.ProceduralTexture
ProceduralTexture
cave.ProceduralTexture
A Procedural Texture works like any other Texture, except that it is meant to be Procedurall Generated with a Filter Shader. It can be Dynamic (so it is queued to bee updated on the next frame every time Cave detects it's being used) or static, where it is only updated once at Startup/Load and never again. You can also manually call its Update to render the Texture again.
AnimationInterpolation
Remaining
Supporting classes and namespaces that do not fit the main gameplay, utility, or asset groups.
ClassAnimation
cave.Animation
Animation
cave.Animation
ShaderLocations
The ShaderLocations enum specifies where to bind each Texture in the main render pass. It's used internally by the engine.
ClassAnimationCallbacks
cave.AnimationCallbacks
AnimationCallbacks
cave.AnimationCallbacks
ClassAnimationChannels
cave.AnimationChannels
AnimationChannels
cave.AnimationChannels
AnimationInterpolation
ClassAnimationComponentAnimationLayer
cave.AnimationComponentAnimationLayer
AnimationComponentAnimationLayer
cave.AnimationComponentAnimationLayer
TimelineChannelBlend
"Timeline" class Enumeration.
ClassAnimationFilter
cave.AnimationFilter
AnimationFilter
cave.AnimationFilter
TimelineChannelBlend
"Timeline" class Enumeration.
ClassAnimationRootMotion
cave.AnimationRootMotion
AnimationRootMotion
cave.AnimationRootMotion
ClassAnimationSocketComponentCopyInfo
cave.AnimationSocketComponentCopyInfo
AnimationSocketComponentCopyInfo
cave.AnimationSocketComponentCopyInfo
ClassApp
cave.App
App
cave.App
LogicBricksException
"LogicBricks" class Enumeration.
ClassAppAppDebugConfig
cave.AppAppDebugConfig
AppAppDebugConfig
cave.AppAppDebugConfig
ClassAppAppDebugConfigDebugPhysicsConfig
cave.AppAppDebugConfigDebugPhysicsConfig
AppAppDebugConfigDebugPhysicsConfig
cave.AppAppDebugConfigDebugPhysicsConfig
LogicBricksException
"LogicBricks" class Enumeration.
ClassAppGameSettings
cave.AppGameSettings
AppGameSettings
cave.AppGameSettings
ClassAppPerformanceEmulator
cave.AppPerformanceEmulator
AppPerformanceEmulator
cave.AppPerformanceEmulator
ClassArmature
cave.Armature
Armature
cave.Armature
This will destructively apply the Armature deformation to the destination mesh, meaning that all bone transforms will be calculated on the CPU and applied to each Vertex. It will also clear the Vertex Joints data. You can use this if you need to retrieve back the final pose of a mesh but CPU side. Keep in mind that is could be an expensive operation.
ClassArmatureUBO
cave.ArmatureUBO
ArmatureUBO
cave.ArmatureUBO
ClassAsset
cave.Asset
Asset
cave.Asset
Asset is the main Cave Engine Class. Most Classes inherits from it.
If a class is an Asset, it usually means that it can be Serialized to disk (saved and loaded) by the engine and also be inspected in the Editor.
CameraCameraType
"Camera" class Enumeration.
Unique Name consists in the <Asset Name + ## + UID>
ClassAssetDebug
cave.AssetDebug
AssetDebug
cave.AssetDebug
Debug information for each Asset is usually meant to be used by the Editor only. There is no garantee that those informations will be persistent or serialized.
CameraCameraType
"Camera" class Enumeration.
ClassAssetHandler
cave.AssetHandler
AssetHandler
cave.AssetHandler
ClassAssetImporter
cave.AssetImporter
AssetImporter
cave.AssetImporter
IAssetHandlerMode
"IAssetHandler" class Enumeration to define the reference level to the current Asset being referenced by the Handler (if any).
ClassAssetImporterFilter
cave.AssetImporterFilter
AssetImporterFilter
cave.AssetImporterFilter
ClassAudioDevice
cave.AudioDevice
AudioDevice
cave.AudioDevice
ClassAudioTrack
cave.AudioTrack
AudioTrack
cave.AudioTrack
ClassAudioTrackInstance
cave.AudioTrackInstance
AudioTrackInstance
cave.AudioTrackInstance
IAssetHandlerMode
"IAssetHandler" class Enumeration to define the reference level to the current Asset being referenced by the Handler (if any).
ClassBitMask
cave.BitMask
BitMask
cave.BitMask
ClassBlur
cave.Blur
Blur
cave.Blur
TerrainToolAutoPaintRule
"TerrainTool" class Enumeration.
ClassBone
cave.Bone
Bone
cave.Bone
AnimationInterpolation
Computes the optimal rotations for a chain of bones (parents) for this bone to reach the targetPosition while maintaining natural movement constraints. The targetPosition MUST BE in local space (relative to the Armature Entity), so make sure you untransform it first if you're handling world coordinates. Returns the number of iterations spent to evaluate the final pose.
Two Part IK also solves inverse Kinematics but it is specialized in chain length equal to two and it's usually better (and faster) at doing it than the regular one.
ClassBoneRagdoll
cave.BoneRagdoll
BoneRagdoll
cave.BoneRagdoll
ClassCamera
cave.Camera
Camera
cave.Camera
The main Camera class. Every scene have its own camera instance. Please notice that this is NOT the same as the Camera Component. You can get the Scene's camera by calling the Scene's getCamera() method.
CameraCameraType
"Camera" class Enumeration.
DEPRECATED. Aperture is Unused, use HDR exposure instead.
Given a World Position, returns its projected 2D position in the Camera Space.
Given a 2D, camera space, position, returns a 3D vector representing the direction from the camera to that position in the world. NOTE: this is NOT a RayCast by itself!
Given a Position in the 3D World, calculates its 2D, UI Element position and returns it to you in the first two dimensions of the output vector (x and y). If the position is BEHIND the camera, the last dimension (Z) will be negative, otherwise, positive. The absolute Z value is also the distance from the worldPos to the Camera. If you pass a positive (from 0.1 to 0.5) value as the clampOutOfBounds parameter, it will clamp the (x, y) to [-clampOutOfBounds, clampOutOfBounds].
Returns true if the given worldPos is withing the Camera's Frustum
DEPRECATED. Aperture is Unused, use HDR exposure instead.
Field of View in Degrees
ClassCameraExposure
cave.CameraExposure
CameraExposure
cave.CameraExposure
ClassCameraTool
cave.CameraTool
CameraTool
cave.CameraTool
ClassCaveException
cave.CaveException
CaveException
cave.CaveException
ClassCharacterComponentConfig
cave.CharacterComponentConfig
CharacterComponentConfig
cave.CharacterComponentConfig
ClassCharacterComponentShapeDesc
cave.CharacterComponentShapeDesc
CharacterComponentShapeDesc
cave.CharacterComponentShapeDesc
This class is a Descriptor for the Character Component's Shape.
UIElementComponentStatus
"UIElementComponent" class Enumeration.
ClassCollisionInfo
cave.CollisionInfo
CollisionInfo
cave.CollisionInfo
ClassConsoleTab
cave.ConsoleTab
ConsoleTab
cave.ConsoleTab
LocalizationLanguages
"Localization" class Enumeration.
ClassCurve
cave.Curve
Curve
cave.Curve
ClassDebugTab
cave.DebugTab
DebugTab
cave.DebugTab
ClassDebugTool
cave.DebugTool
DebugTool
cave.DebugTool
ClassDebugUI
cave.DebugUI
DebugUI
cave.DebugUI
IAssetHandlerMode
"IAssetHandler" class Enumeration to define the reference level to the current Asset being referenced by the Handler (if any).
ClassDebugUIDebugClipboard
cave.DebugUIDebugClipboard
DebugUIDebugClipboard
cave.DebugUIDebugClipboard
ClassEntityMap
cave.EntityMap
EntityMap
cave.EntityMap
Internal Class. The Entity Map is a class instantiated by each Scene to properly store and handle Entities efficiently. You probably don't want to mess with this by hand, since it's an Internal Cave class and the Scene will probably have all the accessors for you do handle the Entities efficiently.
CameraCameraType
"Camera" class Enumeration.
ClassFile
cave.File
File
cave.File
FileFileMode
"File" class Enumeration.
ClassFileBinary
cave.FileBinary
FileBinary
cave.FileBinary
FileFileMode
"File" class Enumeration.
ClassFileJson
cave.FileJson
FileJson
cave.FileJson
FileFileMode
"File" class Enumeration.
ClassFileVirtual
cave.FileVirtual
FileVirtual
cave.FileVirtual
FileFileMode
"File" class Enumeration.
ClassFont
cave.Font
Font
cave.Font
ClassGeometryPaintTool
cave.GeometryPaintTool
GeometryPaintTool
cave.GeometryPaintTool
GeometryPaintToolAlignRule
"GeometryPaintTool" class Enumeration.
ClassGeometryPaintToolLayer
cave.GeometryPaintToolLayer
GeometryPaintToolLayer
cave.GeometryPaintToolLayer
ClassIAssetHandler
cave.IAssetHandler
IAssetHandler
cave.IAssetHandler
This is the Base Interface class for each Asset Handler. Specific Asset types (Texture, Material, Mesh, etc) will have their own specific Asset Handler implementation, usually described as 'AssetHandler_T_', where 'T' is the specific Asset Type. You will also find them described in the stubs as `AssetHandler[T]`, just for Python Reference (but this is wrong).
IAssetHandlerMode
"IAssetHandler" class Enumeration to define the reference level to the current Asset being referenced by the Handler (if any).
Returns a pointer to the Given Asset without any cast (so it will reference the Base Asset class). You may want to use the specific 'get()' method from each AssetHandler to retrieve the reference with a proper cast.
True if Mode is FROM_ASSET_DATA.
True if Mode is FROM_LOCAL.
True if Mode is FROM_WEAK_REF.
If the mode is FROM_LOCAL and there is a valid Asset, transfer its ownership to the Engine's Asset Subsystems, effectively adding it to the Asset Browser in the given path. Returns True on success, False on failure (or if the Asset isn't Local).
Makes this Handler references an Asset (from Asset Data) by its name.
ClassInstanceInfoUBO
cave.InstanceInfoUBO
InstanceInfoUBO
cave.InstanceInfoUBO
ClassLocalization
cave.Localization
Localization
cave.Localization
LocalizationLanguages
"Localization" class Enumeration.
ClassLogicBricks
cave.LogicBricks
LogicBricks
cave.LogicBricks
LogicBricksBrickKind
"LogicBricks" class Enumeration.
LogicBricksException
"LogicBricks" class Enumeration.
ClassLogicBricksBrick
cave.LogicBricksBrick
LogicBricksBrick
cave.LogicBricksBrick
LogicBricksException
"LogicBricks" class Enumeration.
ClassLogicBricksComment
cave.LogicBricksComment
LogicBricksComment
cave.LogicBricksComment
ClassLogicBricksEnumInfo
cave.LogicBricksEnumInfo
LogicBricksEnumInfo
cave.LogicBricksEnumInfo
ClassLogicBricksEnumValue
cave.LogicBricksEnumValue
LogicBricksEnumValue
cave.LogicBricksEnumValue
ClassLogicBricksFunctionGraph
cave.LogicBricksFunctionGraph
LogicBricksFunctionGraph
cave.LogicBricksFunctionGraph
ClassLogicBricksGraphScope
cave.LogicBricksGraphScope
LogicBricksGraphScope
cave.LogicBricksGraphScope
ClassLogicBricksLink
cave.LogicBricksLink
LogicBricksLink
cave.LogicBricksLink
ClassManipulationTool
cave.ManipulationTool
ManipulationTool
cave.ManipulationTool
GeometryPaintToolAlignRule
"GeometryPaintTool" class Enumeration.
ClassMesh
cave.Mesh
Mesh
cave.Mesh
Main class representing a 3D mesh. This class is connected to the GPU and can also be used for Physics and/or custom logics as you wish.
Cave Meshes are indexed, wich means that you will find a list of vertices and also a list of indices that describes each Triangle. **NGONS are not supported in cave**, so make sure that all your polygons are Triangles.
The indices are IDs that maps the access to each Vertex store in the vertices list and every 3 indices represents one triangle.
This rendering method is optimal for games because instead of duplicating vertex data for every triangle, an indexed mesh uses a list of unique vertices and an index buffer that specifies the order in which vertices are used to form triangles. This approach reduces memory usage and improves rendering performance by reusing vertices.
MeshShadowPassRule
"Mesh" class Enumeration to specify the Rendering behaviour during the Shadow Pass.
Adds a Cone Shape into the Mesh, transforming it by the given Transform (optional).
Adds a Cube Shape into the Mesh, transforming it by the given Transform (optional).
Adds a Plane Cylinder into the Mesh, transforming it by the given Transform (optional).
Adds a Grid Shape into the Mesh, transforming it by the given Transform (optional). A Grid is basically a Plane with subdivisions.
Adds a Plane Shape into the Mesh, transforming it by the given Transform (optional).
Adds an UV Sphere Shape into the Mesh, transforming it by the given Transform (optional).
Given a position (in local Mesh space), returns the closest point in the entire mesh surface to that position. The point could be in a vertex, edge or withing the triangle surface.
Given a position (in local Mesh space), returns an IntVector3 containing the three vertex IDs that builds the closest Triangle to that position. You can use those three IDs to access each Vertex in the vertex list. Also returns the closest position in tha triangle.
Given a position (in local Mesh space), returns an ID for the closest Triangle to that position. In order to properly sample the 3 vertices that builds this triangle, you need to multiply this ID by 3 and then use it to access the 3 following vertex IDs in the indices list. Also returns the closest position in tha triangle.
Given a position (in local Mesh space), returns a copy of the closest Vertex to that position.
Given a position (in local Mesh space), returns an ID for the closest Vertex to that position. This ID can be used to access the vertex in the vertices list.
Given an Edge, returns all other triangles that shares this same edge
Given a Triangle, returns all other triangles that shares at least one vertice with it.
It will merge all vertices that are withing certain minimal distance (distance parameter). It uses Spatial Hashing to find nearby vertices in O(n) time instead of O(n^2) for the naive approach.
This is a fast (and approximate) approach to Merging nearby vertices. It always ignores the UVs and uses the position to generate a round approximation to be able to fastly compare with others. May be imprecise, but it's much faster than the regular mergeByDistance.'
This Method will perform a series of Mesh optimizations to make sure that it is optimal for rendering. This includes Merging the Vertices and Joints by distance, Optimizing Vertex Cache and Overdraw and also optimizing Vertex Fetch. Note: This may be SLOW and probably not suitable (or meant to) for real time use cases.
Resets the mesh sent to the GPU and send it again.
It will search and remove all Vertices that does not belong to any faces.
Resets the mesh, clearing all its vertex and indices data and freeing from GPU memory.
Given an initialPos, initialDir and length, it walks in the mesh surface, starting from the closest point in mesh to the initialPos and initially going to the initialDir direction, until it moved the desired length. Returns the map of waypoints to this walk. First one is always the closest point to the initialPos.
ClassMeshLodData
cave.MeshLodData
MeshLodData
cave.MeshLodData
ClassMeshMeshDistanceCulling
cave.MeshMeshDistanceCulling
MeshMeshDistanceCulling
cave.MeshMeshDistanceCulling
ClassMeshMeshHints
cave.MeshMeshHints
MeshMeshHints
cave.MeshMeshHints
ClassMeshProxyComponentProxyMeshSettings
cave.MeshProxyComponentProxyMeshSettings
MeshProxyComponentProxyMeshSettings
cave.MeshProxyComponentProxyMeshSettings
ClassMouselookAxisConfig
cave.MouselookAxisConfig
MouselookAxisConfig
cave.MouselookAxisConfig
ClassNewProjectDescriptor
cave.NewProjectDescriptor
NewProjectDescriptor
cave.NewProjectDescriptor
NewProjectDescriptorButtonStyle
"NewProjectDescriptor" class Enumeration.
NewProjectDescriptorGameMode
"NewProjectDescriptor" class Enumeration.
ClassNewProjectDescriptorGame
cave.NewProjectDescriptorGame
NewProjectDescriptorGame
cave.NewProjectDescriptorGame
NewProjectDescriptorGameMode
"NewProjectDescriptor" class Enumeration.
ClassNewProjectDescriptorUI
cave.NewProjectDescriptorUI
NewProjectDescriptorUI
cave.NewProjectDescriptorUI
ClassNodeTransform
cave.NodeTransform
NodeTransform
cave.NodeTransform
Child class from Transform that introduces Parenting to it.
LogicBricksException
"LogicBricks" class Enumeration.
Rotates the Transform in a way that it faces towards the given Direction, keeping "up" as the up axis.
Same as "lookAt", except that it allows you to lerp between the current and the final rotation.
ClassParticleComponentCurveColors
cave.ParticleComponentCurveColors
ParticleComponentCurveColors
cave.ParticleComponentCurveColors
ClassParticleComponentOptimizations
cave.ParticleComponentOptimizations
ParticleComponentOptimizations
cave.ParticleComponentOptimizations
ClassParticleComponentParticleInstanceDescriptor
cave.ParticleComponentParticleInstanceDescriptor
ParticleComponentParticleInstanceDescriptor
cave.ParticleComponentParticleInstanceDescriptor
MeshProxyComponentPassMask
"MeshProxyComponent" class Enumeration.
ClassParticleInstance
cave.ParticleInstance
ParticleInstance
cave.ParticleInstance
ClassPathEdge
cave.PathEdge
PathEdge
cave.PathEdge
Path Edge, composed by two Path Points and used in the Path Component.
MeshProxyComponentPassMask
"MeshProxyComponent" class Enumeration.
ClassPathEdgeControlPoints
cave.PathEdgeControlPoints
PathEdgeControlPoints
cave.PathEdgeControlPoints
ClassPathPoint
cave.PathPoint
PathPoint
cave.PathPoint
ClassPathQueryResult
cave.PathQueryResult
PathQueryResult
cave.PathQueryResult
Result structure returned by path query functions like GetClosestPointOnPath. Contains the found point, which path element it belongs to, parametric values, and distance information.
MeshProxyComponentPassMask
"MeshProxyComponent" class Enumeration.
ClassPathSample
cave.PathSample
PathSample
cave.PathSample
Sample point along a path containing position, direction, normal vector, and distance information. Used by path sampling functions for procedural placement and navigation.
MeshProxyComponentPassMask
"MeshProxyComponent" class Enumeration.
ClassPathTool
cave.PathTool
PathTool
cave.PathTool
GeometryPaintToolAlignRule
"GeometryPaintTool" class Enumeration.
ClassPhysicsConstraintComponentConstraintConfig
cave.PhysicsConstraintComponentConstraintConfig
PhysicsConstraintComponentConstraintConfig
cave.PhysicsConstraintComponentConstraintConfig
ClassPhysicsMesh
cave.PhysicsMesh
PhysicsMesh
cave.PhysicsMesh
ClassPhysicsWorld
cave.PhysicsWorld
PhysicsWorld
cave.PhysicsWorld
LogicBricksException
"LogicBricks" class Enumeration.
ClassPhysicsWorldPhysicsWorldDebugInfo
cave.PhysicsWorldPhysicsWorldDebugInfo
PhysicsWorldPhysicsWorldDebugInfo
cave.PhysicsWorldPhysicsWorldDebugInfo
LogicBricksException
"LogicBricks" class Enumeration.
ClassPointLightInfoUBO
cave.PointLightInfoUBO
PointLightInfoUBO
cave.PointLightInfoUBO
ClassPointLightsUBO
cave.PointLightsUBO
PointLightsUBO
cave.PointLightsUBO
ClassPostProcessingFilter
cave.PostProcessingFilter
PostProcessingFilter
cave.PostProcessingFilter
MeshShadowPassRule
"Mesh" class Enumeration to specify the Rendering behaviour during the Shadow Pass.
ClassProgressBar
cave.ProgressBar
ProgressBar
cave.ProgressBar
ClassPythonCodeComponentOptimizations
cave.PythonCodeComponentOptimizations
PythonCodeComponentOptimizations
cave.PythonCodeComponentOptimizations
ClassRayCastOut
cave.RayCastOut
RayCastOut
cave.RayCastOut
ClassRegexMatch
cave.RegexMatch
RegexMatch
cave.RegexMatch
ClassRemoteControl
cave.RemoteControl
RemoteControl
cave.RemoteControl
ClassRenderableSun
cave.RenderableSun
RenderableSun
cave.RenderableSun
AnimationInterpolation
ClassRenderableSunShadowSettings
cave.RenderableSunShadowSettings
RenderableSunShadowSettings
cave.RenderableSunShadowSettings
ClassRenderer
cave.Renderer
Renderer
cave.Renderer
MeshShadowPassRule
"Mesh" class Enumeration to specify the Rendering behaviour during the Shadow Pass.
ClassRendererRendererDebug
cave.RendererRendererDebug
RendererRendererDebug
cave.RendererRendererDebug
ClassRenderGraph
cave.RenderGraph
RenderGraph
cave.RenderGraph
AnimationInterpolation
ClassRenderGraphConfig
cave.RenderGraphConfig
RenderGraphConfig
cave.RenderGraphConfig
ClassRenderGraphConfigAmbient
cave.RenderGraphConfigAmbient
RenderGraphConfigAmbient
cave.RenderGraphConfigAmbient
ClassRenderGraphConfigAO
cave.RenderGraphConfigAO
RenderGraphConfigAO
cave.RenderGraphConfigAO
ClassRenderGraphConfigMist
cave.RenderGraphConfigMist
RenderGraphConfigMist
cave.RenderGraphConfigMist
ClassRenderGraphConfigSky
cave.RenderGraphConfigSky
RenderGraphConfigSky
cave.RenderGraphConfigSky
ClassRenderGraphDebugConfig
cave.RenderGraphDebugConfig
RenderGraphDebugConfig
cave.RenderGraphDebugConfig
ClassRenderGraphDebugDrawPass
cave.RenderGraphDebugDrawPass
RenderGraphDebugDrawPass
cave.RenderGraphDebugDrawPass
AnimationInterpolation
ClassSampler2D
cave.Sampler2D
Sampler2D
cave.Sampler2D
AnimationInterpolation
ClassSceneTemplateEditor
cave.SceneTemplateEditor
SceneTemplateEditor
cave.SceneTemplateEditor
ClassSceneTimer
cave.SceneTimer
SceneTimer
cave.SceneTimer
ClassSceneUBO
cave.SceneUBO
SceneUBO
cave.SceneUBO
ShaderLocations
The ShaderLocations enum specifies where to bind each Texture in the main render pass. It's used internally by the engine.
ClassShaderUniforms
cave.ShaderUniforms
ShaderUniforms
cave.ShaderUniforms
This class is a container that stores and represents Shader Uniforms in a way that you can see, access and modify.
ShaderLocations
The ShaderLocations enum specifies where to bind each Texture in the main render pass. It's used internally by the engine.
Given an Uniform name, returns its value or None if it doesn't exist.
Returns a dictionary containing A COPY of all Uniforms and Values.
Given a shader source code, parses it and includes all its uniform values to this class.
Clears all the Uniform lists, deleting them all.
Given an Uniform name, sets it to the provided value. Creates a new uniform if there was no one with this name.
Syncs this uniforms with the base Shader Uniform, meaning that any uniform in this class that does not exist in the base Shader Uniforms will be deleted and any new/different uniform in it will be added to this one.
ClassSourceCode
cave.SourceCode
SourceCode
cave.SourceCode
SourceCodeSourceType
"SourceCode" class Enumeration.
self == other
self == other
self != other
self != other
ClassSphereCastOut
cave.SphereCastOut
SphereCastOut
cave.SphereCastOut
ClassSpikeInfo
cave.SpikeInfo
SpikeInfo
cave.SpikeInfo
ClassStateMachineInstance
cave.StateMachineInstance
StateMachineInstance
cave.StateMachineInstance
SourceCodeSourceType
"SourceCode" class Enumeration.
ClassStateMachineState
cave.StateMachineState
StateMachineState
cave.StateMachineState
ClassStateMachineTransition
cave.StateMachineTransition
StateMachineTransition
cave.StateMachineTransition
ClassStatsForNerdsTab
cave.StatsForNerdsTab
StatsForNerdsTab
cave.StatsForNerdsTab
ClassStatsForNerdsTabCounters
cave.StatsForNerdsTabCounters
StatsForNerdsTabCounters
cave.StatsForNerdsTabCounters
ClassStatsForNerdsTabTimers
cave.StatsForNerdsTabTimers
StatsForNerdsTabTimers
cave.StatsForNerdsTabTimers
ClassTerrainLayer
cave.TerrainLayer
TerrainLayer
cave.TerrainLayer
ClassTerrainTool
cave.TerrainTool
TerrainTool
cave.TerrainTool
TerrainToolAutoPaintMode
"TerrainTool" class Enumeration.
TerrainToolAutoPaintRule
"TerrainTool" class Enumeration.
TerrainToolTerrainMode
"TerrainTool" class Enumeration.
ClassTerrainToolAutoPaint
cave.TerrainToolAutoPaint
TerrainToolAutoPaint
cave.TerrainToolAutoPaint
ClassTerrainToolTerrainBrush
cave.TerrainToolTerrainBrush
TerrainToolTerrainBrush
cave.TerrainToolTerrainBrush
ClassThirdPersonCamComponentCamCollisionConfig
cave.ThirdPersonCamComponentCamCollisionConfig
ThirdPersonCamComponentCamCollisionConfig
cave.ThirdPersonCamComponentCamCollisionConfig
ClassThirdPersonCamComponentMouselook
cave.ThirdPersonCamComponentMouselook
ThirdPersonCamComponentMouselook
cave.ThirdPersonCamComponentMouselook
ClassThreadPool
cave.ThreadPool
ThreadPool
cave.ThreadPool
ClassTimedLerp
cave.TimedLerp
TimedLerp
cave.TimedLerp
This class lerps, in a given time in seconds, one value (current) to another (destination). After the lerp is finished, it will always return the destination value.
Checks if the class has finished the lerping process.
ClassTimelineAudioInstance
cave.TimelineAudioInstance
TimelineAudioInstance
cave.TimelineAudioInstance
ClassTimelineChannel
cave.TimelineChannel
TimelineChannel
cave.TimelineChannel
TimelineChannelBlend
"Timeline" class Enumeration.
ClassTimelineComponentChannel
cave.TimelineComponentChannel
TimelineComponentChannel
cave.TimelineComponentChannel
ClassTimelineEntityChannel
cave.TimelineEntityChannel
TimelineEntityChannel
cave.TimelineEntityChannel
TimelineChannelBlend
"Timeline" class Enumeration.
ClassTimelinePlayer
cave.TimelinePlayer
TimelinePlayer
cave.TimelinePlayer
ClassTimer
cave.Timer
Timer
cave.Timer
Timer class that counts elapsed time in seconds. Keep in mind that it keeps counting time even if the scene is paused. If you don't want that, check the SceneTimer instead.
Gets the elapsed time in seconds.
Resets the elapsed time to zero and starts counting again.
Sets the elapsed time to a given amount of seconds and continues to count from that point.
ClassTransform
cave.Transform
Transform
cave.Transform
This is the Main Transform class. It uses a VQS system to handle Position, Rotation (in Euler, Quaternion and/or Matrix) and Scale. You can also obtain its model Matrix4 and so on.
LogicBricksException
"LogicBricks" class Enumeration.
Applies the (x, y, z) moviment while also considering the Transform's rotation.
Applies the moviment while also considering the Transform's rotation.
Applies the (x, y, z) moviment by directly adding it to the Transform's position.
Applies the moviment by directly adding it to the Transform's position.
Transforms this using another Transform
The vector representing where the Transform's Z Axis is pointed to. If world is True, it will take its parent Transform into account (this is what you probably want in most of the cases).
The Pitch is the Angle (in Radians) of Rotation of the Transform around its X Axis (Local).
Returns a COPY of the Position.
The vector representing where the Transform's X Axis is pointed to. If world is True, it will take its parent Transform into account (this is what you probably want in most of the cases).
The Pitch is the Angle (in Radians) of Rotation of the Transform around its Z Axis (Local).
Returns a COPY of the Scale.
The vector representing where the Transform's Y Axis is pointed to. If world is True, it will take its parent Transform into account (this is what you probably want in most of the cases).
The Pitch is the Angle (in Radians) of Rotation of the Transform around its Y Axis (Local).
Lerps a Transform into other by linearly interpolating the Position and Scale and using sLerp for the Rotation (Quaternions).
Rotates the Transform in a way that it faces towards the given Direction, keeping "up" as the up axis.
Rotates the Transform in a way that it faces a Direction towards the given Position, keeping "up" as the up axis.
Same as "lookAtPosition", except that it allows you to lerp between the current and the final rotation.
Same as "lookAt", except that it allows you to lerp between the current and the final rotation.
Rotates the Transform Locally using Radians.
Rotates the Transform Locally using Euler Angles (Degrees).
Rotates the Transform around a given 3D Axis (that can be anything).
Rotates the Transform around its X Axis. If world is True, it will take its parent Transform into account.
Rotates the Transform around its Z Axis. If world is True, it will take its parent Transform into account.
Rotates the Transform around its Y Axis. If world is True, it will take its parent Transform into account.
Sets its Local position to (x, y, z).
Sets its Local position to be the provided parameter.
Lerps the Transform's Rotation (Quaternion) into another by using sLerp.
ClassUICanvas
cave.UICanvas
UICanvas
cave.UICanvas
ClassUIElementComponentFontConfig
cave.UIElementComponentFontConfig
UIElementComponentFontConfig
cave.UIElementComponentFontConfig
ClassUIElementComponentFontDesc
cave.UIElementComponentFontDesc
UIElementComponentFontDesc
cave.UIElementComponentFontDesc
ClassUIElementComponentQuadDesc
cave.UIElementComponentQuadDesc
UIElementComponentQuadDesc
cave.UIElementComponentQuadDesc
ClassUIRect
cave.UIRect
UIRect
cave.UIRect
AnimationInterpolation
ClassUIStyleColor
cave.UIStyleColor
UIStyleColor
cave.UIStyleColor
ClassUIVector
cave.UIVector
UIVector
cave.UIVector
This class is Specifically used when handling Game User Interfaces, since it can have either absolute (in pixels) or relative (in percentage, 0 to 1) x and y values.
It also holds anchoring information for each Axis. You need to check if the axis is using relative values (if not, then it is using its pixel values). Directly setting a relative OR pixel value changes this.
AnimationInterpolation
Getter for the pixel variable.
Getter for the relative variable.
Checks if the X axis should use its relative (returns True) or pixel value (returns False).
Checks if the Y axis should use its relative (returns True) or pixel value (returns False).
Setter for the pixel variable
Setter for the pixel variable
Setter for the relative variable
Setter for the relative variable.
ClassUniformBuffer
cave.UniformBuffer
UniformBuffer
cave.UniformBuffer
ClassUniqueID
cave.UniqueID
UniqueID
cave.UniqueID
ClassVehicleComponentEngine
cave.VehicleComponentEngine
VehicleComponentEngine
cave.VehicleComponentEngine
ClassVehicleComponentSteering
cave.VehicleComponentSteering
VehicleComponentSteering
cave.VehicleComponentSteering
ClassVersion
cave.Version
Version
cave.Version
LogicBricksException
"LogicBricks" class Enumeration.
self == other
self >= other
self > other
self <= other
self < other
ClassVertex
cave.Vertex
Vertex
cave.Vertex
Represents a single vertex in the mesh. It is the minimum amount of data that each Vertex composing a Mesh in Cave needs to have.
TerrainToolAutoPaintRule
"TerrainTool" class Enumeration.
Initializes a default Vertex with all set to zero.
Initializes the vertex with position, normal, tangent, and UV data.
ClassVertexInfo
cave.VertexInfo
VertexInfo
cave.VertexInfo
ClassVertexJoints
cave.VertexJoints
VertexJoints
cave.VertexJoints
Holds Joint and Weight information for Skinned mesh vertices. This is optional for Cave meshes and only exists if the Mesh is meant to be used with an Armature + Animation.
Cave can handle up to 4 weights per vertex, meaning that the maximum amount of Bones that can deform them is 4. Those bones and weights are recpectively defined by the jointIDs and weights, where an ID equals to -1 means no Bone (so it will be skipped). Sum of all valid (ID != -1) Weights must be equal to 1.0.
TerrainToolAutoPaintRule
"TerrainTool" class Enumeration.
Initializes the class with all IDs set to -1 and weights set to 0.0.
ClassViewportTab
cave.ViewportTab
ViewportTab
cave.ViewportTab
This is where you'll be seeing most of the 3D world of your project.
Including Scenes, Entity Templates and so on.
LocalizationLanguages
"Localization" class Enumeration.
ClassViewportTabViewportConfig
cave.ViewportTabViewportConfig
ViewportTabViewportConfig
cave.ViewportTabViewportConfig
ClassWheelComponentControls
cave.WheelComponentControls
WheelComponentControls
cave.WheelComponentControls
ClassWheelComponentTuningConfig
cave.WheelComponentTuningConfig
WheelComponentTuningConfig
cave.WheelComponentTuningConfig
RigidBodyShape
ClassWindow
cave.Window
Window
cave.Window
WindowType
"Window" class Enumeration.
Returns the window Title
Changes the Window title.
cave.ui
The cave.ui submodule is ONLY for the Editor and does NOT exist in the
standalone (exported) Game. You can use this submodule to create custom Cave
Tabs, Tools, Plugins, etc that will run within the Editor Boundaries.
This is meant for you to create your own Editor Tab Tools. If you create a new
script for an EditorTool, don't forget to add this to its first line:
#editoronly
(A comment saying editoronly) So the code doesn't get executed by the engine
in the exported game.
In order to run it, in the Text Editor, go to:
> Editor Tools... > Register Debug Tab... > ExampleTab
This is a Sample Script:
class ExampleTab(cave.ui.DebugTab):
def __init__(self):
super().__init__()
self.counter = 0
def draw(self):
ui.text("This is a Sample Tool!")
ui.separator()
ui.text("You can modify the Counter below of click the Button to increase it.")
self.counter = ui.prop("Counter", self.counter)
if ui.button("Increase counter +1"):
self.counter += 1
print("Counter Increased by +1!")
ImGui Tips:
Cave internally uses a modified Dear ImGui version to handle the Editor UI
and this API here also exposes to you some of it. So here is some tips:
- Most things, such as buttons, headers, trees, props, uses the name/title
as the unique ID. This means that if you have multiple elements with the same
name, it will malfunction. In this case, you can use an "#" to add extra
text to be used as an ID, but everything after the "#" won't be rendered.
So if you have two elements: "Element#n1" and "Element#n2", they will both be
displayed as just "Element", but the extra text will be used as the ID.
- Similarly, if you want the element name to be dynamic and change, this will
also change its ID and cause it to malfunction. In this case, you can use 3
consecutive "#" to determine an unique ID and ignore what's before it. So
the element named "Test1###id01" could have anything before the "#" that it
will still work as expected.
A Clickable Button. Returns True on click.
A Clickable, Full Height and Width, Button. Returns True on click.
Creates a collapsable Header, returns True if it's open, False otherwise.
Creates a horizontal, full width, line to separate subjects.
Writes a Text to the UI
