> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.X9ryh2E$R7n/rev.21
 * 
 * authors: 
 *   Natalia Valencia

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



/* @pjs preload="/static/uploaded_resources/p.14209/snowy.jpg"; */
/* @pjs preload="/static/uploaded_resources/p.14209/logo.jpeg"; */

PImage t;
PImage l;

TITULO titulo;
BACKSTORY backstory;
BOLITAS bolitas;

void setup()
{
size (500,500);
background (255);
t = loadImage("/static/uploaded_resources/p.14209/snowy.jpg");
l = loadImage("/static/uploaded_resources/p.14209/logo.jpeg");

titulo = new TITULO();
backstory = new BACKSTORY();



}

void draw()
{
  
background (255,10);
image(t,0,0,width,400);
image(l,0,0);
  
titulo.escribir();
titulo.mover();

backstory.escribir();
backstory.mover();

}

class BACKSTORY
{
  float posx;
  float posy;
  int velx;
  String mensajeVisible;
  String[] mensaje;
  int numeroVisible;
  PFont f;
  PImage tin;

BACKSTORY()
  {
    mensaje = loadStrings("/static/uploaded_resources/p.14209/tin.txt");
    f = loadFont("HelveticaCY-Oblique-50.vlw");
    posx = width;
    velx = -1;
    posy = 470;
    mensajeVisible = mensaje[numeroVisible];
  }

  void escribir()
  {
    textFont(f, 40);
    fill(0,100);
    text(mensajeVisible, posx, posy);
  }
  
  void mover()
    {
    posx = posx + velx;
    if (posx < 0 - textWidth(mensajeVisible))
    { 
      posx = width;
    }
  }
}


class BOLITAS
{
int posx; 
int posy; 


BOLITAS()
  {
size (500,500);
background (0);

posx = 600;
posy = 600;
  }

  void dibujar()
  {
    fill (random (255), random (255), random (255), 150);
  ellipse (random (posx), random (posy), 20, 20);
  noStroke();
  }
  
  void mousePressed ()
    {
    background (random (255), random (255), random (255));
  }
}

class TITULO

{
int posx;
int posy;
int velx;
String mensajeVisible;
String [] mensaje;
int numeroVisible;
PFont f;
PImage p;


TITULO()
{
  mensaje= loadStrings("/static/uploaded_resources/p.14209/titulo.txt");
  
  f   = loadFont("Helvetica-Bold-100.vlw");
  posx = width;
  posy = 450;
  velx = -4;
  numeroVisible = 0;
  mensajeVisible= mensaje[numeroVisible];
  
  
}



void escribir()
{
textAlign (LEFT);
textFont(f,75);
fill(random (255),random (255),random (255), 100);
text(mensajeVisible,posx,posy);
}


void mover()
 {
    posx = posx + velx;
    if (posx < 0 - textWidth(mensajeVisible))
    { 
      posx = width;
}
}
}