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,824
Reaction score
2,170
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

Not an RPG Maker Update but I'm happy to say that I finally passed my drivers written test. Which makes me a happy guy.
FWRu-cYXkAAAUbl
Have you ever been in such a luck streak you felt fear something was wrong?
I'm going to be adding in combat animations, revamping the UI and putting in a new cutscene this week, so this is your last chance to play the MC:RIS demo in its original form! Say you were there since the beginning! https://qos.itch.io/infinite-sadness
I added reflections and shadows. Though one of the party seems to have no reflection, is floating, with glowing eyes. I'm sure it's fine.
p7O1sjG.png
Well. *That* was an entertaining fustercluck — and that’s not meant nearly as sarcastically as it sounds. I just had to make four different versions of the same conversation:
1: Attained MacGuffin.
2: Have not attained MacGuffin, but know its location.
3: Do not know MacGuffin’s location, but have a good idea where to find it.
4: Do not know where to look for MacGuffin.
Yep, feels good to be back. ^.^

Forum statistics

Threads
123,113
Messages
1,154,067
Members
161,443
Latest member
Rolo1991
Top