じ☆ve冰风 发表于 7 天前

(Solved) Sprite Icons not on item index

I need some help on some code (as this is a WIP)

for MV, I use to refresh, update and drawItemName like this:
                JavaScript:        
      SDJB_Base["AniIcon"] = winClass.prototype.drawItemName;             winClass.prototype.drawItemName = function(item, x, y, width) {               if (item?.animatedIcon?.valid) {                     const iconW = ImageManager.iconWidth; //+4;                     this.resetTextColor();                     this.drawText(item.name, x + iconW, y, width - iconW);                     return;               }               return SDJB_Base["AniIcon"].call(this, item, x, y, width);             };


while MV sprite icons works nicely I continue to get the same thing done in MZ.

Now, in MZ, the sprite icons draw nicely, but in MZ they stack in the upper left corner of the window.
but not on the index of "this._data" for the Window_ItemList, Window_ShopBuy etc that inherit from
Window_ItemList.

how can I do the indexing for MZ to make it set next to the items name?

as I don't get the MZ version as it does have the data, like MV, but MZ fails to work, why?

Edit:
forgot the offset function uses itemRectForText (MV) which is itemLineRect for MZ!

this is annoying why there is a small naming different....


本贴来自国际rpgmaker官方论坛作者:ShadowDragon处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/solved-sprite-icons-not-on-item-index.181272/
页: [1]
查看完整版本: (Solved) Sprite Icons not on item index