We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Noob needs help with PNG File
Page Index Toggle Pages: 1
Noob needs help with PNG File (Read 810 times)
Noob needs help with PNG File
Jul 21st, 2009, 4:12pm
 
Hello everyone, I hope that someone will be able to help me out. I Have a very long image in a PNG file format that I'm using to scroll across a 640 x 480 screen. I'm just using Three lines of code to achieve this:

float a = 640
a = (a - 2.1)
image(PNG_image,a,320)

the problem that I'm having is that the image slow down a bit when it reaches the 0 mark on the x Axis. Cry I'm not sure how to fix it. I think I should split up the image into an array of images but I'm not sure if the images that leave the screen would free up the ram. Could someone let me know if the method I'm using to move the image across the screen is the right way to go or is there a better way to do it?  

Thank everyone in advance.
Re: Noob needs help with PNG File
Reply #1 - Jul 22nd, 2009, 1:10am
 
Hard to tell with three lines of code.
Do you check the limit of a (when it becomes negative).
How much it slows down? Starting at which value of a?
I don't see how multiple images would improve the process, since you do a smooth scrolling.
Re: Noob needs help with PNG File
Reply #2 - Jul 22nd, 2009, 10:12am
 
Thanks for the reply,

Your comment about the state of a when it's a negative got me thinking let me try something and I'll get back to you.
Page Index Toggle Pages: 1