diff --git a/docs/assets/style.css b/docs/assets/style.css index 0b9f249f..62454570 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -1 +1 @@ -:root{--dark:#461164;--primary:#AA36EF;--lighter:#d49af7;--white:#efefef}::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background:rgba(0,0,0,0)}::-webkit-scrollbar-thumb{background:var(--primary)}::-webkit-scrollbar-thumb:hover{background:var(--dark)}code.inline{border-radius:4px;background-color:#dfd4ff;padding:0.1em}html,body{width:100%;height:100%;margin:0px;background-color:var(--white)}body{display:flex;flex-direction:row;justify-content:flex-start;min-height:100%;height:fit-content}a,p,span.text,h1,h2,h3,h4,h5,h6{font-family:"Trebuchet MS",Tahoma,sans-serif}ul{list-style-type:none;margin:0px;padding:0px}li:not(:last-child){padding-bottom:12px}.method{padding-top:2rem}.btn{padding-left:0.5rem}.light{color:var(--white)}.btn.light > a > h4{color:var(--white)}.btn:hover > a > h4,.btn:active > a > h4{color:var(--dark);transition:0.1s}code,pre{font-family:inconsolata,lucida console,monospace}header{width:100%;display:flex;flex-direction:row;align-items:baseline;gap:0.9rem;flex-wrap:wrap}.modules{display:flex;flex-wrap:wrap;width:76%;gap:3.5rem}a{text-decoration:none}a:visited{text-decoration:none}.version{color:var(--dark);position:relative;top:-0.25em;left:-0.25em}main{padding:1.8em;height:fit-content;width:100%;display:flex;flex-direction:column;gap:0rem}.summary{min-width:8em}h1.module{position:relative;top:-0.25em;color:var(--primary);font-weight:bold;font-size:26pt}pre code.hljs{padding:1em;max-width:100%;font-size:10pt}.modules{margin-right:auto;margin-left:auto}.modules.open{margin-right:10.2rem;margin-left:2em}@media (min-width:900px){.modules{margin-right:auto;margin-left:auto}.modules.open{margin-right:auto;margin-left:auto}main > .method{padding-left:10%}h1.module{font-size:32pt}pre code.hljs{padding:1em 6em 1em 1em;max-width:38em;width:fit-content;font-size:13pt}}.param{display:flex;gap:1rem;margin:0.2rem;vertical-align:middle;align-items:flex-start}.method{max-width:87.5%}.method > code{font-size:16pt}.menuBtn{position:fixed;top:45dvh;right:-3.5em;width:7em;border-radius:49%;height:7em;border:none;outline:none;background-color:var(--primary)}.menuBtn > img{position:relative;left:-1.5em}.nav{background-color:var(--primary);position:fixed;min-width:10em;min-height:100%;position:fixed;padding:1.6rem;display:flex;flex-direction:column;right:calc(-100%);z-index:10}.nav.open{right:0px} \ No newline at end of file +:root{--dark:#461164;--primary:#AA36EF;--lighter:#d49af7;--white:#efefef}::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background:rgba(0,0,0,0)}::-webkit-scrollbar-thumb{background:var(--primary)}::-webkit-scrollbar-thumb:hover{background:var(--dark)}code.inline{border-radius:4px;background-color:#dfd4ff;padding:0.1em}html,body{width:100%;height:100%;margin:0px;background-color:var(--white)}body{display:flex;flex-direction:row;justify-content:flex-start;min-height:100%;height:fit-content}a,p,span.text,span.decorator,h1,h2,h3,h4,h5,h6{font-family:"Trebuchet MS",Tahoma,sans-serif}.decorator{font-size:18pt;border-radius:6px;color:var(--white);font-weight:bold;background-color:var(--primary);margin:0 2.5rem;padding:0.2em 0.4em}ul{list-style-type:none;margin:0px;padding:0px}li:not(:last-child){padding-bottom:12px}.method{padding-top:2rem}.btn{padding-left:0.5rem}.light{color:var(--white)}.btn.light > a > h4{color:var(--white)}.btn:hover > a > h4,.btn:active > a > h4{color:var(--dark);transition:0.1s}code,pre{font-family:inconsolata,lucida console,monospace}header{width:100%;display:flex;flex-direction:row;align-items:baseline;gap:0.9rem;flex-wrap:wrap}.modules{display:flex;flex-wrap:wrap;width:76%;gap:3.5rem}a{text-decoration:none}a:visited{text-decoration:none}.version{color:var(--dark);position:relative;top:-0.25em;left:-0.25em}main{padding:1.8em;height:fit-content;width:100%;display:flex;flex-direction:column;gap:0rem}.summary{min-width:8em}h1.module{position:relative;top:-0.25em;color:var(--primary);font-weight:bold;font-size:26pt}pre code.hljs{padding:1em;max-width:100%;font-size:10pt}.modules{margin-right:auto;margin-left:auto}.modules.open{margin-right:10.2rem;margin-left:2em}@media (min-width:900px){.modules{margin-right:auto;margin-left:auto}.modules.open{margin-right:auto;margin-left:auto}main > .method{padding-left:10%}h1.module{font-size:32pt}pre code.hljs{padding:1em 6em 1em 1em;max-width:38em;width:fit-content;font-size:13pt}}.param{display:flex;gap:1rem;margin:0.2rem;vertical-align:middle;align-items:flex-start}.method{max-width:87.5%}.method > div > code{font-size:16pt}.menuBtn{position:fixed;top:45dvh;right:-3.5em;width:7em;border-radius:49%;height:7em;border:none;outline:none;background-color:var(--primary)}.menuBtn > img{position:relative;left:-1.5em}.nav{background-color:var(--primary);position:fixed;min-width:10em;min-height:100%;position:fixed;padding:1.6rem;display:flex;flex-direction:column;right:calc(-100%);z-index:10}.nav.open{right:0px} \ No newline at end of file diff --git a/docs/events.html b/docs/events.html index ba04a930..1670c22c 100644 --- a/docs/events.html +++ b/docs/events.html @@ -32,8 +32,55 @@
isKeyDown(k);
Check if a keyboard key is pressed, returns true
if key is down and returns false
if it's not
k
The keyboard key to check
+isKeyDown(k);
Check if a keyboard key is pressed, returns true
if key is down and returns false
if it's not
k
The keyboard key to check
boolean
Whether or not the key is downmousePressed(button);
EventCalled when a mouse button is pressed.
button
The pressed mouse button
+
+In the following example, the circle's size increases when the user clicks the mouse.
size = 0;
+
+ function setup()
+ createWindow(400, 400);
+ end
+
+ function draw()
+ background(51);
+
+ circle(mouseX, mouseY, size);
+ end
+
+ -- Increase circle size when mouse pressed
+ function mousePressed()
+ size = size + 1;
+ end
mouseReleased(button);
EventCalled when a mouse button is released.
button
The released mouse button
+
+In the following example, the circle's size increases when the user clicks the mouse.
size = 32;
+
+ function setup()
+ createWindow(400, 400);
+ end
+
+ function draw()
+ background(51);
+
+ circle(mouseX, mouseY, size);
+ end
+
+ -- Set larger circle size
+ function mousePressed()
+ size = 64;
+ end
+
+ -- Reset size
+ function mouseReleased()
+ size = 32;
+ end
keyPressed(key);
EventCalled whenever a key is pressed.
key
The pressed key
+keyReleased(key);
EventCalled whenever a key is released.
key
The released key
+keyHeld(key);
EventCalled whenever a key is held down.
key
The held key
+