SirCumferance 28 Posted November 13, 2015 (edited) I am using the ammo plugin and it has the icon, followed by the amount of ammo. Now, this takes up a lot of space so I shrunk the icon spacing (icon too) but the text is still after it, I need it ON the icon. I already removed the 'x' from the amount but I do not know how to move the text over the icon. Below is the relevant code....I think for (var ammoId in skill.itemAmmoCost) { ammoId = parseInt(ammoId); if (!isNaN(ammoId) && (ammoId > 0)) { this.changeTextColor(this.textColor(Unco.Param.ammoFontColor)); //var text = 'x' + String(skill.itemAmmoCost[ammoId]) + ( (Unco.Param.showAmmoLeft === 'false') ? "" : ( "/" + $gameParty.getItemAmount($dataItems[ammoId]) ) ); var text = String(skill.itemAmmoCost[ammoId]) + ( (Unco.Param.showAmmoLeft === 'false') ? "" : ( "/" + $gameParty.getItemAmount($dataItems[ammoId]) ) ); this.contents.fontSize = Unco.Param.ammoFontSize; this.drawText(text, wx, wy, dw, 'right'); dw -= this.textWidth(text); this.resetFontSettings(); if ($dataItems[ammoId].iconIndex > 0) { var iw = wx + dw - Window_Base._iconWidth; this.drawIcon($dataItems[ammoId].iconIndex, iw, wy + 2); dw -= Window_Base._iconWidth - 24; The plugin is located here. Example: https://www.dropbox.com/s/75dlq9beeavgg0d/Ammo%20Cost.jpg?dl=0 Edited November 13, 2015 by SirCumferance Share this post Link to post Share on other sites
Galv 1,386 Posted November 13, 2015 Try moving the draw text code to be below the draw icon code. Usually things drawn to the window are placed on top of things that have already been drawn to it. (It's late here, that's my technical explanation ) Share this post Link to post Share on other sites
SirCumferance 28 Posted November 13, 2015 Nailed it, thanks for the help. for (var ammoId in skill.itemAmmoCost) { ammoId = parseInt(ammoId); if (!isNaN(ammoId) && (ammoId > 0)) { this.changeTextColor(this.textColor(Unco.Param.ammoFontColor)); //JFA//var text = 'x' + String(skill.itemAmmoCost[ammoId]) + ( (Unco.Param.showAmmoLeft === 'false') ? "" : ( "/" + $gameParty.getItemAmount($dataItems[ammoId]) ) ); var text = String(skill.itemAmmoCost[ammoId]) + ( (Unco.Param.showAmmoLeft === 'false') ? "" : ( "/" + $gameParty.getItemAmount($dataItems[ammoId]) ) ); this.contents.fontSize = Unco.Param.ammoFontSize; //this.drawText(text, wx, wy, dw, 'right'); //dw -= this.textWidth(text); //this.resetFontSettings(); if ($dataItems[ammoId].iconIndex > 0) { var iw = wx + dw - Window_Base._iconWidth; this.drawIcon($dataItems[ammoId].iconIndex, iw, wy + 2); dw -= Window_Base._iconWidth - 26; this.drawText(text, wx, wy, dw-14, 'right'); dw -= this.textWidth(text); this.resetFontSettings(); 1 Galv reacted to this Share this post Link to post Share on other sites