The Daily Click ::. Forums ::. Klik Coding Help ::. Paste into background issue
 

Post Reply  Post Oekaki 
 

Posted By Message

Dynamite



Registered
  18/12/2007
Points
  131

Wii Owner
16th October, 2008 at 12:26:08 -

I have an object that always set's its position to the X and Y of the mouse. I made it so repeat while user clicks: Paste object into background (Not an obsticle).
But if I move the mouse too fast then it pastes them like dots. It's hard for me to explain :S

Like, if I move the mouse fast around the screen while holding the mouse button it does paste them into the background but it leaves large gaps between them. I want it to be smooth and for it to not have any gaps.

If you don't understand then just create a quick app using the descriptions above and you will see what I mean

 
Hey guys, if you need a spritist or someone to create anything about art:
-Logos
-Cut-scenes
-Sprites
and all sort of other things, then just send me an email or PM me!

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
16th October, 2008 at 12:44:25 -

The problem is that the frame rate is probably only 50fps. That means an object is pasted into the backdrop every 2 1/100ths of a second. During that time, your object can have moved quite a long way.

The solution is to use the "move safely" extension.
The events look something like this:

1.)
+ start of frame
-> move safely: add "object" to protection

2.)
+ always
-> move safely: prepare safety
-> object: set X position to mouse X
-> object: set Y position to mouse Y
-> move safely: commence safety procedure

3.)
+ on safety
+ repeat while left mouse button is down
-> object: paste image into background

4.)
+ left mouse button is clicked
-> object: paste image into backdrop

Image Edited by the Author.

 
n/a

Dynamite



Registered
  18/12/2007
Points
  131

Wii Owner
16th October, 2008 at 21:29:52 -

Yeah that didn't work for me (Unless I did something wrong) but someone made an example in the other forums.

 
Hey guys, if you need a spritist or someone to create anything about art:
-Logos
-Cut-scenes
-Sprites
and all sort of other things, then just send me an email or PM me!

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
19th October, 2008 at 09:38:09 -

I came across this problem once. I found a way to stop the gaps but for some reason it kept pasting them in straight lines. I had two counters, one was X, the other Y and I made this code:

If X_counter is less than XMouse: add one to counter
If Y_counter is less than XMouse: add one to counter

Then I just made it so the counters went down by one when they were greater than the mouses position.

So I had two counters that every frame, would set their value towards the position of the mouse, then I just made it so the object always got pasted at the X and Y coordinates of the counter values.

Not sure why it made it paste in straight lines tho :S

Maybe you could put some of that stuff in fastloops so it calculates the position quicker i dunno.

 
n/a ...
   

Post Reply



 



Advertisement

Worth A Click