fff(e){
var obj=[]
var self=this;
let counter=0
counter+=e;
function jj(){
obj[counter]= self.scene.add.image(self.x, self.y, self.frame)
obj[counter].setInteractive()
obj[counter].setData('cat1',{ name: 'Red Gem Stone', level: 2, owner: 'Link', 'gold': 50 });
// var am= self.scene.tweens.add({targets: obj[counter],
// x: 750,
// duration: 8800,
// ease: 'Linear'
// })
obj[counter].on('gameobjectup', function (gameObject){
console.log('hola')
var text = self.scene.add.text(350, 270, '', { font: '16px Courier', fill: '#00ff00' });
text.setText([
'Name: ' + gameObject.getData('name'),
'Level: ' +obj[counter].getData('level'),
'Value: ' + obj[counter].getData('gold') + ' gold',
'Owner: ' + obj[counter].getData('owner')
]);
gameObject.emit('clicked', gameObject)
},this)
let i=obj[counter]
obj[counter].on('clicked', (onob)=> {
var text = self.scene.add.text(350, 270, '', { font: '16px Courier', fill: '#00ff00' });
text.setText([
'Name: ' + onob.getData('name'),
'Level: ' +obj[counter].getData('level'),
'Value: ' + obj[counter].getData('gold') + ' gold',
'Owner: ' + obj[counter].getData('owner')
]);
self.obv=true
console.log('ddddddd',counter, onob)
})
};
jj()
Hi people…
I am just want to check what I am doing wrong currently I get 8 cats in sprites tweened or not is no problem but i want to add info about the cats in the text input, what am I doing wronk?
every text field return undefined but the counter is valid but i tried both the object returned in function and in out helping out please this is the cat class so from creating main I call a new cat in a for loop, so in this function, I want to add the info is it possible?
cheers