Class: Debug

Carrot.Debug(game)

Carrot.Debug

Constructor

new Debug(game)

This class offers methods to debug the game.
Parameters:
Name Type Description
game Carrot.Game The core game object.
Source:

Methods

cameraInfo(xopt, yopt)

Shows detailed debug info about the camera.
Parameters:
Name Type Attributes Default Description
x integer <optional>
0 The x position on screen.
y integer <optional>
0 The y position on screen.
Source:

sprite(file) → {object}

Converts CSV into JSON. The CSV file / string is being processed vertically, having the first line defining the properties and every following line defining a new entry.
Parameters:
Name Type Description
file string The CSV file to convert. Must be a string.
Source:
Returns:
Type
object

sprite(sprite, coloropt, borderopt)

Shows a debug rectangle of the same size as the sprite.
Parameters:
Name Type Attributes Default Description
sprite Carrot.Sprite The sprite to debug.
color string <optional>
rgba(0, 255, 0, 0.33) The color to tint the sprite width.
border boolean <optional>
false Defined if the debug div should only consist of a border.
Source:

sprite(sprite, xopt, yopt)

Shows detailed debug info about a sprite.
Parameters:
Name Type Attributes Default Description
sprite Carrot.Sprite The sprite to debug.
x integer <optional>
0 The x position on screen.
y integer <optional>
0 The y position on screen.
Source:

text(xopt, yopt)

Displays some text.
Parameters:
Name Type Attributes Default Description
x integer <optional>
0 The x position on screen.
y integer <optional>
0 The y position on screen.
Source: