Hello again,
I am trying to load a png with texture 2D. Can someone please point me out where I can find more information about pixelFormat? and what kind of formats I can choose from? I'd appreciate you're help.
The code I am working with:
//makes a link to the file
NSString *mytest = [[NSBundle mainBundle] pathForResource
"brick" ofType
"png"];
NSData *mydata = [NSData dataWithContentsOfFile:mytest];
//loads the file
testTexture = [[Texture2D alloc] initWithData:[mydata bytes] pixelFormat:kTexture2DPixelFormat_RGBA_PVRTC4 pixelsWide:64 pixelsHigh:64 contentSize:CGSizeMake(64,64)];
I need to change this part of the code pixelFormat:kTexture2DPixelFormat_RGBA_PVRTC4 to something the PNG format desires but I can't seem to find the documentation.
What i'm trying to do is load an image of a character sprite for a game, which also has an alpha channel (parts where you can see through the image). Loading it as a pvr file makes the see through parts black. So how can I make this support png with alpha channel? (and if possible allowing images with dimensions other than powers of 2's.)
I also have another question which doesn't need to be answered. Is their a way I can load 3ds files using a similar method as above? It'd be great help if you knew the answer.
I am trying to load a png with texture 2D. Can someone please point me out where I can find more information about pixelFormat? and what kind of formats I can choose from? I'd appreciate you're help.
The code I am working with:
//makes a link to the file
NSString *mytest = [[NSBundle mainBundle] pathForResource
NSData *mydata = [NSData dataWithContentsOfFile:mytest];
//loads the file
testTexture = [[Texture2D alloc] initWithData:[mydata bytes] pixelFormat:kTexture2DPixelFormat_RGBA_PVRTC4 pixelsWide:64 pixelsHigh:64 contentSize:CGSizeMake(64,64)];
I need to change this part of the code pixelFormat:kTexture2DPixelFormat_RGBA_PVRTC4 to something the PNG format desires but I can't seem to find the documentation.
What i'm trying to do is load an image of a character sprite for a game, which also has an alpha channel (parts where you can see through the image). Loading it as a pvr file makes the see through parts black. So how can I make this support png with alpha channel? (and if possible allowing images with dimensions other than powers of 2's.)
I also have another question which doesn't need to be answered. Is their a way I can load 3ds files using a similar method as above? It'd be great help if you knew the answer.