Interface IBodySpriteRender

Hierarchy

Properties

fillStyle: string

A String that defines the fill style to use when rendering the body (if a sprite is not defined). It is the same as when using a canvas, so it accepts CSS style property values. Default: a random colour

lineWidth: number

A Number that defines the line width to use when rendering the body outline (if a sprite is not defined). A value of 0 means no outline will be rendered.

Default

1.5
opacity: number
sprite: {
    texture: string;
    xOffset: number;
    xScale: number;
    yOffset: number;
    yScale: number;
}

An Object that defines the sprite properties to use when rendering, if any.

Type declaration

  • texture: string

    An String that defines the path to the image to use as the sprite texture, if any.

  • xOffset: number

    A Number that defines the offset in the x-axis for the sprite (normalised by texture width).

    Default

    0
    
  • xScale: number

    A Number that defines the scaling in the x-axis for the sprite, if any.

    Default

    1
    
  • yOffset: number

    A Number that defines the offset in the y-axis for the sprite (normalised by texture height).

    Default

    0
    
  • yScale: number

    A Number that defines the scaling in the y-axis for the sprite, if any.

    Default

    1
    
strokeStyle: string

A String that defines the stroke style to use when rendering the body outline (if a sprite is not defined). It is the same as when using a canvas, so it accepts CSS style property values. Default: a random colour

visible: boolean

A flag that indicates if the body should be rendered.

Default

true

Generated using TypeDoc