Static variables

@:value([for (i in 32 ... 256) i])staticfontGlyphs:Array<Int> = [for (i in 32 ... 256) i]

Constructor

new()

Variables

color:Color

The color value is used for geometric primitives, images, and text. Remember to set it back to white to draw images unaltered.

opacity:Float

Methods

@:value({ clearColor : null, clear : true })begin(clear:Bool = true, ?clearColor:Color):Void

@:value({ color : null })clear(?color:Color):Void

drawCharacters(text:Array<Int>, start:Int, length:Int, x:Float, y:Float):Void

Draw a single line of characters with the current color, font and fontSize properties.

When drawing into rendertargets, you might have to use a different shader than the default one - use the default shader when drawing into a transparent section of your rendertarget - use a shader with alphaBlendSource = BlendOne when drawing into a non-transparent section of your rendertarget

@:value({ strength : 1.0 })drawLine(x1:Float, y1:Float, x2:Float, y2:Float, strength:Float = 1.0):Void

@:value({ strength : 1.0 })drawRect(x:Float, y:Float, width:Float, height:Float, strength:Float = 1.0):Void

drawScaledImage(img:Image, dx:FastFloat, dy:FastFloat, dw:FastFloat, dh:FastFloat):Void

dx, dy, dw, dh arguments is the rectangle to draw into the destination context

drawScaledSubImage(img:Image, sx:FastFloat, sy:FastFloat, sw:FastFloat, sh:FastFloat, dx:FastFloat, dy:FastFloat, dw:FastFloat, dh:FastFloat):Void

sx, sy, sw, sh arguments is the sub-rectangle of the source img image dx, dy, dw, dh arguments is the rectangle to draw into the destination context

drawString(text:String, x:Float, y:Float):Void

Draw a single line of text with the current color, font and fontSize properties.

When drawing into rendertargets, you might have to use a different shader than the default one - use the default shader when drawing into a transparent section of your rendertarget - use a shader with alphaBlendSource = BlendOne when drawing into a non-transparent section of your rendertarget

drawSubImage(img:Image, x:FastFloat, y:FastFloat, sx:FastFloat, sy:FastFloat, sw:FastFloat, sh:FastFloat):Void

sx, sy, sw, sh arguments is the sub-rectangle of the source img image

drawVideo(video:Video, x:Float, y:Float, width:Float, height:Float):Void

end():Void

fillRect(x:Float, y:Float, width:Float, height:Float):Void

fillTriangle(x1:Float, y1:Float, x2:Float, y2:Float, x3:Float, y3:Float):Void

flush():Void

popOpacity():Float

pushOpacity(opacity:Float):Void

pushRotation(angle:FastFloat, centerx:FastFloat, centery:FastFloat):Void

rotate(angle:FastFloat, centerx:FastFloat, centery:FastFloat):Void

scissor(x:Int, y:Int, width:Int, height:Int):Void