Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
This script allows you to designate which icon sheet you want to draw your icon from. This allows you to organize your icons so that you don't need to load one large iconset just to draw one icon.

Separate your icons into separate files, then load them by name and index!

You can even specify different icon sizes for different sheets.

Download

Get it at Hime Works

The icon index utility I use in the example below can be found here

Usage

Installation

Place this script below Materials and above Main.

Setting up icon sheets

Place any custom icon sheets in your Graphics/System folder.

In the configuration below, add the filenames (without extensions) to the

`Icon_Sheets` hash and the width and height of the icons for those sheets.

You must also include the default icon sheet to use,

which is "Iconset"

customIconSheets5.jpg


Using custom icon sheets

Now that you have set up your icon sheets, you can begin using them.

In your database, note-tag objects with

<icon: name index>Where`name` is the exact filename of the icon sheet, without extensions

`index` is the index of the icon in the specified file.

For example, suppose I have the following icon sheet called "CustomIcons"

customIconSheets2.jpg


After looking up the icon index, I want to assign it to my Potion item

customIconSheets3.jpg


Now when I load up the game, I will see that my potion is using the custom icon

customIconSheets4.jpg
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,510
Reaction score
12,013
First Language
English
Primarily Uses
RMVXA
Another little gem to make our lives easier.  Thank you.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
This script overwrites how icon drawing is done. Instead of simply loading "Iconset", it instead calls this function

bitmap, new_icon_index = TH::Custom_Icon_Sheets.load_icon_sheet(icon_index)The function takes the item's icon index and returns a bitmap, and a new icon index, which are then used to draw the icon. If your script has its own icon drawing methods, then you should update those methods appropriately.

For example, yanfly's shop system can be patched with

class Window_ShopData < Window_Base def draw_item_image colour = Color.new(0, 0, 0, translucent_alpha/2) rect = Rect.new(1, 1, 94, 94) contents.fill_rect(rect, colour) if @item.image.nil? bitmap, icon_index = TH::Custom_Icon_Sheets.load_icon_sheet(@item.icon_index) rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24) target = Rect.new(0, 0, 96, 96) contents.stretch_blt(target, bitmap, rect) else bitmap = Cache.picture(@item.image) contents.blt(0, 0, bitmap, bitmap.rect, 255) end endend
And CSCA's bestiary script can similarly be patched with

Code:
class CSCA_Window_EncyclopediaInfo < Window_Base  def csca_draw_icon(item)    if item.csca_custom_picture == ""      bitmap, icon_index = TH::Custom_Icon_Sheets.load_icon_sheet(item.icon_index)      rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)      target = Rect.new(0,0,72,72)      contents.stretch_blt(target, bitmap, rect)    else      bitmap = Bitmap.new("Graphics/Pictures/"+item.csca_custom_picture+".png")      target = Rect.new(0,0,72,72)      contents.stretch_blt(target, bitmap, bitmap.rect, 255)    end  endend
 
Last edited by a moderator:

JoshJ5Hawk

Villager
Member
Joined
Jun 10, 2013
Messages
6
Reaction score
0
First Language
English
Primarily Uses
I love this script, but sadly it doesn't seem to be compatible with things such as YanFly Engine Ace - Command Window Icons

Does anyone seem to have a fix for such a problem?

EDIT: Nevermind, I seem to have fixed it, a suggestion to maybe edit the main script for this

Icon_Sheets = ["CustomIcons", "Iconset"]To:

Icon_Sheets = ["Iconset", "CustomIcons"]Seems to have fixed all the problems :)
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
I've updated the script so that Iconset comes first.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
I have updated the script to allow you to specify the width and height of each sheet individually.


So for example, one sheet might use 24x24 icons, while another sheet might use 32x32 icons, while another sheet might use 65x65 icons.


customiconsheets5.jpg
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,693
Reaction score
3,023
First Language
Tagalog
Primarily Uses
RMVXA
nice update... It's good to have that...
 

ertyearth

Warper
Member
Joined
Dec 2, 2015
Messages
2
Reaction score
2
First Language
english
Primarily Uses
anyone have this script? I cant seem to have a copy.
i want to try this but the links are down.
Thank you so much guys!
 

Latest Threads

Latest Posts

Latest Profile Posts


The projectiles shown in this video are as follows:
1, Basic Triple
2, 30-Degree Arc
3, Randomized Blast Wave
4, 8-way
5, 8-way Double
6, 8-way Slowness
7, 120-Degree Arc Repetitive
8, Projective Triple
9, Split 8-way
10, 2-way Split Randomized Arc
11, HP-MP Split Arc
12, Split Laser
13, Shock
14, Cosine
Drop shadows and water reflections tests in RPG Maker VX Ace


BgI3F80.png
I'm doing a fairy tale project Little Red Riding Hood and the Woodsman. I'm almost done with the demo in my native language and I intend to make a demo version in English as well. I'm just going to use the translator because I don't know the pronunciations very well, I only know how to say "Hey" and nothing else.. :kaoswt2:

Forum statistics

Threads
118,617
Messages
1,117,351
Members
155,697
Latest member
ghn
Top