Skip to content

Instantly share code, notes, and snippets.

View KrabCode's full-sized avatar
⚖️
maintaining LazyGui

Jakub Rak KrabCode

⚖️
maintaining LazyGui
  • Prague, Czech Republic
  • 11:41 (UTC +01:00)
View GitHub Profile
@KrabCode
KrabCode / RecursiveBox.pde
Last active February 23, 2024 21:04
Recursive textured box. Runs on android using APDE.
int bgTop = 20;
int bgBot = 230;
PImage tex;
float sx, sy;
PMatrix3D mouseRotation = new PMatrix3D();
void mouseRotate() {
float x = mouseX - pmouseX;
float y = mouseY - pmouseY;
float drag = 0.98;
float prevX = 400;
float prevY = 400;
float dir = 0;
float off;
int imgSize = 120;
PImage img;
float bgColor = 30;
@KrabCode
KrabCode / DashedCircles.pde
Created January 11, 2024 15:10
Rotating concentric lines. Original solution to the dashed circle problem is by nking.
void setup() {
size(640, 640, P2D);
smooth(8);
strokeCap(SQUARE);
}
void draw() {
background(100);
translate(width/2, height/2);
@KrabCode
KrabCode / TimerWithLazyGui.pde
Last active December 18, 2023 14:50
the timer is active when clickStartedMillis is > 0, and stopped when it is -1
import com.krab.lazy.*;
LazyGui gui;
long clickStartedMillis = -1;
String currentTime;
String endTime = "";
PFont bigFont, smallFont;
@KrabCode
KrabCode / SixtyFour.pde
Created December 14, 2023 09:23
Basis for coloring a dot matrix of 64 x 64 points.
import com.krab.lazy.*;
int cols = 64;
int rows = 64;
LazyGui gui;
void setup() {
size(1280, 1280, P2D);
gui = new LazyGui(this, new LazyGuiSettings().setLoadLatestSaveOnStartup(false));
rectMode(CENTER);
@KrabCode
KrabCode / Cog.pde
Last active December 13, 2023 15:59
import com.krab.lazy.*;
LazyGui gui;
void setup() {
size(1200, 800, P3D);
smooth(8);
gui = new LazyGui(this);
}
@KrabCode
KrabCode / image_alpha_mask.pde
Created December 4, 2023 13:00
Two images drawn on top of one another where drawing to the foreground one gradually reveals the background by removing the alpha of the foreground.
PImage bg;
PImage fg;
PGraphics pg;
int brushRadius = 30;
void setup() {
size(800, 600, P2D);
smooth(2);
bg = loadImage("https://wallpapersmug.com/download/800x600/05bf15/galaxy-space-fantasy-art.jpg");
fg = loadImage("https://images.wallpaperscraft.com/image/single/beautiful_scenery_mountains_lake_93318_800x600.jpg");
import com.krab.lazy.*;
LazyGui gui;
PFont font;
int fontSize = -1;
void setup() {
fullScreen(P2D, 0);
gui = new LazyGui(this, new LazyGuiSettings()
.setLoadLatestSaveOnStartup(true)
import java.util.UUID;
ArrayList<P> ps = new ArrayList<P>();
int pointCount = 1000;
PImage source;
private float t;
private int framesToCapture = 300;
private int captureStart = -1;
String id = "";
int freq = 49;
int num = 128; // column and row count
int darkColor = 36;
int litColor = 200;
void setup() {
fullScreen(P2D);
noStroke();
// set sane default input
mouseX = width/2;