Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WatchAdState

Hierarchy

Index

Constructors

constructor

Methods

attemptPerkPurchase

  • attemptPerkPurchase(perkId: any): Promise<Object>

cancelAllAsyncOperations

  • cancelAllAsyncOperations(): void

clearClickDetectorsExceptHeader

  • clearClickDetectorsExceptHeader(): void

getDivElement

  • getDivElement(): HTMLElement
  • Returns the html element of the state

    Returns HTMLElement

getHasFadeIn

  • getHasFadeIn(): boolean
  • Should return whether to fade in the game state. This will then apply the right css classes for the fadein.

    Returns boolean

getHasFadeOut

  • getHasFadeOut(): boolean
  • Should return whether to fade out the game state. This will then apply the right css classes for the fadeout and wait the delay before moving states

    Returns boolean

getHasUnloadConfirmation

  • getHasUnloadConfirmation(): boolean
  • Returns if the state has an unload confirmation, this is the "Are you sure you want to leave the page" message.

    Returns boolean

getInOutFadeTime

  • getInOutFadeTime(): 0 | 200
  • Should return how many mulliseconds to fade in / out the state. Not recommended to override!

    Returns 0 | 200

    Time in milliseconds to fade out

getInnerHTML

  • getInnerHTML(): string
  • Should return the states inner html. If not overriden, will create a scrollable container with the content of getMainContentHTML()

    Returns string

getKey

  • getKey(): any
  • Returns the states key

    Returns any

getMainContentHTML

  • getMainContentHTML(): string

getPauseOnFocusLost

  • getPauseOnFocusLost(): boolean
  • Returns if this state should get paused if it does not have focus

    Returns boolean

    true to pause the updating of the game

getShowDiamonds

  • getShowDiamonds(): boolean
  • Should return whether to show the diamonds in the top right along with the ability to buy them.

    Returns boolean

    true to show it

getStateHeaderTitle

  • getStateHeaderTitle(): any
  • Should return the title of the game state. If null, no title and back button will get created

    Returns any

getThemeMusic

  • getThemeMusic(): any

internalCleanUpClickDetectors

  • internalCleanUpClickDetectors(): void

internalEnterCallback

  • internalEnterCallback(payload: any): void

internalGetFadeInOutTime

  • internalGetFadeInOutTime(): number
  • Internal method to compute the time to fade in / out

    Returns number

    time to fade in / out in ms

internalGetFullHtml

  • internalGetFullHtml(): string

internalLeaveCallback

  • internalLeaveCallback(): void

internalOnAppPauseCallback

  • internalOnAppPauseCallback(): void

internalOnAppResumeCallback

  • internalOnAppResumeCallback(): void

internalOnBeforeExitCallback

  • internalOnBeforeExitCallback(): void

internalRegisterCallback

  • internalRegisterCallback(stateManager: any, app: any): void
  • Internal callback from the manager. Do not override!

    Parameters

    • stateManager: any
    • app: any

    Returns void

internalStartPerkUnlock

  • internalStartPerkUnlock(perkHandle: any, resolve: any, reject: any): void
  • Internal method to request unlocking a perk

    Parameters

    • perkHandle: any
    • resolve: any
    • reject: any

    Returns void

moveToState

  • moveToState(stateKey: any, payload?: object, skipFadeOut?: boolean): void
  • Transfers to a new state

    Parameters

    • stateKey: any

      The id of the new state

    • Default value payload: object = {}
    • Default value skipFadeOut: boolean = false

    Returns void

mpHandleConnectionClose

  • mpHandleConnectionClose(): void

mpHandlePacket

  • mpHandlePacket(packet: any): boolean
  • Should handle a multiplayer packet and return true if the packet was handled and processed

    Parameters

    • packet: any

    Returns boolean

onAppPause

  • onAppPause(): void
  • Callback when the app got paused (on android, this means in background)

    Returns void

onAppResume

  • onAppResume(): void
  • Callback when the app got resumed (on android, this means in foreground again)

    Returns void

onBackButton

  • onBackButton(): void

onBackgroundTick

  • onBackgroundTick(dt: any): void
  • Background tick callback, called while the game is inactiev

    Parameters

    • dt: any

      Delta time in ms since last tick

    Returns void

onBeforeExit

  • onBeforeExit(): void
  • Callback before leaving the game state or when the page is unloaded

    Returns void

onEnter

  • onEnter(payload: any): void
  • Parameters

    • payload: any

    Returns void

onLeave

  • onLeave(): void
  • Callback when leaving the state

    Returns void

onRender

  • onRender(dt: any): void
  • Render callback

    Parameters

    • dt: any

      Delta time in ms since last render

    Returns void

onResized

  • onResized(w: any, h: any): void
  • Called when the screen resized

    Parameters

    • w: any

      window/screen width

    • h: any

      window/screen height

    Returns void

showBottomNotification

  • showBottomNotification(text: any): void

showError

  • showError(title: any, desc: any): void
  • Hides the states content and shows an error instead

    Parameters

    • title: any
    • desc: any

    Returns void

showLanguageChooser

  • showLanguageChooser(dialogs: any, buttonSelector?: string): void
  • Shows a language chooser dialog

    Parameters

    • dialogs: any
    • Default value buttonSelector: string = "button.languageChoose"

    Returns void

showRestartRequiredDialog

  • showRestartRequiredDialog(): void

trackClicks

  • trackClicks(element: any, handler: any, args?: object): void
  • Tracks clicks on a given element and calls the given callback on this state. If you want to call another function wrap it inside a lambda.

    Parameters

    • element: any

      The element to track clicks on

    • handler: any

      The handler to call

    • Default value args: object = {}

      Click detector arguments

    Returns void