Classes
Methods
(static) drawArc()
Draw an arc (part of a circle)
(static) drawCircle(circ, yopt, ropt)
Draw an open (not filled) circle (rat.shapes.Circle)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
circ |
Object | number | ||
y |
number |
<optional> |
|
r |
number |
<optional> |
(static) drawLine(p1, p2, p3, p4opt)
Draw a line
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
p1 |
Object | Number | ||
p2 |
Object | Number | ||
p3 |
Object | Number | ||
p4 |
Number |
<optional> |
(static) drawRect(rect, opsopt)
Draw a rectangle (rat.shapes.Rect)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
rect |
Object | ||
ops |
Object |
<optional> |
(static) drawSegmentOrArc(segment, color, widthopt)
Draws the line segment or arc.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
segment |
Object | Object | represents the arc or strait line. | |
color |
string | Object | of the segment. | |
width |
number |
<optional> |
of the segment. |
(static) drawShapeList(list)
Draw a list of shapes (see r_collision2d)
Parameters:
| Name | Type | Description |
|---|---|---|
list |
Array |
(static) drawText(text, xopt, yopt, maxWidthopt)
Draw some text
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text |
string | ||
x |
number |
<optional> |
|
y |
number |
<optional> |
|
maxWidth |
number |
<optional> |
(static) drawTextArc()
See http: www.html5canvastutorials.com/labs/html5-canvas-text-along-arc-path/
(static) init(canvasID)
Init rat.graphics
Parameters:
| Name | Type | Description |
|---|---|---|
canvasID |
string | optional |
(static) popPerfMark()
Pop off a gfx profiling mark. Only works under wraith
(static) pushPerfMark()
Push a gfx profiling mark. Only works under wraith
(static) resetTransform(tctxopt)
Reset the transformation matrix
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tctx |
Object |
<optional> |
(static) restore()
Restore a saved rendering state
(static) rotate(r, tctxopt)
Rotate the current matrix
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
r |
number | ||
tctx |
Object |
<optional> |
(static) save(optionsopt)
Save the current rendering state
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
options |
Object |
<optional> |
{ignoreRatMat:true} You can never set ignoreRatMat to false if it was true. it goes back to false after a .restore |
(static) scale(x, y, tctxopt)
Scale the current matrix
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
x |
number | ||
y |
number | ||
tctx |
Object |
<optional> |
(static) setImageSmoothing()
set canvas imagesmoothing flag on/off
return previously set smoothing flag
(static) setupMatrixForRendering()
Setup the matrix to have any global translation or scale wanted by the game.
(static) transformPoint(destopt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
dest |
Object |
<optional> |
(static) translate(x, y, tctxopt)
Translate the current matrix
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
x |
number | ||
y |
number | ||
tctx |
Object |
<optional> |