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,821
Reaction score
2,165
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

Kes
Let me ask you this - when was the last time you backed up? Can you afford to lose all the progress you've made since the last backup?
Just asking.
Working on fun ways to get around the Midnight Circus level! Cannons were a given :LZSlol:

apolloblastoff.gif

Forum statistics

Threads
123,075
Messages
1,153,789
Members
161,407
Latest member
Tree_of_Topaz
Top