requestanimationframe Questions
7
Solved
I was thinking that for some projects I do 60fps is not totally needed. I figured I could have more objects and things that ran at 30fps if I could get it to run smoothly at that framerate. I figur...
Reactant asked 1/7, 2012 at 19:39
3
Solved
I'm working on Next.js and React-Native-Web. I managed to run them together following the official Next.js example but when I'm trying to use the Animated package from the react-native it fails wit...
Luttrell asked 25/4, 2020 at 16:1
1
Solved
Within my reactjs app, I'm using a light-weight map library called pidegon-maps to display vessel locations. Without trying to use the bigger libraries (leaflet, Google Maps react), I'm trying to a...
Improvident asked 29/12, 2023 at 9:11
4
Solved
In the main program I randomly choose an object which I'd like to animate, so I call the function with the object as the argument. The first loop is okay, x is finely set, but in the next turn it b...
Yardmaster asked 10/11, 2013 at 18:23
13
Solved
How could I calculate the FPS of a canvas game application? I've seen some examples, but none of them use requestAnimationFrame, and im not sure how to apply their solutions there. This is my code:...
Ozzy asked 26/11, 2011 at 16:12
3
Solved
I'm building a site that does parallax scrolling with requestAnimationFrame. There are multiple sections, each with a full-sized background image and some mid- and foreground images as well. I've m...
Amanda asked 9/11, 2012 at 14:49
4
Assumptions: rAF now time is calculated at the time the set of callbacks are all triggered. Therefore any blocking that happens before the first callback of that frame is called doesn't affect the ...
Lipoid asked 13/7, 2016 at 19:34
2
Browser reads and runs a JavaScript file, the synchronous tasks written in the file immediately become in-mid-execution task, setTimeout callbacks become macrotasks, and promise callbacks become mi...
Charlatanry asked 27/3, 2017 at 15:25
4
I'm looking for a way to animate a counter in React.
For the sake of the example, I have 3 components of the following structure:
Master:
logicComponent
Counter
(Master is the parent of lo...
Doris asked 29/12, 2015 at 9:13
2
Solved
I'm having trouble running an animation. This is inside var ob1 = function() {};. When called, it runs for a while and then I get the error Uncaught RangeError: Maximum call stack size exceeded. Ho...
Daedalus asked 18/10, 2013 at 21:39
1
Solved
This drives me crazy. Please help to understand the cause. I can't get a masked video to work in the canvas on iOS (Chrome and Safari). Tested on iPads and iPhones, also on many different real-devi...
Martins asked 3/4, 2023 at 17:4
4
Solved
What is the best way to get the time difference between "window.requestAnimationFrame" callback in javascript?
I have tried:
// create the best .requestAnimationFrame callback for each browser
wi...
Agamic asked 30/4, 2015 at 2:7
4
Solved
What is going on that allows the rest of the loop to execute, and then for requestAnimationFrame to execute next frame?
I am misunderstanding how this method works, and can't see a clear explanatio...
Adkinson asked 18/2, 2014 at 21:57
6
Solved
I want to write a jest unit test for a module that uses requestAnimationFrame and cancelAnimationFrame.
I tried overriding window.requestAnimationFrame with my own mock (as suggested in this answer...
Orcein asked 4/5, 2020 at 13:47
2
I have a javascript client that runs on a web page, drawing with requestAnimationFrame to the canvas and communicating via websockets to my NodeJS backend server (using the 'ws' module on the serve...
Aliber asked 5/9, 2016 at 3:7
15
Solved
It seems like requestAnimationFrame is the de facto way to animate things now. It worked pretty well for me for the most part, but right now I'm trying to do some canvas animations and I was wonder...
Mesquite asked 4/11, 2013 at 8:31
4
Solved
My goal is to create an animation loop à la requestAnimationFrame so that I could do something like this:
animationObservable.subscribe(() =>
{
// drawing code here
});
I tried this code as ...
Dialyse asked 24/1, 2017 at 1:59
1
Solved
I made an example of 'setTimeout vs requestAnimationFrame' to find out how different they are.
As you can see, the orange box arrives to the destination first. The green box jump some times and slo...
Protamine asked 18/3, 2022 at 6:2
0
I found that when running Css3 Animation and RequestAnimationFrame (without changing DOM) at the same time, Recalculate Style will be fired every time, It means GPU acceleration not working right? ...
Ardisardisj asked 23/9, 2021 at 3:46
2
Please free feel to point out if my following understanding is wrong: Assume our display refresh rate is 60hz (I know it is not always the case but let's just assume it is 60hz) so the web page wou...
Unfaithful asked 6/9, 2021 at 18:34
5
Solved
I'm working on some personal project by Three.js. I'm using requestAnimationFrame function. I want to call a function each 2 seconds. I've search but I couldn't find anything useful.
My code is lik...
Zuber asked 20/4, 2015 at 9:9
1
Solved
I'm reading this article and I'm not sure I understand how the final hook works.
Here is the code:
const useAnimationFrame = (callback) => {
const requestRef = useRef();
const previousTimeRef ...
Schram asked 17/6, 2021 at 8:33
3
Solved
I'm currently experimenting with three.js, which relies on requestAnimationFrame to perform animations.
Wouldn't the following code result in infinite recursion before the cube rotations and render...
Spineless asked 21/3, 2015 at 9:42
2
Solved
I'm trying to achieve a pretty basic animation using ThreeJS in my Ionic 2 application. Basically trying to rotate a cube. But the cube isn't rotating because requestAnimationFrame is being execute...
Browbeat asked 18/4, 2017 at 7:32
1
Using Reflex-DOM, I'd like to make an Event t () that fires when the browser is ready to paint the next frame, i.e. when requestAnimationFrame fires. I tried it like this:
{-# LANGUAGE RecursiveDo...
Amble asked 16/4, 2016 at 14:19
1 Next >
© 2022 - 2024 — McMap. All rights reserved.