Hey all. Do you think it would be neat to have a function to get a Bitmap objects TextureRegion? I do. It seems that getTextureRegion() is only valid for TexturePacks (which I tend to avoid).
Currently if you want to modify a Bitmaps TextureRegion you either have to use TextureRegion.new() or save a pointer to the original TextureRegion instance when creating the bitmap (bitmap.region = region) so you can then use setRegion()
It seems that the only use for setRegion() is is you bothered to save a pointer to the TextureRegion yourself.
Comments
sorry, I don't really get it
So there is Bitmap:setTextureRegion
http://docs.giderosmobile.com/reference/gideros/Bitmap/setTextureRegion#Bitmap:setTextureRegion
And there is TextureRegion:getTextureRegion
http://docs.giderosmobile.com/reference/gideros/TextureRegion#TextureRegion
and TexturePack:getTextureRegion
http://docs.giderosmobile.com/reference/gideros/TexturePack/getTextureRegion#TexturePack:getTextureRegion
So you take values from latter and use it in Bitmap.
How do you imagine having Bitmap:getTextureRegion? Bitmap is not a texture
With Bitmap:setTextureRegion() you have to feed it a TextureRegion. You either have to create a new one, or store the actual one when you make a Bitmap.
At the end of the day I can just keep manually storing the TextureRegion when I create new Bitmaps. I just thought it would be easier if Gideros did that for me, and then could fetch it later when I needed to modify it with setRegion().
Something like that?
Gideros is plain and simple and we don't do such cross interaction with classes behind the scene. But it could be a place for libraries like GiderosCodingEasy, but basically my point is, you can easily extend Bitmap class to do that
Likes: antix