-
Notifications
You must be signed in to change notification settings - Fork 117
CATT.loop > callback not works #47
Comments
Hi hyperandroid after I change it to this.director... it calls the function , but seems the fps is very fast , even I change fps to 1 this.director.loop(1,function(){ Any idea ? I want to call a function just like ActionScript > onEnterFrame Thanks |
CAAT.loop does not consume a second argument. You can only provide a FPS argument which, in case you choose not to use the default requestAnimFrame method, set the number of frames per second the scene is rendered at (see the documentation). Because of the requestAnimFrame, the framerate is maximized to what the browser can handle. From documentation: CAAT.loop(fps) Met vriendelijke groet, Rob Boerman Op maandag 27 februari 2012 (w9), om 19:29 heeft jsasker het volgende geschreven:
|
If you're looking for scene pre/post render hooks, you must redefine the Let me know it it works for you.Regards, -ibon El 27 de febrero de 2012 19:29, jsasker <
|
Hi robboerman and hyperandroid So , that means no need to set the fps , the fps will be maximized automatically (as big as possible) , am I right ? /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// I have an another question : How can I call a function when mouseMove mouseDown ... on the "stage" ? like so : stage.mouseMove=function(evt){ |
Hi, The scene itself is a descendent of an Actor too, so you should just create a custom mouseMove method on you scene and you should be set. Met vriendelijke groet, Rob Boerman Op maandag 27 februari 2012 (w9), om 21:02 heeft jsasker het volgende geschreven:
|
That's the correct way to do it. I think this are not real CAAT issues but general purpose questions. Please post your CAAT questions directly to http://groups.google.com/group/caatjs/topics?hl=es which the general purpose CAAT forum. |
Hi hyperandroid
CAAT.loop(30,function(){
console.log("onRenderStart");
});
it should output the string
but no output :| ,why ?
Im using "hyperandroid-CAAT-1a77f74"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
another question :
How can I call a function when mouseMove mouseDown ... on the "stage" ?
P.S. even though the "stage" is empty .
like so :
stage.mouseMove=function(evt){
myShapeActor.setLocation(evt.point.x,evt.point.y);
}
Thanks
The text was updated successfully, but these errors were encountered: