Drag and drop problem...Solved

For questions about using Classic.

Post » Wed Aug 24, 2011 10:07 pm

What am i doing wrong with this event?
The round sprites dont seem to position correctly to the mouse?

+ Powerups: Is Dragging
-> Powerups: Set position to (Int(MouseX/32)*32), (Int(MouseY/32)*32)



cap

Thanks in advancechrisbrobs2011-08-24 23:23:02
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Wed Aug 24, 2011 10:22 pm

Um your upper cells appear to be about 48 pixels apart? So the 32px rounding doesn't quite match it?

I guess you could do a separate rounding on drop and/or if the things overlap the rocket?

B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Wed Aug 24, 2011 10:49 pm

[QUOTE=Somebody] Um your upper cells appear to be about 48 pixels apart? So the 32px rounding doesn't quite match it?

I guess you could do a separate rounding on drop and/or if the things overlap the rocket?

[/QUOTE]

Thanks Somebody
God I am thick!...BUT... The sprites DONT stay 'centre mouse' while dragging, they seem to be out of sync?
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Wed Aug 24, 2011 10:59 pm

Try: (ceil(MouseX/32)*32) instead of int(). Produces nice results here.

Edit: Actually try this:



Seems to work very nicely.Somebody2011-08-24 23:06:19
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Wed Aug 24, 2011 11:21 pm

[QUOTE=Somebody] Try: (ceil(MouseX/32)*32) instead of int(). Produces nice results here.

Edit: Actually try this:



Seems to work very nicely.[/QUOTE]

--------------------------------------------

Problem solved.

Thanks for the solution
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Wed Aug 24, 2011 11:25 pm

Ceil's changed for the next release. Not sure if it would break anything there tho.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Wed Aug 24, 2011 11:32 pm

Say what now!

New release!

Hell's Teeth
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,841
Reputation: 48,283

Post » Thu Aug 25, 2011 1:07 am

[QUOTE=newt] Ceil's changed for the NEXT RELEASE. Not sure if it would break anything there tho.[/QUOTE]



"The reports of CC's death are greatly exaggerated"
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Thu Aug 25, 2011 6:52 am

Yeah, well, Rojo made that fix right after this previous release.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests