MV Rotating item icons

Is there any way to rotate items in the item menu?
I'd like to rotate the icons of certain items by 45°.

Does anyone know how I can achieve this? Either using an existing plugin or by making one myself.
Hi there!

If those items that need rotation, will always be rotated, the easy way is just to rotate the icons on an image editor and apply them to the item.

Otherwise, I believe the Icons are drawn using that function:
JavaScript:
Window_Base.prototype.drawIcon = function(iconIndex, x, y) {
    const bitmap = ImageManager.loadSystem("IconSet");
    const pw = ImageManager.iconWidth;
    const ph = ImageManager.iconHeight;
    const sx = (iconIndex % 16) * pw;
    const sy = Math.floor(iconIndex / 16) * ph;
    this.contents.blt(bitmap, sx, sy, pw, ph, x, y);
};

So you would need to rotate the bitmap and calculate the coordinates for it to draw.
I will give this a try when I have time, but it may take a while, maybe someone could help you first.
Since I'm not sure how to rotate a bitmap, I would create a sprite and draw the icon normally on it.
So I would rotate this sprite, then would draw this sprite on the window contents.
I've finally uploaded my AnimatedIcons plugin...

Do this setup to make it rotated by 45:
1652743900560.png


More info on the plugin can be found here:
RMMV - Animated Icons (Original Thread Post): Click Here to View

...but no official documentation/help yet
@Eliaquim @ct_bolt

Thank you both for your replies, I'll be trying those out!

Original thread: https://forums.rpgmakerweb.com/threads/rotating-item-icons.147666/