So I am trying to make a profile picture selection and I want to do it through attributes. How do I do this?
It won’t work when I do…
Theboard.attributes.add("Pic",{type: 'asset',title: "The ingame image"});
Theboard.attributes.add("Img_one",{type: 'asset',title: "Image 1"});
Theboard.attributes.add("Img_two",{type: 'asset',title: "Image 2"});
Theboard.prototype.initialize = function() {
this.Pic.button.on('click', this.changepro, this);
};
Theboard.prototype.changepro = function () {
if(this.Pic.texture == this.Img_two){this.Pic.texture = this.Img_one;}
if(this.Pic.texture == this.Img_one){this.Pic.texture = this.Img_two;}
};
I am trying to make it toggle between the two but idk how help please?