Lit Engine Manual

Heads up!

Keep your creations safe and protected!

Grab a quick backup before starting a new project (copy 'project/' & 'project.json').

Scripting

            
# Python
# Entity

entity.setColor(RED);
entity.color = RED

entity.setName("New Entity");
entity.name = "Entity Name"

entity.setScale(Vector3(x,y,z));
entity.scale.x = 3                           # or entity.scale = Vector3(x,y,z)

entity.position.x = 0                        # or entity.position = Vector3(x,y,z)

entity.rotation.x = 0                        # or entity.rotation = Vector3(x,y,z)

entity.visible = True
entity.id # get entity id (constant)

entity.print_position()

entity.applyForce(Vector3(x,y,z))            # Apply a constant force to an entity physics

entity.applyImpulse(Vector3(x,y,z)) # Apply an impulse to an entity physics

entity.makeStatic() # Make the entity physics static (can't move)
entity.makeDynamic() # Make the entity physics dynamic (can move)


# Other functions

IsMouseButtonPressed()
IsKeyDown()
IsKeyUp()
GetMouseMovement()
KeyboardKey()
MouseButton()
raycast()
Vector3()
Vector2()
Color
time.dt
lerp()


# Camera 3D
camera.position = Vector3(x, y, z)
camera.look_at = Vector3(x, y, z)
camera.up = Vector3(x, y, z)
camera.fovy = 60.0
camera.projection = 1 # or 0
camera.front = Vector3(x, y, z)
camera.back = Vector3(x, y, z)
camera.left = Vector3(x, y, z)
camera.right = Vector3(x, y, z)

# Raycast
raycast(Vector3 origin, Vector3 direction, ignore = [])
raycast.hit                # Boolean
raycast.worldPoint         # World Hit Position
raycast.relativePoint      # Relative Hit Position from Origin
raycast.worldNormal        # Normal of the hit face
raycast.hitColor           # Color of the face
raycast.entity             # Hit Entity

# Color
color.r # Red Value (0 - 255)
color.g # Green Value (0 - 255)
color.b # Blue Value (0 - 255)
color.a # Transparency Value (0 - 255)

# Math
lerp() # Lerp floats, int, Vector3

# Vector3
Vector3.x
Vector3.y
Vector3.z
Vector3.normalize
Vector3.CrossProduct

Vector3Scale(Vector3 v, float scalar)
Vector3Distance(Vector3 vec0, Vector3 vec1)


# All Keys List
# Mouse
"MOUSE_BUTTON_LEFT"
"MOUSE_BUTTON_RIGHT"
"MOUSE_B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