Hello, I'm trying to make actor 1's equipment icons appear on the screen as a hud, if actor 1 changes equipment the icon on the screen must be updated, i tried this script below, it shows the icons from index 0 to 5 on the screen but there is a sudden drop in fps, I put this script in a parallel process so the icons do not disappear when changing maps.
Script:
Script:
var actor = $gameParty.members()[0];
for (var i = 0; i <= 5; i++) {
var equiphud = actor.equips()[i];
var iconIndex = equiphud ? equiphud.iconIndex : 0;
if (iconIndex !== 0) {
var bitmap = ImageManager.loadSystem("IconSet");
bitmap.addLoadListener(function() {
var sprite = new Sprite(bitmap);
sprite.setFrame(iconIndex % 16 * 32, Math.floor(iconIndex / 16) * 32, 32, 32);
sprite.x = 150 + i * 50;
sprite.y = 50;
SceneManager._scene.addChild(sprite);
});
} else {
//
}
}