If anyone wants to use this for RPG Maker MV, it will work if you change line 87 toconst rect = this.itemRectForText(index);