Jomy10

Game/Plugin maker
Veteran
Joined
Dec 4, 2016
Messages
31
Reaction score
12
First Language
Dutch
Primarily Uses
RMMV
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.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,839
Reaction score
2,177
First Language
Portuguese - Br
Primarily Uses
RMMZ
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

Why the heck do I keep comparing my games to ones made by huge companies? I'd love them to have that level of polish but I'm simply not good enough.
Hell of a day at the London Games Market! :D

1656892272017.png

Check out my haul!

Forum statistics

Threads
123,301
Messages
1,155,616
Members
161,715
Latest member
UnderscoreBackspace
Top