0
\$\begingroup\$

I'm trying to make a script on RPG Maker XP that needs the width and height of an image to do some calculations. I tried @picture.bitmap.widthand @picture.bitmap.height but it returned the width and height of the image that is being shown in the screen.

For instance, if the image is 800 pixels height, and the image takes 400 pixels in the screen, @picture.bitmap.height will only return 400. This is the code I'm using:

@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("picture")
@pictureWidth = @picture.bitmap.width
@pictureHeight = @picture.bitmap.height
\$\endgroup\$
2
  • \$\begingroup\$ What decides how many pixels it will take on the screen? \$\endgroup\$ Commented Mar 1, 2014 at 9:43
  • \$\begingroup\$ The windows above it. Although I've realized what the problem was, as stated in my answer. Thank you so much for your attention, though. \$\endgroup\$ Commented Mar 1, 2014 at 20:21

1 Answer 1

1
\$\begingroup\$

I've realized what the problem was. I had made another picture, bigger than the screen size to test the script. But I forgot to import it to RMXP. Now that I've done that, it prints the correct value to the screen. Apologies for my lack of attention.

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.