Comments (5)
Hey Kostas,
maybe director.setClear(false) will do it for you.
probably you're having the screen cleared twice, once by the director
(which unless called the previous code will clear the screen) and by the
scene ?
let me know.
Another thing, i've just uploaded regarding behavior transformation into
css3 keyframes. i'm focusing on this issue since i'm also targeting mobile
dev. even though css3 animations totally suck, i'm getting good results.
-i
2011/11/23 Kostas Karolemeas <
[email protected]
In
Director.render
, the initialization code (canvas clear, etc) is ran
even if all calls toScene.isInAnimationFrame
return false. A proposed
solution:... var initialized = false; if (this.glEnabled) { for (i = 0; i < ne; i++) { var c = this.childrenList[i]; if (c.isInAnimationFrame(this.time)) { if (!initialized) { this.gl.clear(this.gl.COLOR_BUFFER_BIT |
this.gl.DEPTH_BUFFER_BIT);
this.coordsIndex = 0;
this.uvIndex = 0;
initialized = true;
}
...
} else {
for (i = 0; i < ne; i++) {
var c= this.childrenList[i];
if (c.isInAnimationFrame(this.time)) {
if (!initialized) {
this.ctx.globalAlpha = 1;
this.ctx.globalCompositeOperation = 'source-over';if (this.clear) { this.ctx.clearRect(0, 0, this.width,
this.height);
}
initialized = true;
}
...
}(I am working on a project that will also target mobile devices where CPU
consumption results to battery consumption :-))
Reply to this email directly or view it on GitHub:
#19
from caat.
Hi Ibon,
I am afraid setClear(false) creates some artifacts and I think the scene is not clearing the screen, at least I have not added any code to do that.
I will give a try to the CSS renderer and let you know!
Kostas
from caat.
ok.
will check scene status then.
thanks.
-i
2011/11/23 Kostas Karolemeas <
[email protected]
Hi Ibon,
I am afraid setClear(false) creates some artifacts and I think the scene
is not clearing the screen, at least I have not added any code to do that.I will give a try to the CSS renderer and let you know!
Kostas
Reply to this email directly or view it on GitHub:
#19 (comment)
from caat.
Look what I did:
- called director.setClear(false)
- implemented scene.paint to call ctx.clearRect
Now it works! Is this the recommended way to do it?
In parallel, I have started reading the Sumon code :-)
from caat.
hey Kostas,
send me a personal email.
-ibon
2011/11/23 Kostas Karolemeas <
[email protected]
Look what I did:
- called director.setClear(false)
- implemented scene.paint to call ctx.clearRect
Now it works! Is this the recommended way to do it?
In parallel, I have started reading the Sumon code :-)
Reply to this email directly or view it on GitHub:
#19 (comment)
from caat.
Related Issues (20)
- audio loop issue in firefox
- Exact pixel hit detection HOT 2
- Rendering wrong when use director.enableResizeEvents(CAAT.Director.RESIZE_PROPORTIONAL) HOT 2
- Actor SetAsButton Touch not working on CocoonJS 1.3 ? HOT 3
- Actors with SpriteImage can't rotate or scale correctly with anchors HOT 6
- Is CAAT running well in mobile
- Wrong license creation produced invalid js files within build folder. HOT 1
- Bug in actor.js /setRotationAnchor()
- Inconsistencies when hiding actor after a end of a behavior
- Cannot Remove Directors
- CSS renderer seems to be broken
- Small bug in __mouseDownHandler in Director.js
- Stop sprite image animation HOT 4
- collision image HOT 5
- uncaught exception: adding to a container an element with parent. HOT 3
- Demo not working HOT 1
- disable ctrl rotation in actor with enableDrag true
- How to add a method on complete event of RotateBehavior HOT 2
- Need to allow user to enter his name for score submission
- Path management example starting point
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caat.