Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SpriteBase

Index

Constructors

constructor

  • new SpriteBase(key_name: any, actions: any): SpriteBase

Properties

Private actions

actions: {}

Type declaration

  • [action: string]: { animations?: string[]; frame_counts?: any; frame_names?: {}; frame_rate?: {}; loop?: boolean | boolean[]; spritesheet?: { image: string; json: string } }
    • Optional animations?: string[]
    • Optional frame_counts?: any
    • Optional frame_names?: {}
      • [animation: string]: string[]
    • Optional frame_rate?: {}
      • [animation: string]: any
    • Optional loop?: boolean | boolean[]
    • Optional spritesheet?: { image: string; json: string }
      • image: string
      • json: string

key_name

key_name: string

Methods

generateAllFrames

  • generateAllFrames(): void

Private generateFrameNames

  • generateFrameNames(action: any, animation: any, start: any, stop: any, suffix: any, zeroPad: any): void
  • Parameters

    • action: any
    • animation: any
    • start: any
    • stop: any
    • suffix: any
    • zeroPad: any

    Returns void

getAnimationKey

  • getAnimationKey(action: any, animation: any): string

getFrameName

  • getFrameName(action: any, animation: any, index: any): string
  • Parameters

    • action: any
    • animation: any
    • index: any

    Returns string

getFrameRate

  • getFrameRate(action: any, animation: any): any

getSpriteAction

  • getSpriteAction(sprite: any): any

getSpriteKey

  • getSpriteKey(action: any): string

hasAction

  • hasAction(action: string): boolean

hasAnimation

  • hasAnimation(action: string, animation: string): boolean
  • Parameters

    • action: string
    • animation: string

    Returns boolean

loadSpritesheets

  • loadSpritesheets(game: Game, force_load: boolean, on_load_complete?: () => void): void
  • Parameters

    • game: Game
    • force_load: boolean
    • Optional on_load_complete: () => void
        • (): void
        • Returns void

    Returns void

setActionAlias

  • setActionAlias(game: Game, alias: any, reference_action: any): void
  • Parameters

    • game: Game
    • alias: any
    • reference_action: any

    Returns void

setActionAnimations

  • setActionAnimations(action: any, animations: any, frame_counts: any): void
  • Parameters

    • action: any
    • animations: any
    • frame_counts: any

    Returns void

setActionFrameRate

  • setActionFrameRate(action: any, frame_rate: any): void
  • Parameters

    • action: any
    • frame_rate: any

    Returns void

setActionLoop

  • setActionLoop(action: any, loop: any): void

setActionSpritesheet

  • setActionSpritesheet(action: any, spritesheet_image_url: any, spritesheet_json_url: any): void
  • Parameters

    • action: any
    • spritesheet_image_url: any
    • spritesheet_json_url: any

    Returns void

setAnimation

  • setAnimation(sprite: Sprite, action: any): void

Generated using TypeDoc