-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8c3e2b
commit b66d37c
Showing
9 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
|
||
<link rel="stylesheet" href="./assets/style.css" /> | ||
<script type="text/javascript" src="./assets/index.js"></script> | ||
|
||
<link rel="stylesheet" href="./assets/lu5-hljs-theme.css"> | ||
<script src="./assets/hljs.min.js"></script> | ||
|
||
<script>hljs.highlightAll();</script> | ||
|
||
<title>classes | Documentation</title> | ||
</head> | ||
<body> | ||
<div class="nav" id="menu"> | ||
<br/> | ||
<ul><li class="btn"><a class="light" href="./window.html"><h4>window</h4></a></li><li class="btn"><a class="light" href="./shapes.html"><h4>shapes</h4></a></li><li class="btn"><a class="light" href="./setting.html"><h4>setting</h4></a></li><li class="btn"><a class="light" href="./math.html"><h4>math</h4></a></li><li class="btn"><a class="light" href="./loaders.html"><h4>loaders</h4></a></li><li class="btn"><a class="light" href="./io.html"><h4>io</h4></a></li><li class="btn"><a class="light" href="./events.html"><h4>events</h4></a></li><li class="btn"><a class="light" href="./classes.html"><h4>classes</h4></a></li></ul> | ||
</div> | ||
<main> | ||
<header> | ||
<a href="./"><img width="100px" src="./assets/logo.svg"/></a> | ||
<h1 class="module">classes</h1> | ||
<button class="menuBtn" onclick="toggleMenu()"> | ||
<img class="menuIcon" width="40px" src="./assets/arrow_left.svg"/> | ||
</button> | ||
|
||
<span class="text version">v0.0.3</span> | ||
</header> | ||
|
||
|
||
<div class="method" id="class"><div class="methodDeclaration"><code>class(name);</code></div><p>Create a metatable</p><h4>Arguments</h4><div class="params"><div class="param"><code class="name">name</code><span class="text desc">The class name | ||
</span></div></div><p></p><pre><code class="language-lua"> local Player = class('Player'); | ||
|
||
function Player:init(x, y) | ||
self.x = x; | ||
self.y = y; | ||
return self; | ||
end | ||
|
||
function Player:draw() | ||
circle(self.x, self.y, 16); | ||
end | ||
|
||
|
||
-- Create 2 players and draw them | ||
local p1 = Player:new(100, 200); | ||
local p2 = Player:new(300, 200); | ||
|
||
function setup() | ||
createWindow(400, 400); | ||
end | ||
|
||
function draw() | ||
background(51); | ||
|
||
p1:draw(); | ||
p2:draw(); | ||
end</code></pre><br/></div> | ||
</main> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters