3696 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

Does anyone have experience with requestAnimationFrame?

Scenario:

1. I have a bunch of canvas items
2. When i “mouse over” an item, it modifies it’s shape(redraws the canvas up to a certain point, when the animation is cancelled)
3. When i “mouse out” an item, the shape modifies again(redraws the canvas from the point where the animation was left, until it hits the beginning value)

Bug:

When i put my mouse over an other item, the requestAnimationFrame cancels my first animation and continues with the second one. So my first item has a bad shape(it stops the animation where it was when i hovered the second item). And this goes on for all my items.

Solution:

I think that this is because the requestAnimationFrame is working on the window object. Does anyone has any experience in putting the function on an object, so that you can have multiple requestAnimationFrame instances running on the screen at the same time?

49 posts creative.performance
  • Has been part of the Envato Community for over 4 years
  • Elite Author: Sold more than $75,000 on Envato Market
  • Located in United Kingdom
  • Has sold $125,000+ on Envato Market
+5 more
mediacreed says

Does anyone have experience with requestAnimationFrame?

Scenario:

1. I have a bunch of canvas items
2. When i “mouse over” an item, it modifies it’s shape(redraws the canvas up to a certain point, when the animation is cancelled)
3. When i “mouse out” an item, the shape modifies again(redraws the canvas from the point where the animation was left, until it hits the beginning value)

Bug:

When i put my mouse over an other item, the requestAnimationFrame cancels my first animation and continues with the second one. So my first item has a bad shape(it stops the animation where it was when i hovered the second item). And this goes on for all my items.

Solution:

I think that this is because the requestAnimationFrame is working on the window object. Does anyone has any experience in putting the function on an object, so that you can have multiple requestAnimationFrame instances running on the screen at the same time?

I don’t have any experience with requestAnimationFrame on canvas. I do have an experience with animations and i could help you with hints. Also i like fixing tough bugs or finding solutions to temporary issues.

Send me a private message and I will try and help you!

Cheers,
Mediacreed

5406 posts The Dude Abides
  • Located in United States
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
+9 more
CodingJack says

This shouldn’t be the case:

http://jsfiddle.net/hZUD3/1/
3696 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

This shouldn’t be the case: http://jsfiddle.net/hZUD3/1/

Thanks a lot! Both for this and for the private help! :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by