Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.