Width of Picture on screen using ID

Hi

I was wondering if there is a script call and I can use within an event to get the width of a picture being shown on screen using its Number/ID you set when using the show picture command?

Any help would be appreciated 🙂

Thanks

Beenbaba
you can get the picture object with :  $gameScreen._pictures[id]

im not sure if it has a property for width or height exposed..  check the help documentation.. or run that line in dev tools to see what properties are available.

Sorry I don't have access to the designer now.. and the help files are not available online for some reason.

Cheers!
Hi Leeway,

I can use $gameScreen._pictures[1]._name to get the name of the picture but ._width or .width just returns 0  (assigning to a variable within an event then displaying in a message box)

I'm guessing it doesn't have a width value hmm
Ok so after playing around a bit.. i found a way to get the original size of the image.. 

It may not be the best way.. but so far this is all i have found.

//This will get the height of the image//replace x with the id of the picture you want to getImageManager.loadPicture($gameScreen._pictures[x].name()).height;//This will get the width of the imageImageManager.loadPicture($gameScreen._pictures[x].name()).widthNot sure how efficient this is.. but its all i have found.. If i get some free time.. ill see if i can write a plugin to extend the Game_Picture object to expose the original width and height.

I hope this helps.

Cheers!
Yep that did the trick, thanks Leeway 😀

And yes plugin would be cool 🙂

Original thread: https://forums.rpgmakerweb.com/threads/width-of-picture-on-screen-using-id.54985/