Commits

Anonymous committed a7bff72

new example with data

  • Participants
  • Parent commits 8631a8c

Comments (0)

Files changed (4)

bottle.pyc

Binary file added.

config.pyc

Binary file added.

pjs/data/above_by_firemisha.jpg

Added
New image
+// image manipulate
+/* @pjs preload="data/above_by_firemisha.jpg"; */
+PImage img;
+
+void setup() {
+    size(320, 480);
+    img = loadImage("data/above_by_firemisha.jpg");
+    image(img, 0, 0);
+}
+
+// current tile, each tile is 16x16
+int tx = 0;
+int ty = 0;
+
+// shuffle
+void draw() {
+    // select a random tile on canvas
+    tx = int(random(20)) * 16;
+    ty = int(random(30)) * 16;
+    // copy a random tile to canvas
+    copy(img, random(600), random(460), 16, 16, tx, ty, 16, 16);
+    // a weird bug here
+    // copy affected the alpha value of other parts of the image maybe
+}
+
+