Anyone know how to draw an icon in a plugin parameter? I'm trying to do this with SRD Timed Attack Mash where it asks what to say above the mash meter thing. Any help is appreciated!
How to draw icon in plugin parameter?
RPG Maker MV Supportif you mean where the text are, I think as simple as eval code:
\\I[IconID] text here
use 2 backslash instead of 1 though. as 1 slash is removed for escape code.
\\I[IconID] text here
use 2 backslash instead of 1 though. as 1 slash is removed for escape code.
Doesn't work, unless I'm missing something else. Here's a screenshot for context.
it seems you can only use String words, so in order to use icons,
you need to modify the plugin where _.Phrase is.
and 1 said "String where you probably can try eval(String(params(_.Phrase))"
and than you could use the escape codes \\I[iconID] but I dont use this plugin,
as I use parameter as "String" and later eval it, so it takes eval string, so string
and eval (for JS code) can be used.
see if that works, but I dont know how the plugin exactly works, so I cannot
really guide you through it or see how it works, hope you get it to change
what I mean though.
you need to modify the plugin where _.Phrase is.
and 1 said "String where you probably can try eval(String(params(_.Phrase))"
and than you could use the escape codes \\I[iconID] but I dont use this plugin,
as I use parameter as "String" and later eval it, so it takes eval string, so string
and eval (for JS code) can be used.
see if that works, but I dont know how the plugin exactly works, so I cannot
really guide you through it or see how it works, hope you get it to change
what I mean though.
there are 3 places, 2 of them draws the param, so try both.
1st try: (copy and paste to read like those)
leave the other one left alone,
if that doesn't work, revert it, and this the next one
if neither work, than I dont know.
another thing I dont get why "speed" can be used in string and JS
while both has "String", but I saw you also can use "phrase" notetag
like that others so far I read it, so you can try there, in default way.
if its in actor tag, try to add it to see what happens, otherwise, I dont know.
1st try: (copy and paste to read like those)
JavaScript:
//_.phrase = String(params['Phrase']);
_.phrase = eval(params['Phrase'])
;
leave the other one left alone,
if that doesn't work, revert it, and this the next one
JavaScript:
//if(o.info.match(/Phrase:\s*(.*)/im)) o.phrase = String(RegExp.$1);
if(o.info.match(/Phrase:\s*(.*)/im)) o.phrase = eval(RegExp.$1);
;
if neither work, than I dont know.
another thing I dont get why "speed" can be used in string and JS
while both has "String", but I saw you also can use "phrase" notetag
like that others so far I read it, so you can try there, in default way.
if its in actor tag, try to add it to see what happens, otherwise, I dont know.
@ShadowDragon You don't want to be running it through an eval(), you're not trying to do some JavaScript function. This has to do with RPG Maker's processes.
The plugin is using drawText() to draw the text, which just prints the straight string. You need to change that to drawTextEx() to parse escape codes.
The trick is, as seen on line 375 of the plugin, SRD is not creating a window for this - he's creating an image on the screen, and using Bitmap.drawText() to create the text.
And Bitmap does not have a version of drawTextEx(). So changing this is a more complex alteration than just modifying one line of code.
The plugin is using drawText() to draw the text, which just prints the straight string. You need to change that to drawTextEx() to parse escape codes.
The trick is, as seen on line 375 of the plugin, SRD is not creating a window for this - he's creating an image on the screen, and using Bitmap.drawText() to create the text.
And Bitmap does not have a version of drawTextEx(). So changing this is a more complex alteration than just modifying one line of code.
TSR_TextColorAddon might have Bimap.drawTextEx so it might work
when that plugin is installed too.
I though drawTextEx has a different function, but if that draws Icons,
than I need to remember that apart from drawText.
when that plugin is installed too.
I though drawTextEx has a different function, but if that draws Icons,
than I need to remember that apart from drawText.
I haven't been able to get it to work so I'll just settle for text for now :-/ SRD's plugins are always super goofy lol
What if I wanted to just draw a saved image of some kind in there? Does it work like that?
FIGURED IT OUT! Sorta 
I modified the plugin to allow putting an image, definable in the plugin parameters, between the timer and gauge. Check it out! I'm using it so that I can put a picture of the button they're supposed to be pressing on there so it's more intuitive.

I modified the plugin to allow putting an image, definable in the plugin parameters, between the timer and gauge. Check it out! I'm using it so that I can put a picture of the button they're supposed to be pressing on there so it's more intuitive.
If it helps, the earlier suggestions did not work because the RPGmaker engine actually has two built-in two methods of drawing text. One method supports icons and numerous other codes for colors and potentially pauses, the other method is text-only but supports left/center/right alignment and allows stretching text to fit into smaller widths.
The plugin seems to be using the more lightweight method that doesn't support icons, but allows centering which might be the reason why SRD opted to use that method over the other.
The plugin seems to be using the more lightweight method that doesn't support icons, but allows centering which might be the reason why SRD opted to use that method over the other.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-draw-icon-in-plugin-parameter.162169/