ScaleManager#refresh()

refresh()

The "refresh" methods informs the ScaleManager that a layout refresh is required.

The ScaleManager automatically queues a layout refresh (eg. updates the Game size or Display canvas layout)
when the browser is resized, the orientation changes, or when there is a detected change
of the Parent size. Refreshing is also done automatically when public properties,
such as scaleMode, are updated or state-changing methods are invoked.

The "refresh" method may need to be used in a few (rare) situtations when

  • a device change event is not correctly detected; or
  • the Parent size changes (and an immediate reflow is desired); or
  • the ScaleManager state is updated by non-standard means; or
  • certain compatibility properties are manually changed.

The queued layout refresh is not immediate but will run promptly in an upcoming preRender.

Source code: core/ScaleManager.js (Line 1301)
doc_phaser
2017-02-14 11:09:13
Comments
Leave a Comment

Please login to continue.