Options
All
  • Public
  • Public/Protected
  • All
Menu

PIXI-Extended - v0.4.0

Index

Type aliases

ButtonEvent

ButtonEvent: "down" | "up" | "dblclick"

The events that can occurs on any Button.

ColorEvents

ColorEvents: { alphaChange: [value: number]; blueChange: [value: number]; change: [red: number, green: number, blue: number, alpha: number]; greenChange: [value: number]; redChange: [value: number] }

Type declaration

  • alphaChange: [value: number]
  • blueChange: [value: number]
  • change: [red: number, green: number, blue: number, alpha: number]
  • greenChange: [value: number]
  • redChange: [value: number]

ContainerEvents

ContainerEvents: SpriteEvents & { childAdded: [child: DisplayObject, container: Container, index: number] }

EventList

EventList: Record<string, any[]>

FPSCounterEvents

FPSCounterEvents: ContainerEvents & { ready: [] }

RGB

RGB: [red: number, green: number, blue: number]

A type containing RGB (red, green, blue) values as a Tuple.

RGBA

RGBA: [red: number, green: number, blue: number, alpha: number]

A type containing RGBA (red, green, blue, alpha) values as a Tuple.

SpriteEvents

SpriteEvents: { added: [container: Container]; click: [event: InteractionEvent]; mousedown: [event: InteractionEvent]; mousemove: [event: InteractionEvent]; mouseout: [event: InteractionEvent]; mouseover: [event: InteractionEvent]; mouseup: [event: InteractionEvent]; mouseupoutside: [event: InteractionEvent]; pointercancel: [event: InteractionEvent]; pointerdown: [event: InteractionEvent]; pointermove: [event: InteractionEvent]; pointerout: [event: InteractionEvent]; pointerover: [event: InteractionEvent]; pointertap: [event: InteractionEvent]; pointerup: [event: InteractionEvent]; pointerupoutside: [event: InteractionEvent]; removed: [container: Container]; removedFrom: [child: DisplayObject, container: Container, index: number]; rightclick: [event: InteractionEvent]; rightdown: [event: InteractionEvent]; rightup: [event: InteractionEvent]; rightupoutside: [event: InteractionEvent]; tap: [event: InteractionEvent]; touchcancel: [event: InteractionEvent]; touchend: [event: InteractionEvent]; touchendoutside: [event: InteractionEvent]; touchmove: [event: InteractionEvent]; touchstart: [event: InteractionEvent] }

Type declaration

TextColor

TextColor: Color | Color[]

TextureNameAndPath

TextureNameAndPath: [name: string, path: string]

A tuple containing the texture name and its path.

TextureOrName

TextureOrName: string | Texture

A texture or its name.

TexturesAndName

TexturesAndName: Record<string, Texture>

A record containing textures names as keys, and themselves as values.

TexturesNameAndPath

TexturesNameAndPath: Record<string, string>

A record containing texture names as keys, and their paths as values.

XY

XY: [x: number, y: number]

Variables

Const LeftClick

LeftClick: Button = ...

The LeftClick button handler, usually used.

Const RightClick

RightClick: Button = ...

The RightClick button handler, usually used.

Const buttons

buttons: Set<Button> = ...

The set of buttons created.

Const events

events: EventEmitter<KeyboardEvents> = ...

The EventEmitter to watch the KeyBoard.

Const loadedTexturesNames

loadedTexturesNames: string[] = []

The list of textures loaded via the loadTextures and loadTexture functions.

Const mousePosition

mousePosition: Vector2 = ...

The actual position of the mouse.

remarks

You have to use updateMousePosition every time you want to update this value.

Const pressed

pressed: Set<string> = ...

The Set of keys that are actually pressed.

Functions

bytesToUuid

  • bytesToUuid(bytes: number[] | Uint8Array): string

clamp

  • clamp(value: number, min: number, max: number): number
  • Returns a number whose value is limited to the given range.

    Parameters

    • value: number

      The value to clamp.

    • min: number

      The lower boundary of the output range.

    • max: number

      The upper boundary of the output range.

    Returns number

    • A number in the range [min, max].

collisionBoxes

  • A function to test a collision and get information if colliding.

    remarks

    Expensive function, if you just want to test collision, prefer using intersect function.

    Parameters

    Returns Hit | null

    • The Hit result or null it not intersecting.

getColoredTexture

getTexture

  • getTexture(name: string): Texture | null

getTextureOrThrow

  • getTextureOrThrow(name: string): Texture

intersect

isOdd

  • isOdd(value: number): boolean
  • Returns true if the number is odd.

    remarks

    Use this function with negation to know if a number is even.

    Parameters

    • value: number

      The number to test.

    Returns boolean

    • Is the number odd.

isPressed

  • isPressed(key: Key | Key[]): boolean

loadTexture

loadTextures

map

  • map(value: number, min1: number, max1: number, min2: number, max2: number): number
  • Map a number from one range to another.

    Parameters

    • value: number

      The value to map.

    • min1: number

      First range minimum.

    • max1: number

      First range maximum.

    • min2: number

      Second range minimum.

    • max2: number

      Second range maximum.

    Returns number

    • The number mapped.

random

  • random(max: number, toInt?: boolean): number
  • random(min: number, max: number, toInt?: boolean): number
  • random<T>(array: T[]): T

randomArray

  • randomArray<T>(array: T[]): T

randomFloat

  • randomFloat(max: number): number
  • randomFloat(min: number, max: number): number

randomInt

  • randomInt(max: number): number
  • randomInt(min: number, max: number): number

updateMousePosition

uuidV4

  • uuidV4(): string

Generated using TypeDoc