Using resource numbers for things.

So you know how some scripts come with (and use) those custom numbers images resources?  Like how custom battle systems and custom timers usually use custom numbers? I was thinking, for the sake of uniform and aesthetics, is it possible to code those resource numbers to work with other things that are also numbers?

Like for example, damage numbers popups also working with Window_BattleStatus or Window_Menu and such. (instead of the default numbers)

Is there already something made to accomplish this? How would I go about with this if I wanted to create such a thing myself?
I think a good way is to use custom fonts and then simply draw everything normally with those fonts.


But I don't know whether RM has support for all sorts of fancy fonts though.
Wait do number popup resources involve being considered 'fonts', or are related to them?

I think you have the wrong thread tsuki. x_x

Edit: I just though of something. Where are the default numbers stored for Ace? (They're not resources apparently)
You want numbers to popup in your status menu? I don't understand.
Well after some research, yeah it is a font thing, but I would like to use number resources for all things (or specific things) number-ish instead of the set font.
maybe you can change font before showing the numbers, then change to default font afterwards...
Ok, what you want, Kerbonklin, is to use the numbers provided by battle systems for other uses, such as timers or similar systems that display numbers, is that correct? Numbers such as these:

0CFZ6hb.png


These are cut and pasted in from the saved image. Each number (or word, with the example) has to be copied from a bitmap that has this loaded onto it. In order to use something like this, you need to make a bitmap with this in Ruby, and then to get the specific numbers, you need to figure out (mathematically) where they are and copy them from the bitmap with all the numbers onto the one you're using to display whatever you're using it for.

It doesn't matter what you want to use it for, that's really the only way to do it. Make one bitmap with the whole thing and then copy the bits you want to use over onto a new one for display.
just like how scenes draw things like actor face graphics from the face sheets...
Yeah, you two are right on-spot. I'm trying to research some HUD scripts as examples to learn how bitmaps work with the number images.

One thing I was thinking was since parameter numbers draw using draw_text((x + 120, y, 36, line_height, actor.param(param_id), 2)  (Taken from Window_Base), I would have to convert this into some kind of bitmap form.

Meh idunno i'm still learning lol.
yeah... just take a look at how the scenes draw the actor face graphics for example, and try to reimplement it for the number pictures

basically, you need to calculate the exact position of each number in the picture so that you can show it...

alternatively, you can probably separate each number into it's own file so that you can simply draw the whole image... and name them according to their value like 1.png, 2.png, 3.png
Well guys, I managed to nit-pick at the MOG Active Timer script and successfully created a standalone bitmap/sprite image support script for the Timer using whatever number image desired. (Image having one set of 0-9) This involved taking the timer number stuff separately and deleting all the other non-needed functions of the script.

I definitely learned quite a bit about bitmaps and scripting doing this, now hopefully I can figure out how to do this with parameter draws.
If you're going with the bitmap approach you might consider overwriting the draw_text or draw_text_ex methods in Window_Base to first check what the text is (eg: number or non-number?).

Original thread: https://forums.rpgmakerweb.com/threads/using-resource-numbers-for-things.17143/