diff --git a/src/pixi/core/renderers/SystemRenderer.hx b/src/pixi/core/renderers/SystemRenderer.hx index fd9de35a..582ce394 100755 --- a/src/pixi/core/renderers/SystemRenderer.hx +++ b/src/pixi/core/renderers/SystemRenderer.hx @@ -1,5 +1,6 @@ package pixi.core.renderers; +import pixi.core.math.shapes.Rectangle; import haxe.extern.EitherType; import js.html.CanvasElement; import pixi.core.Pixi.RendererType; @@ -138,9 +139,10 @@ extern class SystemRenderer extends EventEmitter { * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from * @param {ScaleModes} scaleMode - Should be one of the scaleMode consts * @param {Float} resolution - The resolution / device pixel ratio of the texture being generated + * @param {PIXI.Rectangle} [region] - The region of the displayObject, that shall be rendered, if no region is specified, defaults to the local bounds of the displayObject. * @return {PIXI.Texture} a texture of the graphics object */ - function generateTexture(displayObject:DisplayObject, scaleMode:ScaleModes, resolution:Float):Texture; + function generateTexture(displayObject:DisplayObject, scaleMode:ScaleModes, resolution:Float, ?region:Rectangle):Texture; /** diff --git a/src/pixi/filters/alpha/AlphaFilter.hx b/src/pixi/filters/alpha/AlphaFilter.hx new file mode 100755 index 00000000..c968595b --- /dev/null +++ b/src/pixi/filters/alpha/AlphaFilter.hx @@ -0,0 +1,38 @@ +package pixi.filters.alpha; + +import pixi.core.renderers.webgl.filters.Filter; + +@:native("PIXI.filters.AlphaFilter") +extern class AlphaFilter extends Filter { + + /** + * Simplest filter - applies alpha + * + * Use this instead of Container's alpha property to avoid visual layering of individual elements. + * AlphaFilter applies alpha evenly across the entire display object and any opaque elements it contains. + * If elements are not opaque, they will blend with each other anyway. + * + * Very handy if you want to use common features of all filters: + * + * 1. Assign a blendMode to this filter, blend all elements inside display object with background. + * + * 2. To use clipping in display coordinates, assign a filterArea to the same container that has this filter. + * + * @class + * @extends PIXI.Filter + * @memberof PIXI.filters + */ + + /** + * @param {Float} [alpha=1] Amount of alpha from 0 to 1, where 0 is transparent + */ + function new(?alpha:Float); + + /** + * Coefficient for alpha multiplication + * + * @member {Float} + * @default 1 + */ + var alpha:Float; +} \ No newline at end of file diff --git a/src/pixi/filters/noise/NoiseFilter.hx b/src/pixi/filters/noise/NoiseFilter.hx new file mode 100755 index 00000000..6b4c8770 --- /dev/null +++ b/src/pixi/filters/noise/NoiseFilter.hx @@ -0,0 +1,42 @@ +package pixi.filters.noise; + +import pixi.core.renderers.webgl.filters.Filter; + +@:native("PIXI.filters.NoiseFilter") +extern class NoiseFilter extends Filter { + + + /** + * @author Vico @vicocotea + * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js + */ + + /** + * A Noise effect filter. + * + * @class + * @extends PIXI.Filter + * @memberof PIXI.filters + */ + + /** + * @param {Float} noise - The noise intensity, should be a normalized value in the range [0, 1]. + * @param {Float} seed - A random seed for the noise generation. Default is `Math.random()`. + */ + function new(?noise:Float, ?seed:Float); + + /** + * The amount of noise to apply, this value should be in the range (0, 1]. + * + * @member {Float} + * @default 0.5 + */ + var noise:Float; + + /** + * A seed value to apply to the random noise generation. `Math.random()` is a good value to use. + * + * @member {Float} + */ + var seed:Float; +} \ No newline at end of file