Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Sprite_Enemy


Sprite_Enemy

The sprite for displaying an enemy.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

_accessibleActive

_accessibleActive: boolean
member

{boolean}

memberof

PIXI.DisplayObject#

todo

Needs docs.

_accessibleDiv

_accessibleDiv: boolean
member

{boolean}

memberof

PIXI.DisplayObject#

todo

Needs docs.

Protected _animationSprites

_animationSprites: Sprite_Animation[]

The animation sprites assigned to the sprite object.

memberof

Sprite_Base

_appeared

_appeared: boolean

_battler

_battler: Game_Battler

_battlerHue

_battlerHue: number

_battlerName

_battlerName: string

Protected _bounds

_bounds: Bounds

The bounds object, this is used to calculate and store the bounds of the displayObject.

member

{PIXI.Bounds} PIXI.DisplayObject#_bounds

Protected _cachedTint

_cachedTint: number

Cached tint value so we can tell when the tint is changed. Value is used for 2d CanvasRenderer.

member

{number} PIXI.Sprite#_cachedTint

default

0xFFFFFF

Protected _destroyed

_destroyed: boolean

If the object has been destroyed via destroy(). If true, it should not be used.

member

{boolean} PIXI.DisplayObject#_destroyed

_effectDuration

_effectDuration: number

Protected _effectTarget

_effectTarget: Sprite_Base

The target that will have the animations applied to it.

memberof

Sprite_Base

_effectType

_effectType: string

_enemy

_enemy: Game_Enemy

_hiding

_hiding: boolean

Determines sprite's visibility

_homeX

_homeX: number

_homeY

_homeY: number

Protected _lastSortedIndex

_lastSortedIndex: number

Which index in the children array the display component was before the previous zIndex sort. Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.

member

{number} PIXI.DisplayObject#_lastSortedIndex

Protected _mask

_mask: Graphics | Sprite | null

The original, cached mask of the object.

member

{PIXI.Graphics|PIXI.Sprite|null} PIXI.DisplayObject#_mask

_movementDuration

_movementDuration: number

_offsetX

_offsetX: number

_offsetY

_offsetY: number

_selectionEffectCount

_selectionEffectCount: number

_shake

_shake: number

_stateIconSprite

_stateIconSprite: Sprite_StateIcon

_targetOffsetX

_targetOffsetX: number

_targetOffsetY

_targetOffsetY: number

Protected _tempDisplayObjectParent

_tempDisplayObjectParent: DisplayObject
member

{PIXI.DisplayObject}

Protected _zIndex

_zIndex: number

The zIndex of the displayObject. A higher value will mean it will be rendered on top of other displayObjects within the same container.

member

{number} PIXI.DisplayObject#_zIndex

accessible

accessible: boolean

Flag for if the object is accessible. If true AccessibilityManager will overlay a shadow div with attributes set

member

{boolean}

memberof

PIXI.DisplayObject#

accessibleChildren

accessibleChildren: boolean

Setting to false will prevent any children inside this container to be accessible. Defaults to true.

member

{boolean}

memberof

PIXI.DisplayObject#

default

true

accessibleHint

accessibleHint: string

Sets the aria-label attribute of the shadow div

member

{string}

memberof

PIXI.DisplayObject#

accessiblePointerEvents

accessiblePointerEvents: string

Specify the pointer-events the accessible div will use Defaults to auto.

member

{string}

memberof

PIXI.DisplayObject#

default

'auto'

accessibleTitle

accessibleTitle: string

Sets the title attribute of the shadow div If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'

member

{?string}

memberof

PIXI.DisplayObject#

accessibleType

accessibleType: string

Specify the type of div the accessible layer is. Screen readers treat the element differently depending on this type. Defaults to button.

member

{string}

memberof

PIXI.DisplayObject#

default

'button'

alpha

alpha: number

The opacity of the object.

member

{number} PIXI.DisplayObject#alpha

anchor

The anchor sets the origin point of the text. The default value is taken from the Texture and passed to the constructor.

The default is (0,0), this means the text's origin is the top left.

Setting the anchor to (0.5,0.5) means the text's origin is centered.

Setting the anchor to (1,1) would mean the text's origin point will be the bottom right corner.

If you pass only single parameter, it will set both x and y to the same value as shown in the example below.

example

const sprite = new PIXI.Sprite(texture); sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).

member

{PIXI.ObservablePoint}

angle

angle: number

The angle of the object in degrees. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.

member

{number}

bitmap

bitmap: Bitmap

The image for the sprite.

property

bitmap

blendMode

blendMode: number

The blend mode to be applied to the sprite.

property

blendMode

buttonMode

buttonMode: boolean

If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive Setting this changes the 'cursor' property to 'pointer'.

example

const sprite = new PIXI.Sprite(texture); sprite.interactive = true; sprite.buttonMode = true;

member

{boolean}

memberof

PIXI.DisplayObject#

cacheAsBitmap

cacheAsBitmap: boolean

Set this to true if you want this display object to be cached as a bitmap. This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. To remove simply set this property to false

IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.

member

{boolean}

memberof

PIXI.DisplayObject#

Readonly children

children: DisplayObject[]

The array of children of this container.

member

{PIXI.DisplayObject[]} PIXI.Container#children

readonly

cursor

cursor: string

This defines what cursor mode is used when the mouse cursor is hovered over the displayObject.

example

const sprite = new PIXI.Sprite(texture); sprite.interactive = true; sprite.cursor = 'wait';

see

https://developer.mozilla.org/en/docs/Web/CSS/cursor

member

{string}

memberof

PIXI.DisplayObject#

filterArea

filterArea: Rectangle

The area the filter is applied to. This is used as more of an optimization rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.

Also works as an interaction mask.

member

{?PIXI.Rectangle} PIXI.DisplayObject#filterArea

filters

filters: Filter[]

Sets the filters for the sprite.

property

filters

height

height: number

The height of the sprite, setting this will actually modify the scale to achieve the value set

member

{number}

hitArea

hitArea: IHitArea

Interaction shape. Children will be hit first, then this shape will be checked. Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.

example

const sprite = new PIXI.Sprite(texture); sprite.interactive = true; sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);

member

{PIXI.IHitArea}

memberof

PIXI.DisplayObject#

interactive

interactive: boolean

Enable interaction events for the DisplayObject. Touch, pointer and mouse events will not be emitted unless interactive is set to true.

example

const sprite = new PIXI.Sprite(texture); sprite.interactive = true; sprite.on('tap', (event) => { //handle event });

member

{boolean}

memberof

PIXI.DisplayObject#

interactiveChildren

interactiveChildren: boolean

Determines if the children to the displayObject can be clicked/touched Setting this to false allows PixiJS to bypass a recursive hitTest function

member

{boolean}

memberof

PIXI.Container#

isMask

isMask: boolean

Does any other displayObject use this object as a mask?

member

{boolean} PIXI.DisplayObject#isMask

isSprite

isSprite: boolean

used to fast check if a sprite is.. a sprite!

member

{boolean} PIXI.Sprite#isSprite

Readonly localTransform

localTransform: Matrix

Current transform of the object based on local factors: position, scale, other stuff.

member

{PIXI.Matrix}

readonly

mask

Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. In PixiJS a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilities shape clipping. To remove a mask, set this property to null.

For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.

example

const graphics = new PIXI.Graphics(); graphics.beginFill(0xFF3300); graphics.drawRect(50, 250, 100, 100); graphics.endFill();

const sprite = new PIXI.Sprite(texture); sprite.mask = graphics;

todo

At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.

member

{PIXI.Container|PIXI.MaskData}

name

name: string

The instance name of the object.

memberof

PIXI.DisplayObject#

member

{string} name

opacity

opacity: number

The width of the sprite without the scale.

property

width

opaque

opaque: boolean

Readonly parent

parent: Container

The display object container that contains this display object.

member

{PIXI.Container} PIXI.DisplayObject#parent

readonly

pivot

pivot: IPoint

The pivot point of the displayObject that it rotates around. Assignment by value since pixi-v4.

member

{PIXI.IPoint}

pluginName

pluginName: string

Plugin that is responsible for rendering this element. Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods.

member

{string} PIXI.Sprite#pluginName

default

'batch'

point

point: Point

The origin point of the sprite. (0,0) to (1,1).

property

anchor

position

position: IPoint

The coordinate of the object relative to the local coordinates of the parent. Assignment by value since pixi-v4.

member

{PIXI.IPoint}

renderable

renderable: boolean

Can this object be rendered, if false the object will not be drawn but the updateTransform methods will still be called.

Only affects recursive calls from parent. You can ask for bounds manually.

member

{boolean} PIXI.DisplayObject#renderable

rotation

rotation: number

The rotation of the sprite in radians.

property

rotation

roundPixels

roundPixels: boolean

If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. Advantages can include sharper image quality (like text) and faster rendering on canvas. The main disadvantage is movement of objects may appear less smooth. To set the global default, change PIXI.settings.ROUND_PIXELS

member

{boolean}

default

false

scale

scale: Point

The scale factor of the sprite.

property

scale

shader

shader: Filter | Shader

The shader that will be used to render the sprite. Set to null to remove a current shader.

member

{PIXI.Filter|PIXI.Shader} PIXI.Sprite#shader

skew

The skew factor for the object in radians. Assignment by value since pixi-v4.

member

{PIXI.ObservablePoint}

sortDirty

sortDirty: boolean

Should children be sorted by zIndex at the next updateTransform call. Will get automatically set to true if a new child is added, or if a child's zIndex changes.

member

{boolean} PIXI.Container#sortDirty

sortableChildren

sortableChildren: boolean

If set to true, the container will sort its children by zIndex value when updateTransform() is called, or manually if sortChildren() is called.

This actually changes the order of elements in the array, so should be treated as a basic solution that is not performant compared to other solutions, such as @link https://github.com/pixijs/pixi-display

Also be aware of that this may not work nicely with the addChildAt() function, as the zIndex sorting may cause the child to automatically sorted to another position.

see

PIXI.settings.SORTABLE_CHILDREN

member

{boolean} PIXI.Container#sortableChildren

spriteId

spriteId: number

[read-only] The array of children of the sprite.

property

children

texture

texture: Texture

The texture that the sprite is using

member

{PIXI.Texture}

tint

tint: number

The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

member

{number}

default

0xFFFFFF

transform

transform: Transform

World transform and local transform of this object. This will become read-only later, please do not assign anything there unless you know what are you doing.

member

{PIXI.Transform} PIXI.DisplayObject#transform

visible

visible: boolean

The visibility of the sprite.

property

visible

voidFilter

voidFilter: Filter

width

width: number

The width of the sprite, setting this will actually modify the scale to achieve the value set

member

{number}

Readonly worldAlpha

worldAlpha: number

The multiplied alpha of the displayObject.

member

{number} PIXI.DisplayObject#worldAlpha

readonly

Readonly worldTransform

worldTransform: Matrix

Current transform of the object based on world (parent) factors.

member

{PIXI.Matrix}

readonly

Readonly worldVisible

worldVisible: boolean

Indicates if the object is globally visible.

member

{boolean}

readonly

x

x: number

The x coordinate of the sprite.

property

x

y

y: number

The y coordinate of the sprite.

property

y

zIndex

zIndex: number

The zIndex of the displayObject. If a container has the sortableChildren property set to true, children will be automatically sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, and thus rendered on top of other displayObjects within the same container.

member

{number}

Static _counter

_counter: number

Number of the created objects.

static
property

_counter

Methods

Protected _calculateBounds

  • _calculateBounds(): void

_recursivePostUpdateTransform

  • _recursivePostUpdateTransform(): void

Protected _render

addChild

addChildAt

calculateBounds

  • calculateBounds(): void

calculateTrimmedVertices

  • calculateTrimmedVertices(): void

calculateVertices

  • calculateVertices(): void

containsPoint

  • containsPoint(point: Point): boolean

createStateIconSprite

  • createStateIconSprite(): void

damageOffsetX

  • damageOffsetX(): number

damageOffsetY

  • damageOffsetY(): number

destroy

  • destroy(options?: { baseTexture?: boolean; children?: boolean; texture?: boolean }): void
  • Destroys this sprite and optionally its texture and children

    Parameters

    • Optional options: { baseTexture?: boolean; children?: boolean; texture?: boolean }
      • Optional baseTexture?: boolean
      • Optional children?: boolean
      • Optional texture?: boolean

    Returns void

displayObjectUpdateTransform

  • displayObjectUpdateTransform(): void

getBlendColor

  • getBlendColor(): number[]

getBounds

getChildAt

getChildByName

getChildIndex

getColorTone

  • getColorTone(): number[]

getGlobalPosition

  • getGlobalPosition(point?: Point, skipUpdate?: boolean): Point

getLocalBounds

hide

  • hide(): void

initMembers

  • initMembers(): void

initVisibility

  • initVisibility(): void

initialize

isAnimationPlaying

  • isAnimationPlaying(): boolean

isEffecting

  • isEffecting(): boolean

loadBitmap

  • loadBitmap(name: string, hue: number): void

move

  • move(x: number, y: number): void

Protected onChildrenChange

  • onChildrenChange(): void

removeChild

removeChildAt

removeChildren

  • removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]

render

Protected renderAdvanced

  • renderAdvanced(renderer: Renderer): void

revertToNormal

  • revertToNormal(): void

setBattler

setBlendColor

  • setBlendColor(color: number[]): void

setChildIndex

setColorTone

  • setColorTone(tone: number[]): void

setFrame

  • setFrame(x: number, y: number, width: number, height: number): void
  • Sets the rectagle of the bitmap that the sprite displays.

    method

    setFrame

    Parameters

    • x: number

      The x coordinate of the frame

    • y: number

      The y coordinate of the frame

    • width: number

      The width of the frame

    • height: number

      The height of the frame

    Returns void

setHome

  • setHome(x: number, y: number): void

setParent

setTransform

  • setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): DisplayObject

setupEffect

  • setupEffect(): void

show

  • show(): void

sortChildren

  • sortChildren(): void

startAnimation

  • startAnimation(animation: Animation, mirror: boolean, delay: number): void

startAppear

  • startAppear(): void

startBlink

  • startBlink(): void

startBossCollapse

  • startBossCollapse(): void

startCollapse

  • startCollapse(): void

startDisappear

  • startDisappear(): void

startEffect

  • startEffect(effectType: string): void

startInstantCollapse

  • startInstantCollapse(): void

startWhiten

  • startWhiten(): void

swapChildren

toGlobal

toLocal

update

  • update(): void

updateAnimation

  • updateAnimation(): void

updateAnimationSprites

  • updateAnimationSprites(): void

updateAppear

  • updateAppear(): void

updateBitmap

  • updateBitmap(): void

updateBlink

  • updateBlink(): void

updateBossCollapse

  • updateBossCollapse(): void

updateCollapse

  • updateCollapse(): void

updateDisappear

  • updateDisappear(): void

updateEffect

  • updateEffect(): void

updateInstantCollapse

  • updateInstantCollapse(): void

updateMain

  • updateMain(): void

updateMove

  • updateMove(): void

updatePosition

  • updatePosition(): void

updateStateSprite

  • updateStateSprite(): void

Private updateTransform

  • updateTransform(): void

updateVisibility

  • updateVisibility(): void

updateWhiten

  • updateWhiten(): void

Static from

Static mixin

  • mixin(source: any): void

Generated using TypeDoc