Skip to content
y-lohse edited this page Dec 28, 2012 · 4 revisions

When drawing to a canvas, many things are related to a CanvasRenderingContext. The Cannon.Context provides an abstract rendering context that you can use to draw things that are not directly related to a certain canvas (eg. gradients).

The properties of the Cannon.Context object provide constants for different drawing options, all related to CanvasRenderingContext objects.

Functions

getInstance:CanvasRenderingContext

Description

Returns an instance of a CanvasRenderingContext. It's not directly related to a canvas, so feel free to do whatever you want with it.

Properties

LineCap

  • BUTT
  • ROUND
  • SQUARE

LineJoin

  • ROUND
  • BEVEL
  • MITTER

TextAlign

  • START
  • END
  • LEFT
  • RIGHT
  • CENTER
  • IDEOGRAPHIC
  • BOTTOM

TextBaseline

  • TOP
  • HANGING
  • MIDDLE
  • ALPHABETIC
  • IDEOGRAPHIC
  • BOTTOM

TextRenderStyle

  • FILL
  • STROKE

Compositing

  • SourceOver
  • SourceIn
  • SourceOut
  • SourceAtop
  • DestinationOver
  • DestinationIn
  • DestinationOut
  • DestinationAtop
  • Lighter
  • Copy
  • Xor

Repeat

  • Repeat
  • RepeatX
  • RepeatY
  • NoRepeat