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 › Displaying 'Correct' image in drag and drop array
Pages: 1 2 
Displaying 'Correct' image in drag and drop array (Read 3240 times)
Re: Displaying 'Correct' image in drag and drop array
Reply #15 - Nov 9th, 2009, 12:42pm
 
The code is much better, though you could trim some of the blank lines Wink

I'm guessing your first language isn't English: I think you misunderstood my use of the word 'Reference' (follow the link below Wink )

If you look at rect() you'll find what's wrong with this:

Code:
class Box {
// <snip />

void Draw() {
                rect(x,y, h, w);
     
     }


...and that should explain why it's not working as you expect.
Re: Displaying 'Correct' image in drag and drop array
Reply #16 - Nov 9th, 2009, 1:05pm
 
Is it to do with the h and w co-ordinates?

Is the sprite recognizing  the next box as well a correct value? Taking in much of a y co-ordinate?
Re: Displaying 'Correct' image in drag and drop array
Reply #17 - Nov 9th, 2009, 1:11pm
 
Roll Eyes

rect()

"Syntax: rect(x, y, width, height)"

Your code:

void Draw() {
   rect(x,y, h, w);
}

Fix it, then look at where your boxes actually are...
Re: Displaying 'Correct' image in drag and drop array
Reply #18 - Nov 9th, 2009, 1:15pm
 
Oh right! Thanks man it works perfectly now.
Pages: 1 2