Search the Community
Showing results for tags 'pandajs2'.
-
Hi all, I'm currently developing a game with PandaJS 2. I'm currently designing the game's background so that it has a looping animation to it. However in using PandaJS 2.0, some of the methods I tried from the old Panda fiddler and game demos from old versions of PandaJS doesn't work, e.g - MovieClip. The method that works is game.Animation but it only when using game.Texture.fromImage which doesn't work when using reference to game.assets. For example, in asset loader I'm using: game.addAsset('assets/images/tree01.png', 'tree01');game.addAsset('assets/images/tree02.png', 'tree02');game.addAsset('assets/images/tree03.png', 'tree03');game.addAsset('assets/images/tree04.png', 'tree04');game.addAsset('assets/images/tree05.png', 'tree05');but if I use game.Animation with game.Texture.fromImage it can't read the path if I used: this.tree = new game.Animation([ game.Texture.fromImage('tree01'), game.Texture.fromImage('tree02'), game.Texture.fromImage('tree03'), game.Texture.fromImage('tree04'), game.Texture.fromImage('tree05') ]); this.tree.scale.x = this.rightbg.scale.y = 0.7; this.tree.anchor.set(0.5, 1.0); this.tree.position.set (760,-10); this.tree.play(); this.tree.addTo(this.stage);But it does work if I use this: this.tree = new game.Animation([ game.Texture.fromImage('media/assets/images/tree01.png'), game.Texture.fromImage('media/assets/images/tree02.png'), game.Texture.fromImage('media/assets/images/tree03.png'), game.Texture.fromImage('media/assets/images/tree04.png'), game.Texture.fromImage('media/assets/images/tree05.png') ]); this.tree.scale.x = this.rightbg.scale.y = 0.7; this.tree.anchor.set(0.5, 1.0); this.tree.position.set (760,-10); this.tree.play(); this.tree.addTo(this.stage);Any solution to this, because I'd like to remove redundancy in my code structure. Another issue I have with game.Animation is that the parameter for animation speed doesn't seem to work. Here's what I'm using this.tree.animationSpeed = 0.3;But it doesn't seem to work regardless of what value I use in PandaJS 2. Is it working for anyone else or am I am doing something wrong? Thanks in advance.