I'm having trouble getting a basic example of caat-css working.
It sounds like all you should need to do is switch out caat.js for caat-css.js, use a div instead of a canvas, and setClear(false) on the director.
I tried doing that on multiple demos, and then simple examples but I always get the error:
<script src="./caat-css.js"></script>
<script type="text/javascript">
var Scene;
var Director;
(function() {
function scene() {
Scene = Director.createScene();
var bg = new CAAT.ActorContainer()
.setBounds(0, 0, Director.width, Director.height)
.setFillStyle('#333');
Scene.addChild(bg);
var img = new CAAT.Actor()
.setBackgroundImage(Director.getImage('a_gun'));
Scene.addChild(img);
}
function init() {
Director = new CAAT.Director()
.initialize(700, 300, document.getElementById('test_div'))
.setClear(false);
new CAAT.ImagePreloader().loadImages(
[
{id: 'a_gun', url: './agun_small.png'}
],
function(counter, images) {
console.log(counter, images);
if (counter == images.length) {
Director.setImagesCache(images);
scene();
}
}
);
CAAT.loop(60);
}
init();
})();
I'm using the latest version of caat-css.js. Does anyone know what I'm missing?