Hi!
The title of the thread is very straight forward about what I am trying to achieve. I have a sprite which is added to a follower but now I need to attach more elements to it (in this case a text). I know that the way to go is to use a container but I am not managing to figure how to join container, sprite and follower together. This is what I tried:
var enemy = "enemy";
this[enemy] = this.add.follower(aPaths[path], 0, 0, enemy+'Right').startFollow({
duration: 20000,
loop: 0
});
this["t_"+enemy] = this.add.bitmapText(0, 0, 'komikax_18', "Enemy name", 18);
this[enemy].add(this["t_"+enemy]);
However the very last line returned me the error this[enemy].add is not a function.
I also tried:
this[enemy] = this.add.follower(aPaths[path], 0, 0, enemy+'Right').startFollow({
duration: 20000,
loop: 0
}).add.container(0,0);
and tried too:
this[enemy] = this.add.container(0,0).add.follower(aPaths[path], 0, 0, enemy+'Right').startFollow({
duration: 20000,
loop: 0
});
But both returned me errors as well.
Any clue?
Thanks!