Class: Sheet
Hierarchy
Rectangle
↳
Sheet
Constructors
constructor
• new Sheet(width?
, height?
, x?
, y?
, rot?
)
Creates an instance of Sheet extends Rectangle
from MaxrectsPacker
memberof
Sheet
Parameters
Name | Type | Default value |
---|---|---|
width | number | 0 |
height | number | 0 |
x | number | 0 |
y | number | 0 |
rot | boolean | false |
Overrides
Rectangle.constructor
Defined in
Properties
anchor
• anchor: Vec2
anchor/pivot point
memberof
Sheet
Defined in
dummy
• dummy: string
[] = []
Dummy tag which represent a clone of other sheet
memberof
Sheet
Defined in
frame
• frame: Rectangle
frame rectangle to be rendered to final atlas
memberof
Sheet
Defined in
last
• last: boolean
= false
for controlling mustache template trailing comma, don't touch
memberof
Sheet
Defined in
name
• name: string
= ""
sprite name, normally filename before packing
if Atlasify.Options.basenameOnly = true
there will be no extension.
if Atlasify.Options.appendPath = true
name will include relative path.
memberof
Sheet
Defined in
nineSliceFrame
• nineSliceFrame: Rectangle
9-sliced center rectangle
memberof
Sheet
Defined in
sourceFrame
• sourceFrame: Rectangle
orignal source rectangle
x
and y
refer to the negative offset from the frame rectangle
memberof
Sheet
Defined in
tag
• Optional
tag: string
tag of group packing
memberof
Sheet
Defined in
trimmed
• trimmed: boolean
= false
alpha trimmed
memberof
Sheet
Defined in
url
• url: string
= ""
path/url to the source image
memberof
Sheet
Defined in
Accessors
data
• get
data(): Jimp
image data object
memberof
Sheet
Returns
Jimp
Overrides
Rectangle.data
Defined in
• set
data(value
): void
image data object
memberof
Sheet
Parameters
Name | Type |
---|---|
value | Jimp |
Returns
void
Overrides
Rectangle.data
Defined in
hash
• get
hash(): string
hash string generated from image, for identifing
memberof
Sheet
Returns
string
Defined in
rot
• get
rot(): boolean
Status from packer whether Sheet
should be rotated.
note: if rot
set to true
, image data will be rotated automaticlly,
and width/height
is swaped.
memberof
Sheet
Returns
boolean
Overrides
Rectangle.rot
Defined in
• set
rot(value
): void
Status from packer whether Sheet
should be rotated.
note: if rot
set to true
, image data will be rotated automaticlly,
and width/height
is swaped.
memberof
Sheet
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Overrides
Rectangle.rot
Defined in
x
• get
x(): number
Returns
number
Overrides
Rectangle.x
Defined in
• set
x(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Overrides
Rectangle.x
Defined in
y
• get
y(): number
Returns
number
Overrides
Rectangle.y
Defined in
• set
y(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Overrides
Rectangle.y
Defined in
Methods
extrude
▸ extrude(border
): void
Extrude edge pixels. Should trimAlpha
first
memberof
Sheet
Parameters
Name | Type | Description |
---|---|---|
border | number | extrude pixels |
Returns
void
Defined in
parse
▸ parse(data
, target?
): Sheet
Load sheet settings from json object
memberof
Sheet
Parameters
Name | Type |
---|---|
data | object |
target | object |
Returns
Defined in
rotate
▸ rotate(clockwise?
): void
Rotate image data 90-degree CW, and swap width/height
note: rotate is done automaticly when Sheet.rot
set to true
, normally
you don't need to do this manually unless you know what you are doing.
memberof
Sheet
Parameters
Name | Type | Default value |
---|---|---|
clockwise | boolean | true |
Returns
void
Defined in
serialize
▸ serialize(): object
Return a serialized json object
memberof
Sheet
Returns
object
Defined in
trimAlpha
▸ trimAlpha(tolerance?
): void
Crop surrounding transparent pixels
memberof
Sheet
Parameters
Name | Type | Default value |
---|---|---|
tolerance | number | 0 |
Returns
void
Defined in
Factory
▸ Static
Factory(data
): Sheet
Parameters
Name | Type |
---|---|
data | any |