How to change labels to icons?

Status
Not open for further replies.

LittlePIGGY

Just a piggy
Veteran
Joined
Aug 17, 2019
Messages
116
Reaction score
953
First Language
Russian
Primarily Uses
RMMV
Hi~
I want to replace short names in the system (TP, MP, HP) for all menus by appropriate icons. BUT HOW
\i[1688] (placed into "terms") didn't work - MV show just code. Not an icons
:kaocry:
 

BlitzMalachite

The Masterminded
Veteran
Joined
Aug 1, 2019
Messages
120
Reaction score
72
First Language
English
Primarily Uses
RMMV
Use both Yanfly's Message Core and Core Engine. It might work.
If you wanna turn them into icons. Simply remove their name and replace them with \i[x]
Hi~
RPG maker MV just shows the text. Not the icon.:kaocry:
I've fixed some grammar mistakes for you :kaohi:
 
Last edited:
  • Like
Reactions: Bex

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,644
First Language
Czech
Primarily Uses
RMMV
The simplest way: It would require to replace all drawText functions with drawTextEx, wherever you want to replace the text with icons.

Since various menu plugins might use different things, you'll want to find the functions searching for:
TextManager.hpA
TextManager.mpA
TextManager.tpA

The A means abbreviation. Then you take the line (important: ONLY that line) that contains this and replace drawText with drawTextEx. You can also delete the width, since drawTextEx uses only x and y as parameters.

For example, searching in rpg_windows, I find this (it draws actor HP in the game menu):

Code:
Window_Base.prototype.drawActorHp = function(actor, x, y, width) {
    width = width || 186;
    var color1 = this.hpGaugeColor1();
    var color2 = this.hpGaugeColor2();
    this.drawGauge(x, y, width, actor.hpRate(), color1, color2);
    this.changeTextColor(this.systemColor());
    this.drawText(TextManager.hpA, x, y, 44);
    this.drawCurrentAndMax(actor.hp, actor.mhp, x, y, width,
                           this.hpColor(actor), this.normalColor());
};
So I take the line, where TextManager.hpA is, and replace this.drawText with this.drawTextEx. This is the result.
Code:
Window_Base.prototype.drawActorHp = function(actor, x, y, width) {
    width = width || 186;
    var color1 = this.hpGaugeColor1();
    var color2 = this.hpGaugeColor2();
    this.drawGauge(x, y, width, actor.hpRate(), color1, color2);
    this.changeTextColor(this.systemColor());
    this.drawTextEx(TextManager.hpA, x, y);
    this.drawCurrentAndMax(actor.hp, actor.mhp, x, y, width,
                           this.hpColor(actor), this.normalColor());
};
The good thing is, you don't need to search every plugin you have, only the plugins you have that in some sort create their own windows.

@Jaase No, Yanfly's message core doesn't change everything to drawTextEx. So that wouldn't work.
 

LittlePIGGY

Just a piggy
Veteran
Joined
Aug 17, 2019
Messages
116
Reaction score
953
First Language
Russian
Primarily Uses
RMMV
The simplest way: It would require to replace all drawText functions with drawTextEx, wherever you want to replace the text with icons.
God, I hope I don't break anything. I don't really trust myself. Especially when it came to code. I'm clinically dyslexic. I will tell you how I managed. Thanks for the answer!
 

LittlePIGGY

Just a piggy
Veteran
Joined
Aug 17, 2019
Messages
116
Reaction score
953
First Language
Russian
Primarily Uses
RMMV
For me plugin didn't work
 

LittlePIGGY

Just a piggy
Veteran
Joined
Aug 17, 2019
Messages
116
Reaction score
953
First Language
Russian
Primarily Uses
RMMV
It needs MORE plugins there.
It seems to me more plugins - more bugs? Feel stupid :kaodes:
 

LittlePIGGY

Just a piggy
Veteran
Joined
Aug 17, 2019
Messages
116
Reaction score
953
First Language
Russian
Primarily Uses
RMMV
I put the second plugin and it undid the work of all the others, including the orange overlay.
So... think my best shot is still coding... god have mercy on my project
:kaoswt2:
 

mishakoc

Professional Procrastinator
Veteran
Joined
Jan 1, 2019
Messages
143
Reaction score
871
First Language
Czech
Primarily Uses
RMMV
Have you tried what Poryg suggested? It's very simple to execute and works well.
 

LittlePIGGY

Just a piggy
Veteran
Joined
Aug 17, 2019
Messages
116
Reaction score
953
First Language
Russian
Primarily Uses
RMMV
Have you tried what Poryg suggested? It's very simple to execute and works well.
I have dyslexia, it's hard for me to be sure of the text found. Asked what exactly the files in the project to seek the necessary lines. Waiting for reply.
 

mishakoc

Professional Procrastinator
Veteran
Joined
Jan 1, 2019
Messages
143
Reaction score
871
First Language
Czech
Primarily Uses
RMMV
You need to change it in rpg_windows.js and maybe some other plugins, depending on what you have. For example, by quickly looking, VisualHpGauge has this drawText function.
You need to open your js folder, search eg. TextManager.hpA by copying it to the search field. Open the .js files that pop up, ctrl-F to search inside the file, paste TextManager.hpA into the search field again. Then check if there's "this.drawText" in the same line and change it to "this.drawTextEx".
Really no need to search for it manually, let the computer do its job.
 

LittlePIGGY

Just a piggy
Veteran
Joined
Aug 17, 2019
Messages
116
Reaction score
953
First Language
Russian
Primarily Uses
RMMV
I failed. I do not understand that where to find where to copy and what to replace. Too difficult (
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,644
First Language
Czech
Primarily Uses
RMMV
Well, in the end I made her the plugin. Problem solved I guess :D
 

LittlePIGGY

Just a piggy
Veteran
Joined
Aug 17, 2019
Messages
116
Reaction score
953
First Language
Russian
Primarily Uses
RMMV
This guy is a MAGICIAN! *Vzhuh* and it worked )
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,016
Reaction score
5,326
First Language
Dutch
Primarily Uses
RMXP

@LittlePIGGY, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.


In fact, you posted five times in a row. In the future, please use the 'Edit' button if you wish to add something to your last post.

Since it's solved I'll go ahead and close this as well.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

A part of me wants to return back to the beginning and first two chapters and remake them with parallax map. But I have decided not to. Every chapter is just another step in the journey. No need to walk back unless I have to revise dialouge.
Hey guys! Good news!
I just released the Games from Brazil - Part 2 on my Youtube Channel! I am really happy that part 1 had 100 views and I hope more people will be interested to see the potencial of Brazilian Game Devs!
Effervesce Fallacy™ - Attract Mode (proto)

Forum statistics

Threads
107,570
Messages
1,030,643
Members
139,671
Latest member
WDRS
Top