Constructor
new Entity(game)
This class allows for creating custom stylesheets for game objects.
Parameters:
Name | Type | Description |
---|---|---|
game |
Carrot.Game | The core game object. |
Methods
add(name, styleopt)
Adds a new CSS rule to the class.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | The unique name of the class. | ||
style |
object |
<optional> |
null | The style of the class. |
add(name, key, value)
Edits an existing CSS rule of the class.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The unique name of the class. |
key |
string | |
value |
string |
remove(name)
Removes an existing CSS rule from the class.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The unique name of the class. |