Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasvlevi committed May 12, 2024
1 parent 9611858 commit c880b7d
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 26 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
PLATFORM ?= gnu

APP_NAME = lu5
VERSION = 0.0.3
VERSION = 0.0.4

SRCDIR = src
BINDIR = bin

DOC_BUILD_SCRIPT = build_docs.lua


MACROS=-D'LU5_VERSION="$(VERSION)"'

ifeq ($(PLATFORM), win)
Expand Down
2 changes: 1 addition & 1 deletion docs/classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="module">classes</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>


Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ <h1 class="module">Reference</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>

<div class="modules" id="reactive"><div class="summary"><h3>window</h3><ul><li class="index"><a class="dark index" href="./window.html#createWindow">createWindow</a></li><li class="index"><a class="dark index" href="./window.html#background">background</a></li><li class="index"><a class="dark index" href="./window.html#frameRate">frameRate</a></li><li class="index"><a class="dark index" href="./window.html#deltaTime">deltaTime</a></li></ul></div><div class="summary"><h3>setting</h3><ul><li class="index"><a class="dark index" href="./setting.html#fill">fill</a></li><li class="index"><a class="dark index" href="./setting.html#strokeWeight">strokeWeight</a></li><li class="index"><a class="dark index" href="./setting.html#noFill">noFill</a></li><li class="index"><a class="dark index" href="./setting.html#stroke">stroke</a></li><li class="index"><a class="dark index" href="./setting.html#noStroke">noStroke</a></li><li class="index"><a class="dark index" href="./setting.html#textSize">textSize</a></li><li class="index"><a class="dark index" href="./setting.html#textFont">textFont</a></li><li class="index"><a class="dark index" href="./setting.html#push">push</a></li><li class="index"><a class="dark index" href="./setting.html#pop">pop</a></li></ul></div><div class="summary"><h3>io</h3><ul><li class="index"><a class="dark index" href="./io.html#print">print</a></li></ul></div><div class="summary"><h3>mouse</h3><ul><li class="index"><a class="dark index" href="./mouse.html#mouseX">mouseX</a></li><li class="index"><a class="dark index" href="./mouse.html#mouseY">mouseY</a></li><li class="index"><a class="dark index" href="./mouse.html#mouseIsPressed">mouseIsPressed</a></li><li class="index"><a class="dark index" href="./mouse.html#mousePressed">mousePressed</a></li><li class="index"><a class="dark index" href="./mouse.html#mouseReleased">mouseReleased</a></li></ul></div><div class="summary"><h3>math</h3><ul><li class="index"><a class="dark index" href="./math.html#round">round</a></li><li class="index"><a class="dark index" href="./math.html#floor">floor</a></li><li class="index"><a class="dark index" href="./math.html#ceil">ceil</a></li><li class="index"><a class="dark index" href="./math.html#sin">sin</a></li><li class="index"><a class="dark index" href="./math.html#cos">cos</a></li><li class="index"><a class="dark index" href="./math.html#tan">tan</a></li></ul></div><div class="summary"><h3>keyboard</h3><ul><li class="index"><a class="dark index" href="./keyboard.html#isKeyDown">isKeyDown</a></li><li class="index"><a class="dark index" href="./keyboard.html#keyPressed">keyPressed</a></li><li class="index"><a class="dark index" href="./keyboard.html#keyReleased">keyReleased</a></li><li class="index"><a class="dark index" href="./keyboard.html#keyHeld">keyHeld</a></li></ul></div><div class="summary"><h3>shapes</h3><ul><li class="index"><a class="dark index" href="./shapes.html#circle">circle</a></li><li class="index"><a class="dark index" href="./shapes.html#rect">rect</a></li><li class="index"><a class="dark index" href="./shapes.html#square">square</a></li><li class="index"><a class="dark index" href="./shapes.html#line">line</a></li><li class="index"><a class="dark index" href="./shapes.html#quad">quad</a></li><li class="index"><a class="dark index" href="./shapes.html#text">text</a></li><li class="index"><a class="dark index" href="./shapes.html#image">image</a></li><li class="index"><a class="dark index" href="./shapes.html#point">point</a></li><li class="index"><a class="dark index" href="./shapes.html#arc">arc</a></li><li class="index"><a class="dark index" href="./shapes.html#ellipse">ellipse</a></li><li class="index"><a class="dark index" href="./shapes.html#triangle">triangle</a></li></ul></div><div class="summary"><h3>classes</h3><ul><li class="index"><a class="dark index" href="./classes.html#class">class</a></li></ul></div><div class="summary"><h3>loaders</h3><ul><li class="index"><a class="dark index" href="./loaders.html#loadFont">loadFont</a></li><li class="index"><a class="dark index" href="./loaders.html#loadImage">loadImage</a></li></ul></div></div>
<div class="modules" id="reactive"><div class="summary"><h3>classes</h3><ul><li class="index"><a class="dark index" href="./classes.html#class">class</a></li></ul></div><div class="summary"><h3>setting</h3><ul><li class="index"><a class="dark index" href="./setting.html#background">background</a></li><li class="index"><a class="dark index" href="./setting.html#fill">fill</a></li><li class="index"><a class="dark index" href="./setting.html#strokeWeight">strokeWeight</a></li><li class="index"><a class="dark index" href="./setting.html#noFill">noFill</a></li><li class="index"><a class="dark index" href="./setting.html#stroke">stroke</a></li><li class="index"><a class="dark index" href="./setting.html#noStroke">noStroke</a></li><li class="index"><a class="dark index" href="./setting.html#textSize">textSize</a></li><li class="index"><a class="dark index" href="./setting.html#textFont">textFont</a></li><li class="index"><a class="dark index" href="./setting.html#push">push</a></li><li class="index"><a class="dark index" href="./setting.html#pop">pop</a></li></ul></div><div class="summary"><h3>io</h3><ul><li class="index"><a class="dark index" href="./io.html#print">print</a></li></ul></div><div class="summary"><h3>mouse</h3><ul><li class="index"><a class="dark index" href="./mouse.html#mouseX">mouseX</a></li><li class="index"><a class="dark index" href="./mouse.html#mouseY">mouseY</a></li><li class="index"><a class="dark index" href="./mouse.html#mouseIsPressed">mouseIsPressed</a></li><li class="index"><a class="dark index" href="./mouse.html#mousePressed">mousePressed</a></li><li class="index"><a class="dark index" href="./mouse.html#mouseReleased">mouseReleased</a></li></ul></div><div class="summary"><h3>loaders</h3><ul><li class="index"><a class="dark index" href="./loaders.html#loadFont">loadFont</a></li><li class="index"><a class="dark index" href="./loaders.html#loadImage">loadImage</a></li></ul></div><div class="summary"><h3>math</h3><ul><li class="index"><a class="dark index" href="./math.html#round">round</a></li><li class="index"><a class="dark index" href="./math.html#floor">floor</a></li><li class="index"><a class="dark index" href="./math.html#ceil">ceil</a></li><li class="index"><a class="dark index" href="./math.html#sin">sin</a></li><li class="index"><a class="dark index" href="./math.html#cos">cos</a></li><li class="index"><a class="dark index" href="./math.html#tan">tan</a></li></ul></div><div class="summary"><h3>window</h3><ul><li class="index"><a class="dark index" href="./window.html#createWindow">createWindow</a></li><li class="index"><a class="dark index" href="./window.html#frameRate">frameRate</a></li><li class="index"><a class="dark index" href="./window.html#width">width</a></li><li class="index"><a class="dark index" href="./window.html#height">height</a></li><li class="index"><a class="dark index" href="./window.html#deltaTime">deltaTime</a></li></ul></div><div class="summary"><h3>shapes</h3><ul><li class="index"><a class="dark index" href="./shapes.html#circle">circle</a></li><li class="index"><a class="dark index" href="./shapes.html#rect">rect</a></li><li class="index"><a class="dark index" href="./shapes.html#square">square</a></li><li class="index"><a class="dark index" href="./shapes.html#line">line</a></li><li class="index"><a class="dark index" href="./shapes.html#quad">quad</a></li><li class="index"><a class="dark index" href="./shapes.html#text">text</a></li><li class="index"><a class="dark index" href="./shapes.html#image">image</a></li><li class="index"><a class="dark index" href="./shapes.html#point">point</a></li><li class="index"><a class="dark index" href="./shapes.html#arc">arc</a></li><li class="index"><a class="dark index" href="./shapes.html#ellipse">ellipse</a></li><li class="index"><a class="dark index" href="./shapes.html#triangle">triangle</a></li></ul></div><div class="summary"><h3>keyboard</h3><ul><li class="index"><a class="dark index" href="./keyboard.html#isKeyDown">isKeyDown</a></li><li class="index"><a class="dark index" href="./keyboard.html#keyPressed">keyPressed</a></li><li class="index"><a class="dark index" href="./keyboard.html#keyReleased">keyReleased</a></li><li class="index"><a class="dark index" href="./keyboard.html#keyHeld">keyHeld</a></li><li class="index"><a class="dark index" href="./keyboard.html#UP_ARROW">UP_ARROW</a></li><li class="index"><a class="dark index" href="./keyboard.html#DOWN_ARROW">DOWN_ARROW</a></li><li class="index"><a class="dark index" href="./keyboard.html#LEFT_ARROW">LEFT_ARROW</a></li><li class="index"><a class="dark index" href="./keyboard.html#RIGHT_ARROW">RIGHT_ARROW</a></li><li class="index"><a class="dark index" href="./keyboard.html#ENTER">ENTER</a></li><li class="index"><a class="dark index" href="./keyboard.html#BACKSPACE">BACKSPACE</a></li></ul></div></div>
</main>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/io.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="module">io</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>


Expand Down
18 changes: 16 additions & 2 deletions docs/keyboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,28 @@ <h1 class="module">keyboard</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>


<div class="method" id="isKeyDown"><div class="methodDeclaration"><code>isKeyDown(k);</code></div><p>Check if a keyboard key is pressed, returns <code class="inline">true</code> if key is down and returns <code class="inline">false</code> if it's not</p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">k</code><span class="text desc">The keyboard key to check</span></div></div><h4>Returns</h4><div class="param"><code class="name">boolean</code><span class="text desc">Whether or not the key is down</span></div><p></p><br/></div>
<div class="method" id="isKeyDown"><div class="methodDeclaration"><code>isKeyDown(k);</code></div><p>Check if a keyboard key is pressed, returns <code class="inline">true</code> if key is down and returns <code class="inline">false</code> if it's not</p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">k</code><span class="text desc">The keyboard key to check as a key global, or a string</span></div></div><h4>Returns</h4><div class="param"><code class="name">boolean</code><span class="text desc">Whether or not the key is down</span></div><p></p><pre><code class="language-lua"> -- Use a string
if (isKeyDown('a')) then
-- key 'a' is down
end

-- use a global
if (isKeyDown(LEFT_ARROW)) then
-- left arrow is down
end</code></pre><br/></div>
<div class="method" id="keyPressed"><div class="methodDeclaration"><code>keyPressed(key);</code><span class="decorator">Event</span></div><p>Called whenever a key is pressed.</p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">key</code><span class="text desc">The pressed key</span></div></div><p></p><br/></div>
<div class="method" id="keyReleased"><div class="methodDeclaration"><code>keyReleased(key);</code><span class="decorator">Event</span></div><p>Called whenever a key is released.</p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">key</code><span class="text desc">The released key</span></div></div><p></p><br/></div>
<div class="method" id="keyHeld"><div class="methodDeclaration"><code>keyHeld(key);</code><span class="decorator">Event</span></div><p>Called whenever a key is held down.</p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">key</code><span class="text desc">The held key</span></div></div><p></p><br/></div>
<div class="method" id="UP_ARROW"><div class="methodDeclaration"><code>UP_ARROW</code><span class="decorator">Global</span></div><p></p><p></p><br/></div>
<div class="method" id="DOWN_ARROW"><div class="methodDeclaration"><code>DOWN_ARROW</code><span class="decorator">Global</span></div><p></p><p></p><br/></div>
<div class="method" id="LEFT_ARROW"><div class="methodDeclaration"><code>LEFT_ARROW</code><span class="decorator">Global</span></div><p></p><p></p><br/></div>
<div class="method" id="RIGHT_ARROW"><div class="methodDeclaration"><code>RIGHT_ARROW</code><span class="decorator">Global</span></div><p></p><p></p><br/></div>
<div class="method" id="ENTER"><div class="methodDeclaration"><code>ENTER</code><span class="decorator">Global</span></div><p></p><p></p><br/></div>
<div class="method" id="BACKSPACE"><div class="methodDeclaration"><code>BACKSPACE</code><span class="decorator">Global</span></div><p></p><p></p><br/></div>
</main>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/loaders.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="module">loaders</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>


Expand Down
2 changes: 1 addition & 1 deletion docs/math.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="module">math</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>


Expand Down
2 changes: 1 addition & 1 deletion docs/mouse.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="module">mouse</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>


Expand Down
3 changes: 2 additions & 1 deletion docs/setting.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ <h1 class="module">setting</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>


<div class="method" id="background"><div class="methodDeclaration"><code>background(r, g, b, a);</code></div><p>Clear a background with a color</p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">r</code><span class="text desc">The red byte</span></div><div class="param"><code class="name">g</code><span class="text desc">The green byte</span></div><div class="param"><code class="name">b</code><span class="text desc">The blue byte</span></div><div class="param"><code class="name">a</code><span class="text desc">The alpha byte</span></div></div><p></p><br/></div>
<div class="method" id="fill"><div class="methodDeclaration"><code>fill(r, g, b, [a]);</code></div><p>Set the fill color for shapes</p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">r</code><span class="text desc">The red byte</span></div><div class="param"><code class="name">g</code><span class="text desc">The green byte</span></div><div class="param"><code class="name">b</code><span class="text desc">The blue byte</span></div><div class="param"><code class="name">[a]</code><span class="text desc">The alpha byte</span></div></div><p>Can also accept a hexadecimal or color name as string</p><pre><code class="language-lua"> fill(255, 150, 40);
square(200, 200, 64);</code></pre><br/></div>
<div class="method" id="strokeWeight"><div class="methodDeclaration"><code>strokeWeight(weight);</code></div><p></p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">weight</code><span class="text desc">The line width in pixels</span></div></div><p></p><pre><code class="language-lua"> strokeWeight(8);
Expand Down
2 changes: 1 addition & 1 deletion docs/shapes.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="module">shapes</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>


Expand Down
23 changes: 10 additions & 13 deletions docs/window.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="module">window</h1>
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/>
</button>

<span class="text version">v0.0.3</span>
<span class="text version">v0.0.4</span>
</header>


Expand All @@ -40,21 +40,18 @@ <h1 class="module">window</h1>
function draw()
-- draw things
end</code></pre><br/></div>
<div class="method" id="background"><div class="methodDeclaration"><code>background(r, g, b, a);</code></div><p>Clear a background with a color</p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">r</code><span class="text desc">The red byte</span></div><div class="param"><code class="name">g</code><span class="text desc">The green byte</span></div><div class="param"><code class="name">b</code><span class="text desc">The blue byte</span></div><div class="param"><code class="name">a</code><span class="text desc">The alpha byte</span></div></div><p></p><br/></div>
<div class="method" id="frameRate"><div class="methodDeclaration"><code>frameRate(fps);</code></div><p>Set the frame rate </p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">fps</code><span class="text desc">The frame rate to set</span></div></div><p>If frame rate is called without an argument, it will return frame per seconds </p><pre><code class="language-lua"> x = 0;
<div class="method" id="frameRate"><div class="methodDeclaration"><code>frameRate</code><span class="decorator">Global</span></div><p>The window's width in pixels. If no window was created, this value is <code class="inline">nil</code></p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">fps</code><span class="text desc">The frame rate to set</span></div></div><p>If frame rate is called without an argument, it will return frame per seconds </p><pre><code class="language-lua"> createWindow(800, 600);

function setup()
createWindow(400, 400);
frameRate(24);
end
print(width);
-- 800</code></pre><br/></div>
<div class="method" id="width"><div class="methodDeclaration"><code>width</code><span class="decorator">Global</span></div><p>The window's width in pixels. If no window was created, this value is <code class="inline">nil</code></p><p></p><pre><code class="language-lua"> createWindow(800, 600);

function draw()
background(51);
text('fps: ' .. frameRate(), 20, 10);
print(width);
-- 800</code></pre><br/></div>
<div class="method" id="height"><div class="methodDeclaration"><code>height</code><span class="decorator">Global</span></div><p>The window's height in pixels. If no window was created, this value is <code class="inline">nil</code></p><p></p><pre><code class="language-lua"> createWindow(800, 600);

circle(x, 200, 32);
x = x + 1;
end</code></pre><br/></div>
print(height);
-- 600</code></pre><br/></div>
<div class="method" id="deltaTime"><div class="methodDeclaration"><code>deltaTime</code><span class="decorator">Global</span></div><p>Elapsed time since the last draw call in seconds</p><p></p><pre><code class="language-lua"> x = 0;
vx = 128;

Expand Down

0 comments on commit c880b7d

Please sign in to comment.