Built with processing

From Digipool-Wiki
Revision as of 18:20, 13 March 2013 by WikiSysop (Talk | contribs)

Jump to: navigation, search

Simple Slide Show

Eine ganz einfache schlichte Slide-Show-App für alle Fälle.

Status

  • Computer App – läuft
  • Web App - läuft
  • Android App – in Arbeit
  • Automatisches Auslesen von Ordnern mit original Dateiname - in Arbeit


<source lang="java">

// simple slide show // www.olafval.de

int iMax = 112; // Number of the last image in the images folder int sSpeed = 4000; // slide show speed - time of each slide in milis

PImage i; int iN=101; // current image number String iNS; int sTimer;

void setup(){

 size(640, 640);
 i = requestImage("images/101.jpg");     // <-- use full path relativ from web-page (not relativ to processing-file) 

}

void draw(){

 image(i,0,0);

//load next image

 if(sTimer + sSpeed < millis() ){
   sTimer = millis();
   iN = iN + 1;
   if(iN > iMax) iN = 101;
   iNS = new String(iN);                                                          // <-- use this als online app
   i = loadImage("images/" + iNS + ".jpg");                             // <-- use this als online app -- and use full path relativ from web-page 
   // i = loadImage("images/" + String.valueOf(iN) + ".jpg");  // <-- use this als offline app  
 }

}

</source>

Color ABC

Mit dier App kann man jedem Buchstaben des Alphabets eine Farbe zuordnen und Texte dann mit diesem Farbe-Code anzeigen bzw. lesen.

Status

  • Farbzuordnung funktioniert
  • Textanzeige ist noch nicht implementiert
  • Läuft nur als App auf dem Computer nicht im Web oder auf Android


<source lang = "java"> // color_abc

PFont meineSchrift; PImage farben;

int fontSize = 50; int pos = 0;

char abc1[] = {

 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M'

}; char abc2[] = {

 'M', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'

};

color[] col1 = new color[26]; int modus = 0; // 0=calect letter, 1=select color, 2=display text int mause = 0; // mouse releast int nummer = 0; // letter number

void setup() {

 size(800, 480);
 //size(480, 800);
 meineSchrift = loadFont("AUdimat-Regular-48.vlw");
 // basic color black
 for (int f=0; f<26; f++) {
   col1[f] = color(0);
 }
 farben = requestImage("data/colors.jpg");

}

void draw() {

 if (modus == 0) {  // select letter
   background(255);
   fill(0);
   textFont(meineSchrift, fontSize);


   // A - M
   pos = 0;
   for (int f=0; f<13; f++) {
     pos += width / 15;
     fill(col1[f]);
     text(abc1[f], pos, height/2 - fontSize);
     // hitbox
     if (mousePressed == true) {
       if ( (mouseX>pos)&&(mouseX<pos+width/15)&&(mouseY>height/2 - (fontSize*2) )&&(mouseY<height/2 - fontSize) ) {
         nummer = f;
         if (mause == 0) {
           modus = 1;
           mause = 1;
         }
       }
     }
   }
   // N - Z
   pos = 0;
   for (int f=0; f<13; f++) {
     pos += width / 15;
     fill(col1[f+13]);
     text(abc2[f], pos, height/2 + fontSize);
     // hitbox
     if (mousePressed == true) {
       if ( (mouseX>pos)&&(mouseX<pos+width/15)&&(mouseY<height/2 + fontSize )&&(mouseY>height/2) ) {
         nummer = f+13;
         if (mause == 0) {
           modus = 1;
           mause = 1;
         }
       }
     }
   }
 }
 // zeige Farben
 if (modus == 1) { // select color
   image(farben, 0, 0, width, height);
   if ( (mousePressed == true) && (mause == 0) ) {
     col1[nummer] = get(mouseX, mouseY);
     modus = 0;
     mause = 1;
   }
 }
 if (mousePressed == false) {
   mause = 0;
 }

} </source>