GuilloteneAllocator
class GuilloteneAllocator implements AreaAllocator
Summary
Methods from GuilloteneAllocator
| PIXI.Rectangle & AreaPtr |
Allocates an area of the given |
| void |
|
| AreaNode |
Finds an area node with minimum width |
| AreaNode |
The recursive implementation for AreaAllocator#findArea. |
| AreaField |
Returns the area data for the node. |
| AreaNode[] |
Returns the children of the passed node, if any. |
| PIXI.Rectangle |
Returns the rectangle covered by the area node. |
| AreaNode |
Returns the parent of the area node. |
| boolean |
Returns whether the given node has any children. |
| SPLIT_ORIENTATION |
Returns the orientation of the primary split of host. |
Public Methods
allocate(width: number, height: number, rect: PIXI.Rectangle) → {PIXI.Rectangle & AreaPtr}
Allocates an area of the given width and height.
| Name | Type | Attributes | Description |
|---|---|---|---|
| width | number |
The width required for the allocated area. |
|
| height | number |
The height required for the allocated area. |
|
| rect | PIXI.Rectangle |
<optional> |
An optional |
| Type | Description |
|---|---|
| PIXI.Rectangle & AreaPtr |
The rectangle frame of the area allocated. |
free(areaPtr: AreaPtr) → {void}
Frees the area represented by the given area pointer. The original rectangle returned by
GuilloteneAllocator#allocate included this pointer (the __mem_area property).
| Name | Type | Description |
|---|---|---|
| areaPtr | AreaPtr |
| Type | Description |
|---|---|
| void |
Protected Methods
protected findArea(aw: number, ah: number) → {AreaNode}
Finds an area node with minimum width aw and minimum height ah.
| Name | Type | Description |
|---|---|---|
| aw | number | |
| ah | number |
| Type | Description |
|---|---|
| AreaNode |
protected findAreaRecursive(rootArea: AreaNode, aw: number, ah: number) → {AreaNode}
The recursive implementation for AreaAllocator#findArea.
| Name | Type | Description |
|---|---|---|
| rootArea | AreaNode | |
| aw | number | |
| ah | number |
| Type | Description |
|---|---|
| AreaNode |
protected getAreaField(node: AreaNode) → {AreaField}
Returns the area data for the node.
| Name | Type | Description |
|---|---|---|
| node | AreaNode |
| Type | Description |
|---|---|
| AreaField |
The area data for the node. |
protected getChildren(node: AreaNode) → {AreaNode[]}
Returns the children of the passed node, if any.
| Name | Type | Description |
|---|---|---|
| node | AreaNode |
| Type | Description |
|---|---|
| AreaNode[] |
protected getFrame(node: AreaNode, rect: PIXI.Rectangle) → {PIXI.Rectangle}
Returns the rectangle covered by the area node.
| Name | Type | Attributes | Description |
|---|---|---|---|
| node | AreaNode |
The node whose covered rectangular area is needed. |
|
| rect | PIXI.Rectangle |
<optional> |
An optional |
| Type | Description |
|---|---|
| PIXI.Rectangle |
The rectangle covered by |
protected getParent(node: AreaNode) → {AreaNode}
Returns the parent of the area node.
| Name | Type | Description |
|---|---|---|
| node | AreaNode |
| Type | Description |
|---|---|
| AreaNode |
The parent of |
protected hasChildren(node: AreaNode) → {boolean}
Returns whether the given node has any children.
| Name | Type | Description |
|---|---|---|
| node | AreaNode |
| Type | Description |
|---|---|
| boolean |
Whether the given node has any children. |
protected splitOrientation(host: PIXI.Rectangle, hole: PIXI.Rectangle) → {SPLIT_ORIENTATION}
Returns the orientation of the primary split of host.
| Name | Type | Description |
|---|---|---|
| host | PIXI.Rectangle | |
| hole | PIXI.Rectangle |
| Type | Description |
|---|---|
| SPLIT_ORIENTATION |