Note: it's \backslash\, not /forward slash/, e.g.
\i[123]. However...
Game windows have a built-in function to handle text codes, but sprites don't. That makes it much more awkward to support all text codes for stuff like gauge labels and name sprites (battle status).
It's possible to support text codes in general by e.g. creating a dummy window and using that to process the text before transferring it over. But I think it'd be simpler in your case to just manually interpret
\i[n] by patching the
drawLabel method of
Sprite_Gauge. Maybe (untested):
Spoiler: plugin code
JavaScript:
/*:
* @target MZ
* @plugindesc Show icons for \i[n] gauge labels.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/169619/
* @help Free to use and/or modify for any project, no credit required.
*/
;void (alias => {
const RX = /^\\i\[(\d+)\]$/i;
Sprite_Gauge.prototype.drawLabel = function() {
const m = RX.exec(this.label());
const n = m ? parseInt(m[1], 10) : 0;
if (n) {
// cf Window_Base.prototype.drawIcon
const bmp = ImageManager.loadSystem("IconSet");
const pw = ImageManager.iconWidth;
const ph = ImageManager.iconHeight;
const sx = (n % 16) * pw;
const sy = Math.floor(iconIndex / 16) * ph;
const x = this.labelOutlineWidth() >> 1;
const y = this.labelY();
this.bitmap.blt(bmp, sx, sy, pw, ph, x, y);
} else
alias.apply(this, arguments);
};
})(Sprite_Gauge.prototype.drawLabel);
Then (in theory) just enter, like,
\i[123] for the HP abbreviation under Database -> Terms.