|
Author |
Topic: image() (Read 253 times) |
|
capeta
|
image()
« on: Nov 12th, 2004, 5:43am » |
|
Hi, sorry for this newbie question. But if you help me out i will be very happy. Im just starting out with processing, and i want to build a game prototype (just to learn) but right when i started i found myself in a situation Here is the code (simple) // size of the application (pixels) int appWidth = 400; int appHeight = 525; // size of the ship (pixels) int shipWidth = 60; int shipHeight = 62; // initial position of the ship int shipInitX = 170; int shipInitY = 462; // properties BImage sprites; void setup() { size( appWidth, appHeight ); sprites = new BImage(); sprites = loadImage( "ship01.gif" ); } void loop() { image( sprites, shipInitX, shipInitY ); } it seems that loop is creating a lot of images (and fucking up the program) instead of updating the one that already extits... if i move the image upwards, it looks like a lot of images are behind one pixel i may have to clear out everything and create again ? if so, how could i do that ? help me out
|
|
|
|
fjen
|
Re: image()
« Reply #1 on: Nov 12th, 2004, 6:39am » |
|
read cello's explanation of how to think about the "drawing-area" and loop() here. look for chalkboard ... the images you see are the images you've drawn (in the loops) before. you need to do the "updating" yourself by (for example) using background(). /F
|
« Last Edit: Nov 12th, 2004, 6:40am by fjen » |
|
|
|
|
capeta
|
Re: image()
« Reply #2 on: Nov 12th, 2004, 5:18pm » |
|
thank you! im using background and its clearing all before images! thank you very much! im starting to love processing.
|
|
|
|
|