Get name of bitmap?

BlueMage

Slime Lv99
Veteran
Joined
Apr 13, 2019
Messages
116
Reaction score
149
First Language
English
Primarily Uses
RMVX
Hi, i want to get the name of the picture that has been loaded into bitmapX. Can someone please tell me how?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Bitmaps do not have names. What is "bitmapX"? How are you loading it?

If you mean a picture, you can do $game_map.screen.pictures[id].name where ID is the picture number you loaded it into.
 

BlueMage

Slime Lv99
Veteran
Joined
Apr 13, 2019
Messages
116
Reaction score
149
First Language
English
Primarily Uses
RMVX
@Shaz Hi, i have a script that preload bunch of bitmap at Spriteset_map. (1)
Later on map, i need to get the names of the pictures that had been loaded at (1) step.
But i am not sure how can i get the image name from a sprite/bitmap
Normally it's bitmap._image in MV, however i am not sure how to do it in VxAce?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
We can't tell you how the script names the bitmaps if you don't tell us what the script is ;)

Please provide a link, not just the name.

It may not save the name at all. As I said, bitmaps don't have names. The script might use the name purely for loading, and then not at all afterwards, so no need to even save it.
 

BlueMage

Slime Lv99
Veteran
Joined
Apr 13, 2019
Messages
116
Reaction score
149
First Language
English
Primarily Uses
RMVX
@Shaz if that's the case. How do you assign a new property for bitmap class?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
As shaz mentioned, Bitmap doesn't have names. If you want to record the name, you can try at least modify the bitmap class something like this
Code:
class Bitmap
  attr_reader :name
  alias init initialize
  def initialize(*args)
    if args[0].is_a?(String)
      @name = args[0]
    end
    init(*args)
  end
end
Then you can get the name of the bitmap. However, if the bitmap is created from plain integer to determine the size, e.g, Bitmap.new(32,32) then it will not have a name.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[move]Learning Ruby and RGSSx[/move]
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top