Jump to content

Search the Community

Showing results for tags 'requestAnimationFrame'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 11 results

  1. i am trying to figure out why assets sometimes “double” when character moves quickly. i think it’s probably a problem in gameLoop() or draw() but i can’t figure out where. i want the player to move whenever the user presses a key, but the monster movement is on a timer (1x per second, or less depending on difficulty level). the requestAnimationFrame(renderViewport) call is inside draw(). draw() is called whenever character moves, but gameloop() only runs 1x/second (or per .5 second, etc) for monster movement, and there is a draw() call in there too. is there a better way to do this? fr
  2. Is there a way to have Pixi only redraw as needed? For example, in the RenderTexture sample, the GPU is at 20% but nothing is moving. http://pixijs.github.io/examples/index.html?s=basics&f=render-texture.js Can I tell items not to redraw if they are idle? Or how can I implement a "needsUpdate" flag? In my app, the screen does not change frequently, and it sits idle on a big screen for long periods of time. Over time the machine heats up and the fan kicks in with the GPU so high, in my case over 50%. I have looked at the requestAnimationFrame loop, and I need this be
  3. Hey everyone, So Im new to game development, although Im a full stack JS dev for general sites and apps. I started getting into canvas animation and now Im here trying to learn some game animation stuff. My question is this: Do you generally do just about all animation in the game loop with requestAnimationFrame()? Or can you simply have renderer.render(stage) called in the game loop while outside of it you use GSAP or some other tweening mechanic to change the positioning props on objects/sprites? Iv tried it and it works, I just would like to know if its dumb or nonperformant. I also
  4. Running the instance Demo both from the babylonjs.com website and locally: I see potential FPS in debug overlay showing ~60 FPS. Actual FPS is ~15 FPS. I tested this in both Chrome and Firefox on both Linux and OSX. I tried removing various parts of the code. Reducing instance count to 10, removing collision tests from all objects. The FPS rises somewhat but the problem persists. I tried checking out the v2.5.0 tag in case something in latest was causing the problem. The problem persists. I think this may be due to BabylonJS depending soley on requestAnimationFram
  5. I'm new to BabylonJS but one of the first things I notice is that almost all of the demos run slow (20-30 FPS is typical) on the same machine that is running three.js stuff fast. It seems like update/draw is not being called as often as it could be, as according to the debug overlay update and draw frame time is only 10ms in these same demos (so potential FPS is 100). Additionally I think BabylonJS suffers from timing flaws that other JS engines do, see this article: https://www.isaacsukin.com/news/2015/01/detailed-explanation-javascript-game-loops-and-timing In three.js I
  6. I'd like to encapsulate my PIXI rendering in a JavaScript Prototype Object-Oriented fashion. The problem I'm running into is that there is no 'this' object when my animate method is invoked as the callback from requestAnimationFrame(). Can someone suggest a means to do this? I realize this is likely just a general JavaScript issue, as opposed to something related to PIXI, so sorry if this is trivial. Thank you in advance of any help you can provide! Here is what I believe is the minimal code needed to demonstrate the issue: var FFT = function() { this.renderer = PIXI.autoDetectRen
  7. Trying to learn Pixi i created this small file: PixiRenderer.js define(["references/pixi"], function(PIXI) { var PixiRenderer = function(){ var renderer = PIXI.autoDetectRenderer(800, 600,{backgroundColor : 0x1099bb}); document.body.appendChild(renderer.view); // create the root of the scene graph var stage = new PIXI.Container(); // create a texture from an image path var texture = PIXI.Texture.fromImage("assets/bunny.png"); // create a new Sprite using the texture var bunny = new PIXI.Sprite(texture); stage.addChild(bunny); renderer.render(stage); } return new PixiRenderer();});My
  8. Hi, Today I've faced with issue in the Chrome, that was discovered several yeas ago - requestAnimationFrame leaks. Pity but true. A brief post about my investigation is on the site: http://www.elvarion.com/garbage-collection-in-the-game-loop-chrome-failure/ What other eags our great web-platform has?
  9. Do you want custom FPS with smooth animations? I have made a method that makes this possible. The first 1-3 seconds may be buggy, but after that it works smooth. The update() method is called (custom FPS) times per second. The draw() method is called how many times the browser refreshes per second. Here's the code: (mainCanvas is a canvas with the size 800,600) window.requestAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAni
  10. is your requestAnimationFrame dated? http://paulirish.com/2011/requestanimationframe-for-smart-animating/http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating (this link doesn't work properly) When reviewinghttp://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision which references High Resolution Timehttp://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#sec-extenstions-performance-interface The paul irish blog seems to have posted some revisions.. removing the o and ms vendor tags.. but it
  11. Hi! I'm currently porting my game to mobile devices with CocoonJS. After days with a lot of headaches trying solve the issues, i came with one that i read on the forums that is solved on CocoonJS 1.4.4, but because i'm new with this I don't know what version it's actually being used to compile my project. I'm having this error: Javascript Exception (Line: 7181 Tag: 'requestAnimationFrame'): TypeError: 'undefined' is... Does someone knows this error? How can i fix it? Thanks in advance.
  • Create New...