Icon Layer

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,263
Reaction score
1,565
First Language
PT - EN
Primarily Uses
RMMV
My iconset doesn't have backgrounds and i wanted to mix 2 icons without opening a image editor and do it myself.


Is it possible to be done for skills items, equipments and states?



Maybe with tags like these


<top icon: x>


<botton icon: x>
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
Try this - save as a .js file in the js/plugins folder.  File name doesn't matter.

Code:
Window_Base.prototype.drawItemName = function(item, x, y, width) {
    width = width || 312;
    if (item) {
        var iconBoxWidth = Window_Base._iconWidth + 4;
        this.resetTextColor();
        if (item.meta.iconBack) {
            this.drawIcon(parseInt(item.meta.iconBack), x + 2, y + 2);
        }
        this.drawIcon(item.iconIndex, x + 2, y + 2);
        this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
    }
};


You only need to specify the background in the notes, like this: <iconBack:15> (no spaces anywhere in there).  The foreground should be selected in the normal way.


When a skill/equip/item is drawn, it will check if a background is specified and will draw it first.  Then it'll draw the normal icon.  If no background is specified in the notes, it'll just draw the icon that's assigned the normal way.


There might be conflicts if you have other plugins that overwrite or alias this function.
 
Last edited by a moderator:

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,263
Reaction score
1,565
First Language
PT - EN
Primarily Uses
RMMV
Working fine, no bugs so far :v


Is there a way that i can make them look bigger? I think i can increase their size by 4 - 8 pixels.



Thx Shaz!
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
You could try either changing these lines in the rpg_windows.js file, or if you want them in a plugin (so you don't have to remember to make the change again every time you update the project when a new MV is released) just insert a few new lines in the script I gave you and paste them in there:


Window_Base._iconWidth = 32;
Window_Base._iconHeight = 32;




Change the 32 to whatever you want it to be - 36, 40, whatever.


You will also have to modify your iconset to ensure they are all that size.


The windows MAY adjust the text spacing accordingly, if they use those values.  I'd be concerned how they'd show in a message, if you use icons in messages, and how they'd show on states, in the status window or in battles.  The line spacing would be based on 32x32 icons and I don't know if that would adjust if you set your icon size to be bigger.
 

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,263
Reaction score
1,565
First Language
PT - EN
Primarily Uses
RMMV
This solves everything. Thx a lot :v
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,050
Messages
1,018,548
Members
137,835
Latest member
yetisteven
Top