Rotate Texture by 90 degrees

From AwkwardTV
Revision as of 08:03, 8 June 2007 by Axxr (talk | contribs)
Jump to: navigation, search

<Google>WIKI</Google>

Because I needed a Vertical Progressbar, I had to get images of the stock Progress graphics rotate by 90 degrees. With some help from alan, this is the result.



Texture Cache

Since we don't want to have to do this stuff everytime our plugin loads, we'll use the Texture cache.

- (BRTexture*)loadImageAndRotate:(NSString*)path
{
  NSString* cacheName = [NSString stringWithFormat:@"%iROT_%@", 
                                                 90, 
                                                 [ [path lastPathComponent] 
                                                        stringByDeletingPathExtension] ]; 
  BRTexture* texture = [[self scene] cachedTextureForKey: cacheName];