Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
78222b1
Added Animation, Tilemaps, and many more
Lioncub901 Mar 1, 2026
b2e0a6c
Changed the Animation doc to new syntax
Lioncub901 Mar 6, 2026
8d8806f
Added open key frame and custom funciton documentation
Lioncub901 Mar 9, 2026
4229162
Merge branch 'main' into main
Lioncub901 Mar 28, 2026
64617da
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
af1d66e
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
91f538f
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
8ddeb9a
Update docs/source/api/tilemap.rst
Lioncub901 Mar 30, 2026
51bede8
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
4ce0a24
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
a31609f
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
c7e6b22
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
afd199c
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
a4a661e
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
b134638
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
37acab2
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
4679c52
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
6e65245
Update docs/source/api/animation.rst
Lioncub901 Mar 30, 2026
6212833
Apply suggestions from code review
Lioncub901 Mar 30, 2026
a098e06
Apply suggestions from code review
Lioncub901 Mar 30, 2026
d02e6c1
Update animation.rst
Lioncub901 Mar 30, 2026
f6eceae
Fixed the help text and many errors. Also added the pixel writing and…
Lioncub901 Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
483 changes: 483 additions & 0 deletions docs/source/api/animation.rst
Comment thread
Lioncub901 marked this conversation as resolved.

Large diffs are not rendered by default.

31 changes: 28 additions & 3 deletions docs/source/api/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@ entity

.. literalinclude:: /code/Example_entity_destroy.codea/Main.lua
:language: lua

.. helptext:: mark this entity for destruction

.. lua:method:: destroyChildren()

Destroys all the children of an entity

.. helptext:: mark this entity's children for destruction

**Components**

.. lua:method:: add(component, ...)
Expand Down Expand Up @@ -563,9 +569,23 @@ entity
.. lua:attribute:: destroyed: function

Callback for the `destroyed()` event, which is called right before the entity is destroyed

.. helptext:: callback invoked before this entity is destroyed

**Activation Callbacks**

.. lua:attribute:: activated: function

Callback for the ``activated()`` event, which is called when ``entity.active`` is set to true

.. helptext:: callback invoked when this entity is activated

.. lua:attribute:: deactivated: function

Callback for the ``deactivated()`` event, which is called when ``entity.active`` is set to false

.. helptext:: callback invoked when this entity is deactivated

**Physics Callbacks**

.. lua:attribute:: collisionBegan2d: function
Expand Down Expand Up @@ -608,6 +628,11 @@ entity
.. lua:attribute:: hitTest: boolean [default = false]

Enables hit testing for the ``touched(touch)`` event, which will filter touches based on collision checks using attached physics components on the main camera

.. helptext:: enable hit testing for touch events

.. lua:attribute:: touchPriority: number [default = 0]

Sets the priority of entity in ``touched(touch)`` event

.. helptext:: set the priority of entity in touched
135 changes: 134 additions & 1 deletion docs/source/api/graphics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,152 @@ Text
:return: The ``width`` and ``height`` of the text
:rtype: number, number

.. lua:function:: textGlyphBounds(str, pos[, size])
Comment thread
Lioncub901 marked this conversation as resolved.

.. helptext:: gets the bound of the glyph

(Experimental subject to change) Gets the bound each characters in a text

:param str: The text to query
:type str: string
:param pos: The position of the textbox
:type width: vec2
:param size: The size of the textbox
:type width: vec2
:return: The ``width`` and ``height`` of the text
:rtype: glyphBounds

* ``x`` - x pos of glyph
* ``y`` - y pos of glyph
* ``width`` - width of glyph
* ``height`` - height of glyph

Gizmos
######

Gizmos are useful for drawing shapes in 2D/3D space for debugging and editing

.. lua:module:: gizmos

.. lua:function:: line(x1, y1, z1, x2, y2, z2)
.. lua:function:: line(point1 , point2)

Draws a 3D antialiased line

:param point1: First point of line
:type point1: vec3
:param point2: Second point of line
:type point2: vec3

.. helptext:: draw a line between two points

.. lua:function:: box(pos, size)

Draws a 3D antialiased cube

:param pos: Position of the box
:type pos: vec3
:param size: Size of the box
:type size: vec3

.. helptext:: draws a gizmo box

.. lua:function:: sphere(pos,[ radius = 1, segments = 32])

Draws a 3D antialiased sphere

:param pos: Position of the sphere
:type pos: vec3
:param radius: Radius of the sphere
:type radius: number
:param segments: Number of subdivisions that make up the sphere
:type segments: number

.. helptext:: draws a gizmo sphere

.. lua:function:: circlePlane(pos, normal,[ radius = 1, segments = 32, startAngle = 0, endAngle = 360])

Draws a 3D antialiased circle plane

:param pos: Position of the circle
:type pos: vec3
:param normal: Normal direction of the circle
:type normal: vec3
:param radius: Radius of the circle
:type radius: number
:param segments: Number of subdivisions that make up the circle
:type segments: number
:param startAngle: Start degree of the circle
:type startAngle: number
:param endAngle: End degree of the circle
:type endAngle: number

.. helptext:: draws a gizmo circle plane

.. lua:function:: cylinder(pos,[ radius = 1, height = 1, segments = 32])

Draws a 3D antialiased cylinder

:param pos: Position of the cylinder
:type pos: vec3
:param radius: Radius of the cylinder
:type radius: number
:param height: Height of the cylinder
:type height: number
:param segments: Number of subdivisions that make up the cylinder
:type segments: number

.. helptext:: draws a gizmo cylinder

.. lua:function:: capsule(pos,[ radius = 1, height = 1, segments = 32])

Draws a 3D antialiased capsule

:param pos: Position of the capsule
:type pos: vec3
:param radius: Radius of the capsule
:type radius: number
:param height: Height of the capsule
:type height: number
:param segments: Number of subdivisions that make up the capsule
:type segments: number

.. helptext:: draws a gizmo capsule

.. lua:function:: polyline(points,[ closeShape = false])

Draws a 3D antialiased polyline

:param points: Table of points (vec3) the represent the poly line
:type points: table
:param radius: Should the line be closed (polygon)
:type radius: boolean

.. helptext:: draw a gizmo polyline with multiple points

.. lua:function:: mesh(mesh)

Draws a 3D antialiased mesh

:param mesh: The mesh object to draw
:type mesh: mesh

.. helptext:: draws a gizmo mesh

.. lua:function:: icon(camera, iconSprite, pos, size)

Draws a image in 3D shape facing the camera

:param camera: The camera object
:type camera: camera
:param iconSprite: The image to be drawn
:type iconSprite: image
:param pos: The position of the image in 3D space
:type pos: vec3
:param size: The size of the image in 3D space
:type size: number

.. helptext:: draws a icon in world space facing camera

Color Space
###########

Expand Down
95 changes: 95 additions & 0 deletions docs/source/api/image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,101 @@ Image

.. helptext:: generate irradiance data into a target image

.. lua:method:: setPixel(xPos, yPos, pixelColor)

Sets an inputed position to a new color

:param xPos: The x position of the image
:type xPos: integer
:param yPos: The y position of the image
:type yPos: integer
:param pixelColor: The color to change the pixel to
:type pixelColor: color

.. helptext:: sets an inputed position to a new color

.. lua:method:: setValue(xPos, yPos, r, g, b, a)

Same as set pixel but the inputted color value are from 0 to 1

:param xPos: The x position of the image
:type xPos: integer
:param yPos: The y position of the image
:type yPos: integer

.. helptext:: sets an inputed position to a new color using value from 0 to 1

.. lua:method:: setForEach(loopingFunction)

Loop over each pixel of the image and set its color value (0 to 1)

:param loopingFunction: The function to loop over
:type loopingFunction: function

.. code-block:: lua
:caption: How to set the pixels of an image

img = image(255, 255)

img:setForEach(function(x, y)
return math.random(), math.random(), math.random(), 1
end)

img:apply()

.. helptext:: loops over every pixel of the image and output a color value

.. lua:method:: apply()

Applys all the colors that were set

.. helptext:: applys all the colors that were set

.. lua:method:: readback([immediately = true, includeMips = false])

Allows the user to get the image's color data

:param immediately: Whether the image should allow reading immediately
:type immediately: boolean
:param includeMips: Whether the mip maps should be included
:type includeMips: boolean

.. code-block:: lua
:caption: How to read the pixel values of an image

-- img is a image

img:readback() -- allows reading the pixels of the image
local pixelColor = color(img:getPixel(200, 200))

.. helptext:: allows the user to get the image's color data

.. lua:method:: getPixel(xPos, yPos)

Gets the color at the inputted position (0 to 255)

:param xPos: The x position of the image
:type xPos: integer
:param yPos: The y position of the image
:type yPos: integer
:return: The colors at the inputted position (r, g, b, a) (0 to 255)
:rtype: number, number, number, number

.. helptext:: gets the color at the inputted position

.. lua:method:: getValue(xPos, yPos)

Gets the color values at the inputted position (0 to 1)

:param xPos: The x position of the image
:type xPos: integer
:param yPos: The y position of the image
:type yPos: integer
:return: The color values at the inputted position (r, g, b, a) (0 to 1)
:rtype: number, number, number, number

.. helptext:: gets the color values at the inputted position

Image Formats
-------------

Expand Down
Loading