shithub: slug

Download patch

ref: b15fb818047915f39d1b37032ff4f77146c8f4e6
parent: 91b4d55d9d9c71eb7144ed8c905c417ee737f735
author: phil9 <telephil9@gmail.com>
date: Fri Dec 2 08:52:46 EST 2022

added some samples

diff: cannot open b/samples//null: file does not exist: 'b/samples//null'
--- /dev/null
+++ b/samples/mouse.lua
@@ -1,0 +1,14 @@
+#!/bin/slug
+
+function setup()
+	size(600, 600)
+end
+
+function draw()
+	background(0)
+	translate(width/2, height/2)
+	stroke(255)
+	strokeWidth(5)
+	line(0, 0, mouseX, mouseY)
+end
+
--- /dev/null
+++ b/samples/pushmatrix.lua
@@ -1,0 +1,22 @@
+#!/bin/slug
+
+function setup()
+	size(400, 400)
+end
+
+function draw()
+	background(150)
+
+	fill(255)
+	rect(0, 0, 200, 200)
+
+	pushMatrix()
+	transpose(120, 80)
+	fill(0)  
+	rect(0, 0, 200, 200)
+	popMatrix()
+
+	fill(100)  
+	rect(60, 40, 200, 200)
+end
+
--- /dev/null
+++ b/samples/pushstyle.lua
@@ -1,0 +1,19 @@
+#!/bin/slug
+
+function setup()
+	size(400, 400)
+end
+
+function draw()
+	background(200)
+	ellipse(0, 200, 132, 132)
+
+	pushStyle()
+	strokeWeight(40)
+	fill(204, 153, 0)
+	ellipse(200, 200, 132, 132)
+	popStyle()
+
+	ellipse(400, 200, 132, 132)
+end
+