new Decal(texture, dataopt)
- Source:
Create an instance of Decal
Example
// creates a decal
const { Decal } = require('lucid-dream');
const decal = new Decal('foo', {
x: 20,
y: 100,
scaleX: 1,
scaleY: 1
});
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
texture |
String | The texture name to be used for this decal. |
|||||||||||||||||||||||||||
data |
Object |
<optional> |
{}
|
An object containing the attributes of the decal. Properties
|
Methods
toDict() → {Object}
- Source:
Encode a decal into a dictionary
Example
// returns encoded decal dictionary
const { Decal } = require('lucid-dream');
const decal = new Decal('foo', {
x: 20,
y: 100,
scaleX: 1,
scaleY: 1
});
decal.toDict();
Returns:
An object containing the encoded decal dicitonary
- Type
- Object