Difference between revisions of "Rotate Texture by 90 degrees"

From AwkwardTV
Jump to: navigation, search
(New page: {{template:banner}} 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. ---- ...)
 
Line 7: Line 7:
 
==Texture Cache==
 
==Texture Cache==
 
Since we don't want to have to do this stuff everytime our plugin loads, we'll use the 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];

Revision as of 09:03, 8 June 2007

<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];