1681-engine / index / Rectangle
Class: Rectangle ​
Defined in: src/core/Rectangle.ts:5
A filled rectangle placed by its origin (centred by default).
Extends ​
Container<ContainerChild,this> &GameObjectMembers<this>
Constructors ​
Constructor ​
new Rectangle(
w,
h,
color,
fillAlpha?
): Rectangle;Defined in: src/core/Rectangle.ts:10
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
w | number | undefined |
h | number | undefined |
color | number | undefined |
fillAlpha | number | 1 |
Returns ​
Rectangle
Overrides ​
GameObject(Container).constructorProperties ​
active ​
readonly active: boolean;Defined in: src/core/gameObject.ts:42
False once destroyed.
Inherited from ​
GameObject(Container).activedepth ​
depth: number;Defined in: src/core/gameObject.ts:44
The draw order in the world layer (zIndex): bigger is in front.
Inherited from ​
GameObject(Container).depthflipX ​
flipX: boolean;Defined in: src/core/gameObject.ts:48
Inherited from ​
GameObject(Container).flipXflipY ​
flipY: boolean;Defined in: src/core/gameObject.ts:49
Inherited from ​
GameObject(Container).flipYscaleX ​
scaleX: number;Defined in: src/core/gameObject.ts:46
Scale without the flip: stays positive on a mirrored sprite.
Inherited from ​
GameObject(Container).scaleXscaleY ​
scaleY: number;Defined in: src/core/gameObject.ts:47
Inherited from ​
GameObject(Container).scaleYscene ​
scene: Stage;Defined in: src/core/gameObject.ts:40
Inherited from ​
GameObject(Container).sceneAccessors ​
fillColor ​
Get Signature ​
get fillColor(): number;Defined in: src/core/Rectangle.ts:37
Returns ​
number
fillOpacity ​
Get Signature ​
get fillOpacity(): number;Defined in: src/core/Rectangle.ts:41
Returns ​
number
originX ​
Get Signature ​
get originX(): number;Defined in: src/core/Rectangle.ts:21
Returns ​
number
originY ​
Get Signature ​
get originY(): number;Defined in: src/core/Rectangle.ts:25
Returns ​
number
rectHeight ​
Get Signature ​
get rectHeight(): number;Defined in: src/core/Rectangle.ts:33
Returns ​
number
rectWidth ​
Get Signature ​
get rectWidth(): number;Defined in: src/core/Rectangle.ts:29
Returns ​
number
Methods ​
clearTint() ​
clearTint(): this;Defined in: src/core/gameObject.ts:64
Returns ​
this
Inherited from ​
GameObject(Container).clearTintdestroy() ​
Call Signature ​
destroy(options?): void;Defined in: node_modules/pixi.js/lib/scene/container/Container.d.ts:1343
Removes all internal references and listeners as well as removes children from the display list. Do not use a Container after calling destroy.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
options? | DestroyOptions | Options parameter. A boolean will act as if all options have been set to that value |
Returns ​
void
Example ​
container.destroy();
container.destroy(true);
container.destroy({ children: true });
container.destroy({ children: true, texture: true, textureSource: true });Inherited from ​
GameObject(Container).destroyCall Signature ​
destroy(): void;Defined in: src/core/gameObject.ts:67
Returns ​
void
Inherited from ​
GameObject(Container).destroyresize() ​
resize(w, h): this;Defined in: src/core/Rectangle.ts:61
Parameters ​
| Parameter | Type |
|---|---|
w | number |
h | number |
Returns ​
this
setAlpha() ​
setAlpha(a?): this;Defined in: src/core/gameObject.ts:55
Parameters ​
| Parameter | Type |
|---|---|
a? | number |
Returns ​
this
Inherited from ​
GameObject(Container).setAlphasetAngle() ​
setAngle(a?): this;Defined in: src/core/gameObject.ts:59
Parameters ​
| Parameter | Type |
|---|---|
a? | number |
Returns ​
this
Inherited from ​
GameObject(Container).setAnglesetBlendMode() ​
setBlendMode(mode): this;Defined in: src/core/gameObject.ts:60
Parameters ​
| Parameter | Type |
|---|---|
mode | BLEND_MODES |
Returns ​
this
Inherited from ​
GameObject(Container).setBlendModesetDepth() ​
setDepth(d): this;Defined in: src/core/gameObject.ts:54
Parameters ​
| Parameter | Type |
|---|---|
d | number |
Returns ​
this
Inherited from ​
GameObject(Container).setDepthsetDisplaySize() ​
setDisplaySize(w, h): this;Defined in: src/core/Rectangle.ts:57
Parameters ​
| Parameter | Type |
|---|---|
w | number |
h | number |
Returns ​
this
setFillStyle() ​
setFillStyle(color, alpha?): this;Defined in: src/core/Rectangle.ts:51
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
color | number | undefined |
alpha | number | 1 |
Returns ​
this
setFlip() ​
setFlip(x, y): this;Defined in: src/core/gameObject.ts:53
Parameters ​
| Parameter | Type |
|---|---|
x | boolean |
y | boolean |
Returns ​
this
Inherited from ​
GameObject(Container).setFlipsetFlipX() ​
setFlipX(v): this;Defined in: src/core/gameObject.ts:51
Parameters ​
| Parameter | Type |
|---|---|
v | boolean |
Returns ​
this
Inherited from ​
GameObject(Container).setFlipXsetFlipY() ​
setFlipY(v): this;Defined in: src/core/gameObject.ts:52
Parameters ​
| Parameter | Type |
|---|---|
v | boolean |
Returns ​
this
Inherited from ​
GameObject(Container).setFlipYsetOrigin() ​
setOrigin(x?, y?): this;Defined in: src/core/Rectangle.ts:45
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
x | number | 0.5 |
y | number | x |
Returns ​
this
setPosition() ​
setPosition(x?, y?): this;Defined in: src/core/gameObject.ts:57
Parameters ​
| Parameter | Type |
|---|---|
x? | number |
y? | number |
Returns ​
this
Inherited from ​
GameObject(Container).setPositionsetRotation() ​
setRotation(r?): this;Defined in: src/core/gameObject.ts:58
Parameters ​
| Parameter | Type |
|---|---|
r? | number |
Returns ​
this
Inherited from ​
GameObject(Container).setRotationsetScale() ​
setScale(x, y?): this;Defined in: src/core/gameObject.ts:50
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y? | number |
Returns ​
this
Inherited from ​
GameObject(Container).setScalesetScrollFactor() ​
setScrollFactor(f): this;Defined in: src/core/gameObject.ts:66
0 pins the object to the screen instead of the world.
Parameters ​
| Parameter | Type |
|---|---|
f | number |
Returns ​
this
Inherited from ​
GameObject(Container).setScrollFactorsetTint() ​
setTint(color?): this;Defined in: src/core/gameObject.ts:61
Parameters ​
| Parameter | Type |
|---|---|
color? | number |
Returns ​
this
Inherited from ​
GameObject(Container).setTintsetTintFill() ​
setTintFill(color): this;Defined in: src/core/gameObject.ts:63
Paints every opaque pixel in one solid colour (hit flash, silhouettes).
Parameters ​
| Parameter | Type |
|---|---|
color | number |
Returns ​
this
Inherited from ​
GameObject(Container).setTintFillsetVisible() ​
setVisible(v): this;Defined in: src/core/gameObject.ts:56
Parameters ​
| Parameter | Type |
|---|---|
v | boolean |
Returns ​
this
Inherited from ​
GameObject(Container).setVisible