AddedLayer

Draw added detail layers on top of some obstacles and sometimes the player

Measurements for details such as sizes, thicknesses etc are given as a proportion of the item radius.

  • This allows the layers to scale with the different-sized items
  • A value of 1 is equal to the item radius
  • _target params will either be obstacles or the player
Author
  • Mark Mayes / mm-dev
License
  • GPL-3.0-only

Methods

(static) drawBowler(_x, _y, _target, _data)

Source
Bowler-style hat
Parameters
Name Type Description
_x number

X coordinate of the item centre

_y number

Y coordinate of the item centre

_target object

The item to draw on top of

_data object
Name Type Description
offsetFromCenter number

Distance of the hat from the centre of the target

thickness number

Overall size of the hat

colorOuter number

Outer/rim colour

colorInner number

Inner colour

(static) drawDot(_x, _y, _target, _data)

Source
Simple dot/circle
Parameters
Name Type Description
_x number

X coordinate of the item centre

_y number

Y coordinate of the item centre

_target object

The item to draw on top of

_data object
Name Type Description
color number

Main color

extension number

How far the dot extends from the centre

(static) drawEyes(_x, _y, _target, _data)

Source
Eyes for a character
Parameters
Name Type Description
_x number

X coordinate of the item centre

_y number

Y coordinate of the item centre

_target object

The item to draw on top of

_data object
Name Type Description
color number

Main color

offsetFromCenter number

Distance of eyes from the centre of the target

degreeSpan number

How far apart the eyes are

thickness number

Size of eyes

(static) drawHelicopterTailPropeller(_x, _y, _target, _data)

Source
Rotating top-down propeller
Parameters
Name Type Description
_x number

X coordinate of the item centre

_y number

Y coordinate of the item centre

_target object

The item to draw on top of

_data object
Name Type Description
color number

Main color

extension number

Span of propeller

thickness number

Thickness of propeller

(static) drawMouth(_x, _y, _target, _data)

Source
Mouth for character
Parameters
Name Type Description
_x number

X coordinate of the item centre

_y number

Y coordinate of the item centre

_target object

The item to draw on top of

Name Type Attributes Description
stretch number optional

How far open the mouth is

_data object
Name Type Description
color number

Main color

offsetFromCenter number

Distance of the mouth from the centre of the target

(static) drawSpokes(_x, _y, _target, _data)

Source
Spokes eg for bicycle wheels
Parameters
Name Type Description
_x number

X coordinate of the item centre

_y number

Y coordinate of the item centre

_target object

The item to draw on top of

_data object
Name Type Description
color number

Main color

thickness number

Spoke thickness

extension number

How far the spokes extend from the centre

(static) drawStem(_x, _y, _target, _data)

Source
Stem for leaves
Parameters
Name Type Description
_x number

X coordinate of the item centre

_y number

Y coordinate of the item centre

_target object

The item to draw on top of

_data object
Name Type Description
color number

Main color

offsetFront number

Distance from the centre of the front/tip

offsetRear number

Distance from the centre of the rear/butt

degreeSpanFront number

Thickness of the front part of the stem, given as degrees of arc

degreeSpanRear number

Thickness of the rear part of the stem, given as degrees of arc

(static) drawStetson(_x, _y, _target, _data)

Source
Stetson-style hat
Parameters
Name Type Description
_x number

X coordinate of the item centre

_y number

Y coordinate of the item centre

_target object

The item to draw on top of

_data object
Name Type Description
offsetFromCenter number

Distance of the hat from the centre of the target

thickness number

Overall size of the hat

colorOuter number

Outer/rim colour

colorInner number

Inner colour

(static) drawTriangles(_x, _y, _target, _data)

Source
Stylised cracks effect based on several random overlapping triangles
Parameters
Name Type Description
_x number

X coordinate of the item centre

_y number

Y coordinate of the item centre

_target object

The item to draw on top of

_data object
Name Type Description
color number

Main color

thickness number

Line thickness

triangle_ar number

Array of triangle points