Author Topic: Suggestion: Method for creating empty texture of specified size, with alpha  (Read 2048 times)

Offline paulscode

  • double
  • *****
  • Posts: 863
    • View Profile
    • PaulsCode.Com
Currently, there is no method for creating an empty/black texture of a specified size with alpha, something like this:

Code: [Select]
myTexture = new Texture( width, height, true );
This would be useful for cases where a texture's contents are generated entirely through an ITextureEffect implementation where alpha is used (i.e. if there is no "initial" frame to use when instantiating the Texture).  This is not high-priority for me, though.  I came up with a workaround that seems to function the same way:

Code: [Select]
BufferedImage image = new BufferedImage( width, height, BufferedImage.TYPE_4BYTE_ABGR );
myTexture = new Texture( image, true );

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Suggestion: Method for creating empty texture of specified size, with alpha
« Reply #1 on: September 26, 2010, 11:31:51 pm »
Sounds reasonable. I'll look into it...