mirror of
https://github.com/photonstorm/phaser
synced 2024-09-20 22:41:54 +00:00
There is a new boolean Game Config property called customEnvironment
. If set to true
it will skip the internal Feature checks when working out which type of renderer to create, allowing you to run Phaser under non-native web environments. If using this value, you _must_ set an explicit renderType
of either CANVAS or WEBGL. It cannot be left as AUTO. Fix #4166
This commit is contained in:
parent
41343e3102
commit
f85a79c0d7
3 changed files with 12 additions and 1 deletions
|
@ -40,6 +40,7 @@
|
|||
* `BlendModes.COPY` is a new Canvas-only blend mode, that allows you to use the `copy` composite operation when rendering Game Objects.
|
||||
* `BlendModes.XOR` is a new Canvas-only blend mode, that allows you to use the `xor` composite operation when rendering Game Objects.
|
||||
* `RenderTexture.erase` is a new method that will take an object, or array of objects, and draw them to the Render Texture using an ERASE blend mode, resulting in them being removed from the Render Texture. This is really handy for making a bitmap masked texture in Canvas or WebGL (without using an actual mask), or for 'cutting away' part of a texture.
|
||||
* There is a new boolean Game Config property called `customEnvironment`. If set to `true` it will skip the internal Feature checks when working out which type of renderer to create, allowing you to run Phaser under non-native web environments. If using this value, you _must_ set an explicit `renderType` of either CANVAS or WEBGL. It cannot be left as AUTO. Fix #4166 (thanks @jcyuan)
|
||||
|
||||
### Updates
|
||||
|
||||
|
|
|
@ -357,6 +357,11 @@ var Config = new Class({
|
|||
*/
|
||||
this.canvasStyle = GetValue(config, 'canvasStyle', null);
|
||||
|
||||
/**
|
||||
* @const {boolean} Phaser.Boot.Config#customEnvironment - Is Phaser running under a custom (non-native web) environment? If so, set this to `true` to skip internal Feature detection. If `true` the `renderType` cannot be left as `AUTO`.
|
||||
*/
|
||||
this.customEnvironment = GetValue(config, 'customEnvironment', false);
|
||||
|
||||
/**
|
||||
* @const {?object} Phaser.Boot.Config#sceneConfig - The default Scene configuration object.
|
||||
*/
|
||||
|
|
|
@ -26,7 +26,7 @@ var CreateRenderer = function (game)
|
|||
// Game either requested Canvas,
|
||||
// or requested AUTO or WEBGL but the browser doesn't support it, so fall back to Canvas
|
||||
|
||||
if (config.renderType !== CONST.HEADLESS)
|
||||
if ((config.customEnvironment || config.canvas) && config.renderType !== CONST.HEADLESS)
|
||||
{
|
||||
if (config.renderType === CONST.CANVAS || (config.renderType !== CONST.CANVAS && !Features.webGL))
|
||||
{
|
||||
|
@ -47,6 +47,11 @@ var CreateRenderer = function (game)
|
|||
}
|
||||
}
|
||||
|
||||
if (config.customEnvironment && config.renderType === CONST.AUTO)
|
||||
{
|
||||
throw new Error('Must set renderType in custom environment');
|
||||
}
|
||||
|
||||
// Pixel Art mode?
|
||||
if (!config.antialias)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue