Constructor

@:value({ code : null })@:glVertexHeader("attribute float openfl_Alpha;\r\n\t\tattribute vec4 openfl_ColorMultiplier;\r\n\t\tattribute vec4 openfl_ColorOffset;\r\n\t\tattribute vec4 openfl_Position;\r\n\t\tattribute vec2 openfl_TextureCoord;\r\n\r\n\t\tvarying float openfl_Alphav;\r\n\t\tvarying vec4 openfl_ColorMultiplierv;\r\n\t\tvarying vec4 openfl_ColorOffsetv;\r\n\t\tvarying vec2 openfl_TextureCoordv;\r\n\r\n\t\tuniform mat4 openfl_Matrix;\r\n\t\tuniform bool openfl_HasColorTransform;\r\n\t\tuniform vec2 openfl_TextureSize;")@:glVertexBody("openfl_Alphav = openfl_Alpha;\r\n\t\topenfl_TextureCoordv = openfl_TextureCoord;\r\n\r\n\t\tif (openfl_HasColorTransform) {\r\n\r\n\t\t\topenfl_ColorMultiplierv = openfl_ColorMultiplier;\r\n\t\t\topenfl_ColorOffsetv = openfl_ColorOffset / 255.0;\r\n\r\n\t\t}\r\n\r\n\t\tgl_Position = openfl_Matrix * openfl_Position;")@:glVertexSource("#pragma header\r\n\r\n\t\tvoid main(void) {\r\n\r\n\t\t\t#pragma body\r\n\r\n\t\t}")@:glFragmentHeader("varying float openfl_Alphav;\r\n\t\tvarying vec4 openfl_ColorMultiplierv;\r\n\t\tvarying vec4 openfl_ColorOffsetv;\r\n\t\tvarying vec2 openfl_TextureCoordv;\r\n\r\n\t\tuniform bool openfl_HasColorTransform;\r\n\t\tuniform vec2 openfl_TextureSize;\r\n\t\tuniform sampler2D bitmap;")@:glFragmentBody("vec4 color = texture2D (bitmap, openfl_TextureCoordv);\r\n\r\n\t\tif (color.a == 0.0) {\r\n\r\n\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\r\n\r\n\t\t} else if (openfl_HasColorTransform) {\r\n\r\n\t\t\tcolor = vec4 (color.rgb / color.a, color.a);\r\n\r\n\t\t\tmat4 colorMultiplier = mat4 (0);\r\n\t\t\tcolorMultiplier[0][0] = openfl_ColorMultiplierv.x;\r\n\t\t\tcolorMultiplier[1][1] = openfl_ColorMultiplierv.y;\r\n\t\t\tcolorMultiplier[2][2] = openfl_ColorMultiplierv.z;\r\n\t\t\tcolorMultiplier[3][3] = 1.0; // openfl_ColorMultiplierv.w;\r\n\r\n\t\t\tcolor = clamp (openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);\r\n\r\n\t\t\tif (color.a > 0.0) {\r\n\r\n\t\t\t\tgl_FragColor = vec4 (color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\r\n\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\tgl_FragColor = color * openfl_Alphav;\r\n\r\n\t\t}")@:glFragmentSource("#pragma header\r\n\r\n\t\tvoid main(void) {\r\n\r\n\t\t\t#pragma body\r\n\r\n\t\t}")new(?code:ByteArray)