Public Member Functions | Static Public Member Functions | Properties

CCRenderTexture Class Reference

#import <CCRenderTexture.h>

Inherits CCNode.

Collaboration diagram for CCRenderTexture:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - initWithWidth:height:
(BOOL) - saveBuffer:
(BOOL) - saveBuffer:format:
(void) - clear:g:b:a:

Static Public Member Functions

(id) + renderTextureWithWidth:height:

Properties

CCSpritesprite

Detailed Description

RenderTexture is a generic rendering target. To render things into it, simply construct a render target, call begin on it, call visit on any cocos scenes or objects to render them, and call end. For convienience, render texture adds a sprite as it's display child with the results, so you can simply add the render texture to your scene and treat it like any other CocosNode. There are also functions for saving the render texture to disk in PNG or JPG format.

Since:
v0.8.1

Definition at line 49 of file CCRenderTexture.h.


Member Function Documentation

- (void) clear: (float)  r
g: (float)  g
b: (float)  b
a: (float)  a 

clears the texture with a color

- (id) initWithWidth: (int)  width
height: (int)  height 

initializes a RenderTexture object with width and height

+ (id) renderTextureWithWidth: (int)  width
height: (int)  height 

creates a RenderTexture object with width and height

- (BOOL) saveBuffer: (NSString *)  name  

saves the texture into a file

- (BOOL) saveBuffer: (NSString *)  name
format: (int)  format 

saves the texture into a file. The format can be JPG or PNG


Property Documentation

- (CCSprite*) sprite [read, write, assign]

sprite being used

Definition at line 58 of file CCRenderTexture.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

cocos2d for iPhone 0.99.4 API Reference - Generated using Doxygen 1.7.1