Class: ResizeManager

ResizeManager

new GOWN.interaction.ResizeManager(renderer, options)

The resize manager deals with changes in the Application size e.g. if the browser window has been resized because the keyboard is shown or the device has been rotated on mobile or the user resized it on the desktop with his mouse.
Name Type Description
renderer PIXI.CanvasRenderer | PIXI.WebGLRenderer A reference to the current renderer
options object optional
Name Type Default Description
autoPreventDefault boolean true optional Should the manager automatically prevent default browser actions.
fullscreen boolean false optional Should we use the whole browser width/height (window.innerHeight/Width).

Extends

  • EventEmitter

Members

static,readonlyGOWN.interaction.ResizeManager.RESIZE_DONE_TIMEOUTString

The waiting time after the resize event before updating (prevent the canvas from flickering when resizing)

autoPreventDefaultbool

Should default browser actions automatically be prevented.
Default Value:
  • true

element

TODO

eventDataObject

An event data object to handle all the event tracking/dispatching

fullscreenbool

Should we use the whole browser width/height (window.innerHeight/Width)
Default Value:
  • false

rendererPIXI.SystemRenderer

The renderer this interaction manager works for.

resizeTimeoutNumber

Time to wait after every resize event to prevent flickering
Default Value:
  • 0

useResizeDoneTimeoutbool

Should the resize manager wait after every resize event
Default Value:
  • true

Methods

Remove events and listener etc.

processInteractive(displayObject, func)

Traverse through the scene graph to call given function on all displayObjects that are resizable
Name Type Description
displayObject PIXI.Container | PIXI.Sprite | PIXI.extras.TilingSprite the displayObject that will be resized (recursivly crawls its children)
func function optional the function that will be called on each resizable object. The displayObject will be passed to the function