Hi, i want to get the name of the picture that has been loaded into bitmapX. Can someone please tell me how?
Get name of bitmap?
Learning Ruby and RGSSxBitmaps 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.
If you mean a picture, you can do $game_map.screen.pictures[id].name where ID is the picture number you loaded it into.
@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?
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?
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.
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.
@Shaz if that's the case. How do you assign a new property for bitmap class?
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
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.
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
Moved to: Learning Ruby and RGSSx
Original thread: https://forums.rpgmakerweb.com/threads/get-name-of-bitmap.114128/