Skip to content

Commit

Permalink
Add Kevin
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Dec 15, 2024
1 parent c642c2b commit a6487b0
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/verksamheter/20241214_julkort/julkort/julkort.pde
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ PImage heMask;
PGraphics lrVid;
PGraphics heVid;

// Kevin
import gifAnimation.*;
Gif train;
PImage trainbg;

float malekX = 610;
float malekgron = 0;

Expand All @@ -44,6 +49,12 @@ void setup_herman()
herman_julgran = loadImage("herman_julgran.png");
}

void setup_kevin(){
trainbg = loadImage("trainbg.png");
train = new Gif(this, "lokanimation.gif");
train.play();
}

void setup_leonid()
{
heMask = createImage(800,800,ALPHA);
Expand Down Expand Up @@ -74,6 +85,7 @@ void setup()
size(800, 800);
setup_felipe();
setup_herman();
setup_kevin();
setup_leonid();
setup_pablo();
}
Expand Down Expand Up @@ -264,6 +276,13 @@ colorMode(RGB, 255);
//image(lrMask,0,0);
}

void draw_kevin(){
fill(0,145,235);
rect(600,0,200,200);
image(trainbg,600,0);
image(train, 600, 25);
}

void draw_malek()
{
stroke(malekX - 200, malekgron, random(256));
Expand Down Expand Up @@ -292,6 +311,7 @@ void draw()
draw_enrico();
draw_felipe();
draw_herman();
draw_kevin();
draw_leonid();
draw_malek();
draw_pablo();
Expand Down
61 changes: 61 additions & 0 deletions docs/verksamheter/20241214_julkort/julkort/uvmaps.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* En klass som kan hantera en bildfil som är 128 x 256 pixlar stor.
* Varje delbild är 64 x 64 pixlar stor.
*
* Efter att objektet är skapat med eb bildfil som input så kan man hämta
* varje delbild genom att anropa bild(x) där x är 0 - 199
*
* Exempel:
*
* UVMap bilder = new UIMap("min_bildfil.png");
* PImage bild_10 = bilder.bild(10);
*/
class UVMap {
PImage bild;

/**
* Skapa en bildkarta av den angivna filen
*/
public UVMap(String filnamn) {
bild = loadImage(filnamn);
}

/**
* Returnera en specifik del av bilden
*/
public PImage bild(int bildId, int yy) {
PImage b;

int x = (bildId % 10) * 32;
int y = (bildId / 10) * 32;
b = createImage(32, 32, RGB);
b = bild.get(x, y, 32, yy);

return b;
}

/**
* Returnerar en tom bild med bara ett rutnät för alla individuella bilder.
*/
public PImage tomBild() {
PGraphics pg = null;

pg = createGraphics(128, 256);
pg.beginDraw();
pg.background(255);
pg.stroke(0);
for (int x = 0; x < 11; x++) {
if (x > 0) {
pg.line(x*32, 0, x*32, 900);
}
}
for (int y = 0; y < 32; y++) {
if (y > 0) {
pg.line(0, y*32, 1200, y*32);
}
}
pg.endDraw();

return pg;
}
}

0 comments on commit a6487b0

Please sign in to comment.