Hi, i have a custom buttons and i want apply anchor. How to do it?
Custom buttons:
this.button_start = this.btn("Play a game", this.play_game, 2.03, 15.1, 2, 8.5, 140, 30);
btn: function(name, functions, anc1X, anc1Y, anc2X, anc2Y, w, h) {
this.button = this.game.add.button(this.game.width, this.game.height, '', functions, this);
this.button.name = name;
this.button.width = w;
this.button.height = h;
this.button.anchor.set(anc1X, anc1Y);//Temporary
this.text = this.add.bitmapText(this.game.width, this.game.height, 'Text_mainmenu', this.button.name, 46);
this.text.anchor.set(anc2X, anc2Y);//Temporary
}
/*
name - the name of the button
functions - button function
anc1X - first anchor.setX
anc1Y - first anchor.setY
anc2X - two anchor.setX
anc2Y - two anchor.setY
*/