Creates a new graphics context. This is not intended to be used by user
programs - use CCGraphicsContext.current instead.
The color to use for drawing.
Returns the size of the context, in virtual pixels.
Draw a filled rectangle using the current color.
The rectangle to draw
Draw a rectangle outline using the current color.
The rectangle to draw
Draw text at the specified point on top of existing content. This does not wrap text - any overflow will be clipped.
The leftmost point to draw at
The text to draw
Draw text at the specified point on top of existing content, using the old background color for the foreground (for drawing characters). This does not wrap text - any overflow will be clipped.
The leftmost point to draw at
The text to draw
Draw text at the specified point with a background. This does not wrap text - any overflow will be clipped.
The leftmost point to draw at
The text to draw
Restores the previous state of the graphics context from the stack.
Saves the current state of the context to a stack.
Moves the origin point of the context, resizing the context.
The point to relocate to, relative to the current origin
Repositions the context to a target rectangle, changing both origin and size.
The rectangle to reposition to
Rescales the size of the context. This causes all future points to be scaled to fit inside this size.
The new virtual size of the context
Resizes the context without moving the origin.
The new size of the context. Resizing larger will have no effect.
Moves the virtual origin point of the context. This effectively moves the "draw window" of the context, keeping the size the same and hiding off- screen drawing.
The amount to move the virtual origin
The CCGraphicsContext class is used to draw onto a surface with various transformations applied on top.