Hi,
I've noticed that the
So the function is being called once from the
Update in Sprite_Clickable:
Update in Sprite_Button, which is a subclass of Sprite_Clickable:
Also, I've tested to confirm that it does call the processTouch function and it really does.
Thanks!
I've noticed that the
processTouch() function is called twice per frame in the update method in Sprite_Button and was wondering if it's intended? If so, why is it called twice?So the function is being called once from the
Sprite_Clickable.prototype.update and once from the update method in Sprite_Button. Take a look:Update in Sprite_Clickable:
Code:
Sprite_Clickable.prototype.update = function() {
Sprite.prototype.update.call(this);
this.processTouch(); // First time
};
Code:
Sprite_Button.prototype.update = function() {
Sprite_Clickable.prototype.update.call(this);
this.checkBitmap();
this.updateFrame();
this.updateOpacity();
this.processTouch(); // Second time!!!
};
Thanks!

