Hi, I'm writing a RMMZ plugin that extends Sprite and loads a bitmap into the sprite.
I can load an image into the sprites bitmap with:
However although the image loads this.bitmap.width and this.bitmap.height are zero.
I can get the image to display using something like:
However I need to know what the actual width and height of the .png file I am loading is through code.
I could possibly use Bitmap.getPixel or Bitmap.getAlphaPixel to identify the edges of the actual image, but my hope is an easier way exists.
Any ideas how I can dynamically obtain the width and height of the image I am loading?
I can load an image into the sprites bitmap with:
JavaScript:
this.bitmap=Bitmap.load("/img/pictures/msgimg_0.png");
However although the image loads this.bitmap.width and this.bitmap.height are zero.
I can get the image to display using something like:
JavaScript:
this.bitmap.resize(Graphics.width,Graphics.height);
However I need to know what the actual width and height of the .png file I am loading is through code.
I could possibly use Bitmap.getPixel or Bitmap.getAlphaPixel to identify the edges of the actual image, but my hope is an easier way exists.
Any ideas how I can dynamically obtain the width and height of the image I am loading?