mirror of
https://github.com/photonstorm/phaser
synced 2024-12-22 19:13:37 +00:00
1 line
No EOL
20 KiB
JSON
1 line
No EOL
20 KiB
JSON
{"class":{"name":"Phaser.ScaleManager","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"A reference to the currently running game.","optional":false,"default":null},{"name":"width","type":["number","string"],"help":"The width of the game.","optional":false,"default":null},{"name":"height","type":["number","string"],"help":"The height of the game.","optional":false,"default":null}],"help":"The ScaleManager object is responsible for helping you manage the scaling, resizing and alignment of your game within the browser."},"consts":[{"name":"EXACT_FIT","type":"number","help":"","line":289},{"name":"NO_SCALE","type":"number","help":"","line":295},{"name":"RESIZE","type":"number","help":"","line":307},{"name":"SHOW_ALL","type":"number","help":"","line":301}],"methods":{"public":[{"name":"boot","static":false,"returns":null,"help":"Calculates and sets the game dimensions based on the given width and height.","line":421,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"checkOrientation","static":false,"returns":null,"help":"window.orientationchange event handler.","line":636,"public":true,"protected":false,"private":false,"parameters":[{"name":"event","type":["Event"],"help":"The orientationchange event data.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"checkOrientationState","static":false,"returns":null,"help":"Checks if the browser is in the correct orientation for your game (if forceLandscape or forcePortrait have been set)","line":597,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"checkResize","static":false,"returns":null,"help":"window.resize event handler.","line":664,"public":true,"protected":false,"private":false,"parameters":[{"name":"event","type":["Event"],"help":"The resize event data.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Destroys the ScaleManager and removes any event listeners.","line":1084,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"forceOrientation","static":false,"returns":null,"help":"If you need your game to run in only one orientation you can force that to happen.","line":583,"public":true,"protected":false,"private":false,"parameters":[{"name":"forceLandscape","type":["boolean"],"help":"true if the game should run in landscape mode only.","optional":false,"default":null},{"name":"forcePortrait","type":["boolean"],"help":"true if the game should run in portrait mode only.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"parseConfig","static":false,"returns":null,"help":"Parses the Game configuration object.","line":317,"public":true,"protected":false,"private":false,"parameters":[{"name":"config","type":["object"],"help":"The game configuration object.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"refresh","static":false,"returns":null,"help":"Re-calculate scale mode and update screen size. This only applies if ScaleMode is not set to RESIZE.","line":732,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"setExactFit","static":false,"returns":null,"help":"Sets the width and height values of the canvas, no larger than the maxWidth\/Height.","line":956,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"setMaximum","static":false,"returns":null,"help":"Sets this.width equal to window.innerWidth and this.height equal to window.innerHeight.","line":930,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"setMinMax","static":false,"returns":null,"help":"Set the ScaleManager min and max dimensions in one single callback.","line":483,"public":true,"protected":false,"private":false,"parameters":[{"name":"minWidth","type":["number"],"help":"The minimum width the game is allowed to scale down to.","optional":false,"default":null},{"name":"minHeight","type":["number"],"help":"The minimum height the game is allowed to scale down to.","optional":false,"default":null},{"name":"maxWidth","type":["number"],"help":"The maximum width the game is allowed to scale up to.","optional":false,"default":null},{"name":"maxHeight","type":["number"],"help":"The maximum height the game is allowed to scale up to.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setResizeCallback","static":false,"returns":null,"help":"Sets the callback that will be called when the window resize event occurs, or if set the parent container changes dimensions.\\nUse this to handle responsive game layout options.\\nNote that the callback will only be called if the ScaleManager.scaleMode is set to RESIZE.","line":467,"public":true,"protected":false,"private":false,"parameters":[{"name":"callback","type":["function"],"help":"The callback that will be called each time a window.resize event happens or if set, the parent container resizes.","optional":false,"default":null},{"name":"context","type":["object"],"help":"The context in which the callback will be called.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setShowAll","static":false,"returns":null,"help":"Calculates the multiplier needed to scale the game proportionally.","line":942,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"setSize","static":false,"returns":null,"help":"Sets the canvas style width and height values based on minWidth\/Height and maxWidth\/Height.","line":843,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"setupScale","static":false,"returns":null,"help":"Calculates and sets the game dimensions based on the given width and height.","line":343,"public":true,"protected":false,"private":false,"parameters":[{"name":"width","type":["number","string"],"help":"The width of the game.","optional":false,"default":null},{"name":"height","type":["number","string"],"help":"The height of the game.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"startFullScreen","static":false,"returns":null,"help":"Tries to enter the browser into full screen mode.\\nPlease note that this needs to be supported by the web browser and isn't the same thing as setting your game to fill the browser.","line":988,"public":true,"protected":false,"private":false,"parameters":[{"name":"antialias","type":["boolean"],"help":"You can toggle the anti-alias feature of the canvas before jumping in to full screen (false = retain pixel art, true = smooth art)","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"stopFullScreen","static":false,"returns":null,"help":"Stops full screen mode if the browser is in it.","line":1018,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"updateDimensions","static":false,"returns":null,"help":"Called automatically when the game parent dimensions change.","line":541,"public":true,"protected":false,"private":false,"parameters":[{"name":"width","type":["number"],"help":"The new width of the parent container.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The new height of the parent container.","optional":false,"default":null},{"name":"resize","type":["boolean"],"help":"True if the renderer should be resized, otherwise false to just update the internal vars.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"fullScreenChange","static":false,"returns":null,"help":"Called automatically when the browser enters of leaves full screen mode.","line":1030,"public":false,"protected":true,"private":false,"parameters":[{"name":"event","type":["Event"],"help":"The fullscreenchange event","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"preUpdate","static":false,"returns":null,"help":"The ScaleManager.preUpdate is called automatically by the core Game loop.","line":506,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"private":[],"static":[]},"properties":{"public":[{"name":"aspectRatio","type":["number"],"help":"","inlineHelp":"The aspect ratio of the scaled game.","line":186,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"bounds","type":["Phaser.Rectangle"],"help":"","inlineHelp":"The bounds of the scaled game. The x\/y will match the offset of the canvas element and the width\/height the scaled width and height.","line":180,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"enterFullScreen","type":["Phaser.Signal"],"help":"","inlineHelp":"The event that is dispatched when the browser enters full screen mode (if it supports the FullScreen API).","line":134,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"enterIncorrectOrientation","type":["Phaser.Signal"],"help":"","inlineHelp":"The event that is dispatched when the browser enters an incorrect orientation, as defined by forceOrientation.","line":116,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"enterLandscape","type":["Phaser.Signal"],"help":"","inlineHelp":"The event that is dispatched when the browser enters landscape orientation having been in portrait.","line":106,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"enterPortrait","type":["Phaser.Signal"],"help":"","inlineHelp":"The event that is dispatched when the browser enters portrait orientation having been in landscape.","line":111,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"event-","type":["any"],"help":"","inlineHelp":" The native browser events from full screen API changes.","line":197,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"forceLandscape","type":["boolean"],"help":"","inlineHelp":"Set to `true` if the game should only run in a landscape orientation.","line":67,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"forcePortrait","type":["boolean"],"help":"","inlineHelp":"Set to `true` if the game should only run in a portrait orientation.","line":73,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"fullScreenTarget","type":["any"],"help":"This is the DOM element that will have the Full Screen mode called on it. It defaults to the game canvas, but can be retargetted to any valid DOM element.\\nIf you adjust this property it's up to you to see it has the correct CSS applied, and that you have contained the game canvas correctly.\\nNote that if you use a scale property of EXACT_FIT then fullScreenTarget will have its width and height style set to 100%.","inlineHelp":"","line":129,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"A reference to the currently running game.","line":21,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"grid","type":["Phaser.FlexGrid"],"help":"","inlineHelp":"EXPERIMENTAL: A responsive grid on which you can align game objects.","line":26,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"height","type":["number"],"help":"","inlineHelp":"Height of the game after calculation.","line":36,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"incorrectOrientation","type":["boolean"],"help":"","inlineHelp":"If `forceLandscape` or `forcePortrait` are true and the browser doesn't match that orientation this is set to `true`.","line":79,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"isFullScreen","type":["boolean"],"help":"","inlineHelp":"Returns true if the browser is in full screen mode, otherwise false.","line":1130,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"isLandscape","type":["boolean"],"help":"","inlineHelp":"Returns true if the browser dimensions match a landscape display.","line":1156,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"isPortrait","type":["boolean"],"help":"","inlineHelp":"Returns true if the browser dimensions match a portrait display.","line":1143,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"leaveFullScreen","type":["Phaser.Signal"],"help":"","inlineHelp":"The event that is dispatched when the browser leaves full screen mode (if it supports the FullScreen API).","line":139,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"leaveIncorrectOrientation","type":["Phaser.Signal"],"help":"","inlineHelp":"The event that is dispatched when the browser leaves an incorrect orientation, as defined by forceOrientation.","line":121,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"margin","type":["Phaser.Point"],"help":"","inlineHelp":"If the game canvas is set to align by adjusting the margin, the margin calculation values are stored in this Point.","line":174,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"maxHeight","type":["number"],"help":"","inlineHelp":"Maximum height the canvas should be scaled to (in pixels). If null it will scale to whatever height the browser can handle.","line":56,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"maxIterations","type":["number"],"help":"","inlineHelp":"The maximum number of times it will try to resize the canvas to fill the browser.","line":101,"default":"5","public":true,"protected":false,"private":false,"readOnly":false},{"name":"maxWidth","type":["number"],"help":"","inlineHelp":"Maximum width the canvas should be scaled to (in pixels). If null it will scale to whatever width the browser can handle.","line":46,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"minHeight","type":["number"],"help":"","inlineHelp":"Minimum height the canvas should be scaled to (in pixels).","line":51,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"minWidth","type":["number"],"help":"","inlineHelp":"Minimum width the canvas should be scaled to (in pixels).","line":41,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"offset","type":["Phaser.Point"],"help":"","inlineHelp":"Holds the offset coordinates of the Game.canvas from the top-left of the browser window (used by Input and other classes)","line":61,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onResize","type":["function"],"help":"","inlineHelp":"The callback that will be called each time a window.resize event happens or if set, the parent container resizes.","line":232,"default":"null","public":true,"protected":false,"private":false,"readOnly":false},{"name":"onResizeContext","type":["object"],"help":"","inlineHelp":"The context in which the callback will be called.","line":238,"default":"null","public":true,"protected":false,"private":false,"readOnly":false},{"name":"orientation","type":["number"],"help":"","inlineHelp":"The orientation value of the game (as defined by window.orientation if set). 90 = landscape. 0 = portrait.","line":144,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pageAlignHorizontally","type":["boolean"],"help":"It will place a re-calculated margin-left pixel value onto the canvas element which is updated on orientation\/resizing events.\\nIt doesn't care about any other DOM element that may be on the page, it literally just sets the margin.","inlineHelp":"If you wish to align your game in the middle of the page then you can set this value to true.","line":87,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"pageAlignVertically","type":["boolean"],"help":"It will place a re-calculated margin-left pixel value onto the canvas element which is updated on orientation\/resizing events.\\nIt doesn't care about any other DOM element that may be on the page, it literally just sets the margin.","inlineHelp":"If you wish to align your game in the middle of the page then you can set this value to true.","line":95,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"parentIsWindow","type":["boolean"],"help":"","inlineHelp":"If the parent container of the game is the browser window, rather than a div, this is set to `true`.","line":208,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"parentNode","type":["object"],"help":"","inlineHelp":"The fully parsed parent container of the game. If the parent is the browser window this will be `null`.","line":214,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"parentScaleFactor","type":["Phaser.Point"],"help":"","inlineHelp":"The scale of the game in relation to its parent container.","line":220,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"scaleFactor","type":["Phaser.Point"],"help":"","inlineHelp":"The scale factor based on the game dimensions vs. the scaled dimensions.","line":162,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"scaleFactorInversed","type":["Phaser.Point"],"help":"","inlineHelp":"The inversed scale factor. The displayed dimensions divided by the game dimensions.","line":168,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"scaleMode","type":["number"],"help":"","inlineHelp":"The scaling method used by the ScaleManager.","line":1106,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"sourceAspectRatio","type":["number"],"help":"","inlineHelp":"The aspect ratio (width \/ height) of the original game dimensions.","line":192,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"trackParentInterval","type":["number"],"help":"","inlineHelp":"The interval (in ms) upon which the ScaleManager checks if the parent has changed dimensions. Only applies if scaleMode = RESIZE and the game is contained within another html element.","line":226,"default":"2000","public":true,"protected":false,"private":false,"readOnly":false},{"name":"width","type":["number"],"help":"","inlineHelp":"Width of the game after calculation.","line":31,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_check","type":["number"],"help":"","inlineHelp":"Cached size interval var.","line":262,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_height","type":["number"],"help":"","inlineHelp":"Cached game height for full screen mode.","line":256,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_nextParentCheck","type":["number"],"help":"","inlineHelp":"The time to run the next parent bounds check.","line":268,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_parentBounds","type":["object"],"help":"","inlineHelp":"The cached result of getBoundingClientRect from the parent.","line":274,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_width","type":["number"],"help":"","inlineHelp":"Cached game width for full screen mode.","line":250,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"scaleMode","type":["number"],"help":"","inlineHelp":"The current scaling method being used.","line":244,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}} |