mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
You can now specify an autoResize
boolean in the RenderTargetConfig
which is passed to the Render Targets when they are created by a pipeline.
This commit is contained in:
parent
c6f5638e45
commit
92065facf0
2 changed files with 4 additions and 2 deletions
|
@ -501,16 +501,17 @@ var WebGLPipeline = new Class({
|
|||
var scale = GetFastValue(targets[i], 'scale', 1);
|
||||
var minFilter = GetFastValue(targets[i], 'minFilter', 0);
|
||||
var autoClear = GetFastValue(targets[i], 'autoClear', 1);
|
||||
var autoResize = GetFastValue(targets[i], 'autoResize', false);
|
||||
var targetWidth = GetFastValue(targets[i], 'width', null);
|
||||
var targetHeight = GetFastValue(targets[i], 'height', targetWidth);
|
||||
|
||||
if (targetWidth)
|
||||
{
|
||||
renderTargets.push(new RenderTarget(renderer, targetWidth, targetHeight, 1, minFilter, autoClear));
|
||||
renderTargets.push(new RenderTarget(renderer, targetWidth, targetHeight, 1, minFilter, autoClear, autoResize));
|
||||
}
|
||||
else
|
||||
{
|
||||
renderTargets.push(new RenderTarget(renderer, width, height, scale, minFilter, autoClear));
|
||||
renderTargets.push(new RenderTarget(renderer, width, height, scale, minFilter, autoClear, autoResize));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @property {number} [scale=1] - A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. A value of 1 matches it. 0.5 makes the Render Target half the size of the renderer, etc.
|
||||
* @property {number} [minFilter=0] - The minFilter mode of the texture. 0 is `LINEAR`, 1 is `NEAREST`.
|
||||
* @property {boolean} [autoClear=true] - Controls if this Render Target is automatically cleared (via `gl.COLOR_BUFFER_BIT`) during the bind.
|
||||
* @property {boolean} [autoResize=false] - Controls if this Render Target is automatically resized when the Renderer resizes.
|
||||
* @property {number} [width] - The width of the Render Target. This is optional. If given it overrides the `scale` property.
|
||||
* @property {number} [height=width] - The height of the Render Target. This is optional. If not given, it will be set to the same as the `width` value.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue