Skip to content

Instantly share code, notes, and snippets.

@alisonpope
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alisonpope/18bd555aa750d1c88b7e to your computer and use it in GitHub Desktop.
Save alisonpope/18bd555aa750d1c88b7e to your computer and use it in GitHub Desktop.
Data Visualisation Course Week 2
// Draws a small image at the current mouse position.
// Jo Wood, 3rd February, 2015
// Modified by Alison Pope, 6 February, 2015
// Simple Processing sketch that loads an image of me that
// moves around the screen.
PImage img;
void setup()
{
size(400,320);
// Load the image from a local file.
img = loadImage("https://ajpcv.files.wordpress.com/2014/08/profilepic_50.jpg");
// Position image so it is centred at the given coordinates.
imageMode(CENTER);
}
void draw()
{
background(255);
// Draw the image centred on the current mouse position.
image(img,mouseX,mouseY);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment