Created
October 2, 2015 15:24
-
-
Save chrisallick/c5f4112f30b2e9ef790a to your computer and use it in GitHub Desktop.
Loading An Image & Drawing an Image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var img; | |
| function setup() { | |
| createCanvas(640, 480); | |
| img = loadImage( "kitten.png" ); | |
| background( 255 ); | |
| } | |
| function draw() { | |
| if( mouseIsPressed ){ | |
| image( img, mouseX-(img.width/2), mouseY-(img.height/2) ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment