Skip to content

Instantly share code, notes, and snippets.

@RobDangerous
Created July 13, 2014 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobDangerous/1e9b4ff67bd3e93568d9 to your computer and use it in GitHub Desktop.
Save RobDangerous/1e9b4ff67bd3e93568d9 to your computer and use it in GitHub Desktop.
package kha.graphics2;
import kha.Color;
import kha.Image;
import kha.math.Matrix3;
extern class Graphics {
public function begin(): Void;
public function end(): Void;
public function clear(): Void;
public function drawImage(img: Image, x: Float, y: Float): Void;
public function drawSubImage(img: Image, x: Float, y: Float, sx: Float, sy: Float, sw: Float, sh: Float): Void;
public function drawSacledImage(img: Image, dx: Float, dy: Float, dw: Float, dh: Float): Void;
public function drawScaledSubImage(image: Image, sx: Float, sy: Float, sw: Float, sh: Float, dx: Float, dy: Float, dw: Float, dh: Float): Void;
public function drawRect(x: Float, y: Float, width: Float, height: Float, strength: Float = 1.0): Void;
public function fillRect(x: Float, y: Float, width: Float, height: Float): Void;
public function drawString(text: String, x: Float, y: Float): Void;
public function drawLine(x1: Float, y1: Float, x2: Float, y2: Float, strength: Float = 1.0): Void;
public function drawVideo(video: Video, x: Float, y: Float, width: Float, height: Float): Void;
public function fillTriangle(x1: Float, y1: Float, x2: Float, y2: Float, x3: Float, y3: Float): Void;
public var color(get, set): Color;
public var font(get, set): Font;
public var transformation(get, set): Matrix3; // works on the top of the transformation stack
public function pushTransformation(matrix: Matrix3): Void;
public function popTransformation(): Matrix3;
public var opacity(get, set): Float; // works on the top of the opacity stack
public function pushOpacity(opacity: Float): Void;
public function popOpacity(): Float;
#if graphics4
public var vertexShader(get, set): kha.graphics4.VertexShader;
public var fragmentShader(get, set): kha.graphics4.FragmentShader;
#end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment