Skip to main content

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

NameTypeDefault value
widthnumber0
heightnumber0
xnumber0
ynumber0
rotbooleanfalse

Overrides

Rectangle.constructor

Defined in

geom/sheet.ts:104

Properties

anchor

anchor: Vec2

anchor/pivot point

memberof Sheet

Defined in

geom/sheet.ts:51


dummy

dummy: string[] = []

Dummy tag which represent a clone of other sheet

memberof Sheet

Defined in

geom/sheet.ts:83


frame

frame: Rectangle

frame rectangle to be rendered to final atlas

memberof Sheet

Defined in

geom/sheet.ts:33


last

last: boolean = false

for controlling mustache template trailing comma, don't touch

memberof Sheet

Defined in

geom/sheet.ts:91


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

geom/sheet.ts:17


nineSliceFrame

nineSliceFrame: Rectangle

9-sliced center rectangle

memberof Sheet

Defined in

geom/sheet.ts:59


sourceFrame

sourceFrame: Rectangle

orignal source rectangle

x and y refer to the negative offset from the frame rectangle

memberof Sheet

Defined in

geom/sheet.ts:43


tag

Optional tag: string

tag of group packing

memberof Sheet

Defined in

geom/sheet.ts:75


trimmed

trimmed: boolean = false

alpha trimmed

memberof Sheet

Defined in

geom/sheet.ts:67


url

url: string = ""

path/url to the source image

memberof Sheet

Defined in

geom/sheet.ts:25

Accessors

data

get data(): Jimp

image data object

memberof Sheet

Returns

Jimp

Overrides

Rectangle.data

Defined in

geom/sheet.ts:350

set data(value): void

image data object

memberof Sheet

Parameters

NameType
valueJimp

Returns

void

Overrides

Rectangle.data

Defined in

geom/sheet.ts:351


hash

get hash(): string

hash string generated from image, for identifing

memberof Sheet

Returns

string

Defined in

geom/sheet.ts:368


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

geom/sheet.ts:332

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

NameType
valueboolean

Returns

void

Overrides

Rectangle.rot

Defined in

geom/sheet.ts:335


x

get x(): number

Returns

number

Overrides

Rectangle.x

Defined in

geom/sheet.ts:311

set x(value): void

Parameters

NameType
valuenumber

Returns

void

Overrides

Rectangle.x

Defined in

geom/sheet.ts:307


y

get y(): number

Returns

number

Overrides

Rectangle.y

Defined in

geom/sheet.ts:317

set y(value): void

Parameters

NameType
valuenumber

Returns

void

Overrides

Rectangle.y

Defined in

geom/sheet.ts:313

Methods

extrude

extrude(border): void

Extrude edge pixels. Should trimAlpha first

memberof Sheet

Parameters

NameTypeDescription
bordernumberextrude pixels

Returns

void

Defined in

geom/sheet.ts:237


parse

parse(data, target?): Sheet

Load sheet settings from json object

memberof Sheet

Parameters

NameType
dataobject
targetobject

Returns

Sheet

Defined in

geom/sheet.ts:177


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

NameTypeDefault value
clockwisebooleantrue

Returns

void

Defined in

geom/sheet.ts:279


serialize

serialize(): object

Return a serialized json object

memberof Sheet

Returns

object

Defined in

geom/sheet.ts:130


trimAlpha

trimAlpha(tolerance?): void

Crop surrounding transparent pixels

memberof Sheet

Parameters

NameTypeDefault value
tolerancenumber0

Returns

void

Defined in

geom/sheet.ts:205


Factory

Static Factory(data): Sheet

Parameters

NameType
dataany

Returns

Sheet

Defined in

geom/sheet.ts:193