Please help me out. It is not letting me add a function to a class. Here is my code:
This is my error:
rpg_managers.js:1949 TypeError: Sprite_Icon.testing is not a function
at Function.BattleManager.startBattle (MyWeaknessPlugin.js:27)
at Scene_Battle.start (rpg_scenes.js:2247)
at Function.SceneManager.updateScene (rpg_managers.js:2019)
at Function.SceneManager.updateMain (rpg_managers.js:1983)
at Function.SceneManager.update (rpg_managers.js:1907)
Sprite_Icon.prototype.testing = function () {}
Sprite_Icon.prototype.MyDrawIcon = function (iconIndex, x, y) {
var bitmap = ImageManager.loadSystem('IconSet');
var pw = Window_Base._iconWidth;
var ph = Window_Base._iconHeight;
var sx = iconIndex % 16 * pw;
var sy = Math.floor(iconIndex / 16) * ph;
this.contents.bitmap.blt(bitmap, sx, sy, pw, ph, x + addPosX, y + addPosY);
};
function Sprite_Icon() {
this.initialize.apply(this, arguments);
}
Sprite_Icon.prototype = Object.create(Sprite_Base.prototype);
Sprite_Icon.prototype.constructor = Sprite_Icon;
Sprite_Icon.prototype.initialize = function (x2, y2) {
x = x2;
y = y2;
width = 16;
height = 16;
Sprite_Base.prototype.initialize.call(this);
}
This is my error:
rpg_managers.js:1949 TypeError: Sprite_Icon.testing is not a function
at Function.BattleManager.startBattle (MyWeaknessPlugin.js:27)
at Scene_Battle.start (rpg_scenes.js:2247)
at Function.SceneManager.updateScene (rpg_managers.js:2019)
at Function.SceneManager.updateMain (rpg_managers.js:1983)
at Function.SceneManager.update (rpg_managers.js:1907)