2
0
Mark Knol 7 жил өмнө
parent
commit
4a8a4233f2
8 өөрчлөгдсөн 59 нэмэгдсэн , 59 устгасан
  1. 5 5
      h2d/Anim.hx
  2. 3 3
      h2d/Bitmap.hx
  3. 2 2
      h2d/Drawable.hx
  4. 6 6
      h2d/Scene.hx
  5. 8 8
      h2d/Sprite.hx
  6. 1 1
      h2d/Text.hx
  7. 25 25
      h2d/Tile.hx
  8. 9 9
      h2d/TileGroup.hx

+ 5 - 5
h2d/Anim.hx

@@ -16,7 +16,7 @@ class Anim extends Drawable {
 	public var fading : Bool = false;
 	public var fading : Bool = false;
 	var curFrame : Float;
 	var curFrame : Float;
 
 
-	public function new( ?frames, ?speed, ?parent ) {
+	public function new( ?frames : Array<Tile>, ?speed : Float, ?parent : h2d.Sprite ) {
 		super(parent);
 		super(parent);
 		this.frames = frames == null ? [] : frames;
 		this.frames = frames == null ? [] : frames;
 		this.curFrame = 0;
 		this.curFrame = 0;
@@ -27,7 +27,7 @@ class Anim extends Drawable {
 		return curFrame;
 		return curFrame;
 	}
 	}
 
 
-	public function play( frames, atFrame = 0. ) {
+	public function play( frames : Array<Tile>, atFrame = 0. ) {
 		this.frames = frames == null ? [] : frames;
 		this.frames = frames == null ? [] : frames;
 		currentFrame = atFrame;
 		currentFrame = atFrame;
 		pause = false;
 		pause = false;
@@ -42,7 +42,7 @@ class Anim extends Drawable {
 		return curFrame;
 		return curFrame;
 	}
 	}
 
 
-	override function getBoundsRec( relativeTo, out, forSize ) {
+	override function getBoundsRec( relativeTo : Sprite, out : h2d.col.Bounds, forSize : Bool ) {
 		super.getBoundsRec(relativeTo, out, forSize);
 		super.getBoundsRec(relativeTo, out, forSize);
 		var tile = getFrame();
 		var tile = getFrame();
 		if( tile != null ) addBounds(relativeTo, out, tile.dx, tile.dy, tile.width, tile.height);
 		if( tile != null ) addBounds(relativeTo, out, tile.dx, tile.dy, tile.width, tile.height);
@@ -67,7 +67,7 @@ class Anim extends Drawable {
 		}
 		}
 	}
 	}
 
 
-	public function getFrame() {
+	public function getFrame() : Tile {
 		var i = Std.int(curFrame);
 		var i = Std.int(curFrame);
 		if( i == frames.length ) i--;
 		if( i == frames.length ) i--;
 		return frames[i];
 		return frames[i];
@@ -94,4 +94,4 @@ class Anim extends Drawable {
 		}
 		}
 	}
 	}
 
 
-}
+}

+ 3 - 3
h2d/Bitmap.hx

@@ -4,7 +4,7 @@ class Bitmap extends Drawable {
 
 
 	public var tile : Tile;
 	public var tile : Tile;
 
 
-	public function new( ?tile, ?parent ) {
+	public function new( ?tile : Tile, ?parent : h2d.Sprite ) {
 		super(parent);
 		super(parent);
 		this.tile = tile;
 		this.tile = tile;
 	}
 	}
@@ -15,7 +15,7 @@ class Bitmap extends Drawable {
 		return tileWrap = b;
 		return tileWrap = b;
 	}
 	}
 
 
-	override function getBoundsRec( relativeTo, out, forSize ) {
+	override function getBoundsRec( relativeTo : Sprite, out : h2d.col.Bounds, forSize : Bool ) {
 		super.getBoundsRec(relativeTo, out, forSize);
 		super.getBoundsRec(relativeTo, out, forSize);
 		if( tile != null ) addBounds(relativeTo, out, tile.dx, tile.dy, tile.width, tile.height);
 		if( tile != null ) addBounds(relativeTo, out, tile.dx, tile.dy, tile.width, tile.height);
 	}
 	}
@@ -24,4 +24,4 @@ class Bitmap extends Drawable {
 		emitTile(ctx,tile);
 		emitTile(ctx,tile);
 	}
 	}
 
 
-}
+}

+ 2 - 2
h2d/Drawable.hx

@@ -20,7 +20,7 @@ class Drawable extends Sprite {
 
 
 	var shaders : hxsl.ShaderList;
 	var shaders : hxsl.ShaderList;
 
 
-	function new(parent) {
+	function new(parent : h2d.Sprite) {
 		super(parent);
 		super(parent);
 		blendMode = Alpha;
 		blendMode = Alpha;
 		color = new h3d.Vector(1, 1, 1, 1);
 		color = new h3d.Vector(1, 1, 1, 1);
@@ -65,7 +65,7 @@ class Drawable extends Sprite {
 		return colorKey = v;
 		return colorKey = v;
 	}
 	}
 
 
-	public function adjustColor( ?col : ColorAdjust ) {
+	public function adjustColor( ?col : ColorAdjust ) : Void {
 		if( col == null )
 		if( col == null )
 			colorMatrix = null;
 			colorMatrix = null;
 		else {
 		else {

+ 6 - 6
h2d/Scene.hx

@@ -36,7 +36,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 	inline function get_defaultSmooth() return ctx.defaultSmooth;
 	inline function get_defaultSmooth() return ctx.defaultSmooth;
 	inline function set_defaultSmooth(v) return ctx.defaultSmooth = v;
 	inline function set_defaultSmooth(v) return ctx.defaultSmooth = v;
 
 
-	public function setEvents(events) {
+	public function setEvents(events : hxd.SceneEvents) {
 		this.events = events;
 		this.events = events;
 	}
 	}
 
 
@@ -60,7 +60,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 	function get_renderer() return ctx;
 	function get_renderer() return ctx;
 	function set_renderer(v) { ctx = v; return v; }
 	function set_renderer(v) { ctx = v; return v; }
 
 
-	public function setFixedSize( w, h ) {
+	public function setFixedSize( w : Int, h : Int ) {
 		width = w;
 		width = w;
 		height = h;
 		height = h;
 		fixedSize = true;
 		fixedSize = true;
@@ -101,7 +101,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		}
 		}
 	}
 	}
 
 
-	public function isInteractiveVisible( i : hxd.SceneEvents.Interactive ) {
+	public function isInteractiveVisible( i : hxd.SceneEvents.Interactive ) : Bool {
 		var s : Sprite = cast i;
 		var s : Sprite = cast i;
 		while( s != null ) {
 		while( s != null ) {
 			if( !s.visible ) return false;
 			if( !s.visible ) return false;
@@ -110,7 +110,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		return true;
 		return true;
 	}
 	}
 
 
-	public function getInteractive( x : Float, y : Float ) {
+	public function getInteractive( x : Float, y : Float ) : Interactive {
 		var rx = x * matA + y * matB + absX;
 		var rx = x * matA + y * matB + absX;
 		var ry = x * matC + y * matD + absY;
 		var ry = x * matC + y * matD + absY;
 		for( i in interactive ) {
 		for( i in interactive ) {
@@ -277,7 +277,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		events.stopDrag();
 		events.stopDrag();
 	}
 	}
 
 
-	public function getFocus() {
+	public function getFocus() : Interactive {
 		if( events == null )
 		if( events == null )
 			return null;
 			return null;
 		var f = events.getFocus();
 		var f = events.getFocus();
@@ -432,4 +432,4 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 	}
 	}
 
 
 
 
-}
+}

+ 8 - 8
h2d/Sprite.hx

@@ -103,14 +103,14 @@ class Sprite {
 		return arr;
 		return arr;
 	}
 	}
 
 
-	function set_filter(f) {
+	function set_filter(f : h2d.filter.Filter) {
 		if( filter != null && allocated ) filter.unbind(this);
 		if( filter != null && allocated ) filter.unbind(this);
 		filter = f;
 		filter = f;
 		if( f != null && allocated ) f.bind(this);
 		if( f != null && allocated ) f.bind(this);
 		return f;
 		return f;
 	}
 	}
 
 
-	function getBoundsRec( relativeTo : Sprite, out : h2d.col.Bounds, forSize : Bool ) {
+	function getBoundsRec( relativeTo : Sprite, out : h2d.col.Bounds, forSize : Bool ) : Void {
 		if( posChanged ) {
 		if( posChanged ) {
 			calcAbsPos();
 			calcAbsPos();
 			for( c in children )
 			for( c in children )
@@ -195,14 +195,14 @@ class Sprite {
 		out.addPos(x * rA + y * rC, x * rB + y * rD);
 		out.addPos(x * rA + y * rC, x * rB + y * rD);
 	}
 	}
 
 
-	public function getSpritesCount() {
+	public function getSpritesCount() : Int {
 		var k = 0;
 		var k = 0;
 		for( c in children )
 		for( c in children )
 			k += c.getSpritesCount() + 1;
 			k += c.getSpritesCount() + 1;
 		return k;
 		return k;
 	}
 	}
 
 
-	public function localToGlobal( ?pt : h2d.col.Point ) {
+	public function localToGlobal( ?pt : h2d.col.Point ) : h2d.col.Point {
 		syncPos();
 		syncPos();
 		if( pt == null ) pt = new h2d.col.Point();
 		if( pt == null ) pt = new h2d.col.Point();
 		var px = pt.x * matA + pt.y * matC + absX;
 		var px = pt.x * matA + pt.y * matC + absX;
@@ -212,7 +212,7 @@ class Sprite {
 		return pt;
 		return pt;
 	}
 	}
 
 
-	public function globalToLocal( pt : h2d.col.Point ) {
+	public function globalToLocal( pt : h2d.col.Point ) : h2d.col.Point {
 		syncPos();
 		syncPos();
 		pt.x -= absX;
 		pt.x -= absX;
 		pt.y -= absY;
 		pt.y -= absY;
@@ -224,7 +224,7 @@ class Sprite {
 		return pt;
 		return pt;
 	}
 	}
 
 
-	function getScene() {
+	function getScene() : Scene {
 		var p = this;
 		var p = this;
 		while( p.parent != null ) p = p.parent;
 		while( p.parent != null ) p = p.parent;
 		return Std.instance(p, Scene);
 		return Std.instance(p, Scene);
@@ -238,11 +238,11 @@ class Sprite {
 		return b;
 		return b;
 	}
 	}
 
 
-	public function addChild( s : Sprite ) {
+	public function addChild( s : Sprite ) : Void {
 		addChildAt(s, children.length);
 		addChildAt(s, children.length);
 	}
 	}
 
 
-	public function addChildAt( s : Sprite, pos : Int ) {
+	public function addChildAt( s : Sprite, pos : Int ) : Void {
 		if( pos < 0 ) pos = 0;
 		if( pos < 0 ) pos = 0;
 		if( pos > children.length ) pos = children.length;
 		if( pos > children.length ) pos = children.length;
 		var p = this;
 		var p = this;

+ 1 - 1
h2d/Text.hx

@@ -35,7 +35,7 @@ class Text extends Drawable {
 	var waShader : h3d.shader.WhiteAlpha;
 	var waShader : h3d.shader.WhiteAlpha;
 	#end
 	#end
 
 
-	public function new( font : Font, ?parent ) {
+	public function new( font : Font, ?parent : h2d.Sprite ) {
 		super(parent);
 		super(parent);
 		this.font = font;
 		this.font = font;
 		textAlign = Left;
 		textAlign = Left;

+ 25 - 25
h2d/Tile.hx

@@ -17,7 +17,7 @@ class Tile {
 	public var width(default,null) : Int;
 	public var width(default,null) : Int;
 	public var height(default,null) : Int;
 	public var height(default,null) : Int;
 
 
-	function new(tex, x, y, w, h, dx=0, dy=0) {
+	function new(tex : h3d.mat.Texture, x : Int, y : Int, w : Int, h : Int, dx=0, dy=0) {
 		this.innerTex = tex;
 		this.innerTex = tex;
 		this.x = x;
 		this.x = x;
 		this.y = y;
 		this.y = y;
@@ -28,7 +28,7 @@ class Tile {
 		if( tex != null ) setTexture(tex);
 		if( tex != null ) setTexture(tex);
 	}
 	}
 
 
-	public inline function getTexture() {
+	public inline function getTexture():h3d.mat.Texture {
 		return innerTex;
 		return innerTex;
 	}
 	}
 
 
@@ -36,7 +36,7 @@ class Tile {
 		return innerTex == null || innerTex.isDisposed();
 		return innerTex == null || innerTex.isDisposed();
 	}
 	}
 
 
-	function setTexture(tex) {
+	function setTexture(tex : h3d.mat.Texture) {
 		this.innerTex = tex;
 		this.innerTex = tex;
 		if( tex != null ) {
 		if( tex != null ) {
 			this.u = x / tex.width;
 			this.u = x / tex.width;
@@ -50,11 +50,11 @@ class Tile {
 		setTexture(t.innerTex);
 		setTexture(t.innerTex);
 	}
 	}
 
 
-	public function sub( x, y, w, h, dx = 0, dy = 0 ) {
+	public function sub( x : Int, y : Int, w : Int, h : Int, dx = 0, dy = 0 ) : Tile {
 		return new Tile(innerTex, this.x + x, this.y + y, w, h, dx, dy);
 		return new Tile(innerTex, this.x + x, this.y + y, w, h, dx, dy);
 	}
 	}
 
 
-	public function center() {
+	public function center():Tile {
 		return sub(0, 0, width, height, -(width>>1), -(height>>1));
 		return sub(0, 0, width, height, -(width>>1), -(height>>1));
 	}
 	}
 
 
@@ -63,17 +63,17 @@ class Tile {
 		dy = -Std.int(py*height);
 		dy = -Std.int(py*height);
 	}
 	}
 
 
-	public function flipX() {
+	public function flipX() : Void {
 		var tmp = u; u = u2; u2 = tmp;
 		var tmp = u; u = u2; u2 = tmp;
 		dx = -dx - width;
 		dx = -dx - width;
 	}
 	}
 
 
-	public function flipY() {
+	public function flipY() : Void {
 		var tmp = v; v = v2; v2 = tmp;
 		var tmp = v; v = v2; v2 = tmp;
 		dy = -dy - height;
 		dy = -dy - height;
 	}
 	}
 
 
-	public function setPos(x, y) {
+	public function setPos(x : Int, y : Int) : Void {
 		this.x = x;
 		this.x = x;
 		this.y = y;
 		this.y = y;
 		var tex = innerTex;
 		var tex = innerTex;
@@ -85,7 +85,7 @@ class Tile {
 		}
 		}
 	}
 	}
 
 
-	public function setSize(w, h) {
+	public function setSize(w : Int, h : Int) : Void {
 		this.width = w;
 		this.width = w;
 		this.height = h;
 		this.height = h;
 		var tex = innerTex;
 		var tex = innerTex;
@@ -95,12 +95,12 @@ class Tile {
 		}
 		}
 	}
 	}
 
 
-	public function scaleToSize( w, h ) {
+	public function scaleToSize( w : Int, h : Int ) : Void {
 		this.width = w;
 		this.width = w;
 		this.height = h;
 		this.height = h;
 	}
 	}
 
 
-	public function scrollDiscrete( dx : Float, dy : Float ) {
+	public function scrollDiscrete( dx : Float, dy : Float ) : Void {
 		var tex = innerTex;
 		var tex = innerTex;
 		u += dx / tex.width;
 		u += dx / tex.width;
 		v -= dy / tex.height;
 		v -= dy / tex.height;
@@ -110,12 +110,12 @@ class Tile {
 		y = Std.int(v * tex.height);
 		y = Std.int(v * tex.height);
 	}
 	}
 
 
-	public function dispose() {
+	public function dispose() : Void {
 		if( innerTex != null ) innerTex.dispose();
 		if( innerTex != null ) innerTex.dispose();
 		innerTex = null;
 		innerTex = null;
 	}
 	}
 
 
-	public function clone() {
+	public function clone() : Tile {
 		var t = new Tile(null, x, y, width, height, dx, dy);
 		var t = new Tile(null, x, y, width, height, dx, dy);
 		t.innerTex = innerTex;
 		t.innerTex = innerTex;
 		t.u = u;
 		t.u = u;
@@ -128,7 +128,7 @@ class Tile {
 	/**
 	/**
 		Split horizontaly or verticaly the number of given frames
 		Split horizontaly or verticaly the number of given frames
 	**/
 	**/
-	public function split( frames : Int = 0, vertical = false ) {
+	public function split( frames : Int = 0, vertical = false ) : Array<Tile> {
 		var tl = [];
 		var tl = [];
 		if( vertical ) {
 		if( vertical ) {
 			if( frames == 0 )
 			if( frames == 0 )
@@ -150,22 +150,22 @@ class Tile {
 		Split the tile into a list of tiles of Size x Size pixels.
 		Split the tile into a list of tiles of Size x Size pixels.
 		Unlike grid which is X/Y ordered, gridFlatten returns a single dimensional array ordered in Y/X.
 		Unlike grid which is X/Y ordered, gridFlatten returns a single dimensional array ordered in Y/X.
 	**/
 	**/
-	public function gridFlatten( size : Int, dx = 0, dy = 0 ) {
+	public function gridFlatten( size : Int, dx = 0, dy = 0 ) : Array<Tile> {
 		return [for( y in 0...Std.int(height / size) ) for( x in 0...Std.int(width / size) ) sub(x * size, y * size, size, size, dx, dy)];
 		return [for( y in 0...Std.int(height / size) ) for( x in 0...Std.int(width / size) ) sub(x * size, y * size, size, size, dx, dy)];
 	}
 	}
 
 
 	/**
 	/**
 		Split the tile into a list of tiles of Size x Size pixels.
 		Split the tile into a list of tiles of Size x Size pixels.
 	**/
 	**/
-	public function grid( size : Int, dx = 0, dy = 0 ) {
+	public function grid( size : Int, dx = 0, dy = 0 ) : Array<Array<Tile>> {
 		return [for( x in 0...Std.int(width / size) ) [for( y in 0...Std.int(height / size) ) sub(x * size, y * size, size, size, dx, dy)]];
 		return [for( x in 0...Std.int(width / size) ) [for( y in 0...Std.int(height / size) ) sub(x * size, y * size, size, size, dx, dy)]];
 	}
 	}
 
 
-	public function toString() {
+	public function toString() : String {
 		return "Tile(" + x + "," + y + "," + width + "x" + height + (dx != 0 || dy != 0 ? "," + dx + ":" + dy:"") + ")";
 		return "Tile(" + x + "," + y + "," + width + "x" + height + (dx != 0 || dy != 0 ? "," + dx + ":" + dy:"") + ")";
 	}
 	}
 
 
-	function upload( bmp:hxd.BitmapData ) {
+	function upload( bmp:hxd.BitmapData ) : Void {
 		var w = innerTex.width;
 		var w = innerTex.width;
 		var h = innerTex.height;
 		var h = innerTex.height;
 		#if flash
 		#if flash
@@ -178,11 +178,11 @@ class Tile {
 			bmp2.dispose();
 			bmp2.dispose();
 		} else
 		} else
 		#end
 		#end
-			innerTex.uploadBitmap(bmp);
+		innerTex.uploadBitmap(bmp);
 	}
 	}
 
 
 
 
-	public static function fromColor( color : Int, ?width = 1, ?height = 1, ?alpha = 1., ?allocPos : h3d.impl.AllocPos ) {
+	public static function fromColor( color : Int, ?width = 1, ?height = 1, ?alpha = 1., ?allocPos : h3d.impl.AllocPos ) : Tile {
 		var t = new Tile(h3d.mat.Texture.fromColor(color,alpha,allocPos),0,0,1,1);
 		var t = new Tile(h3d.mat.Texture.fromColor(color,alpha,allocPos),0,0,1,1);
 		// scale to size
 		// scale to size
 		t.width = width;
 		t.width = width;
@@ -190,7 +190,7 @@ class Tile {
 		return t;
 		return t;
 	}
 	}
 
 
-	public static function fromBitmap( bmp : hxd.BitmapData, ?allocPos : h3d.impl.AllocPos ) {
+	public static function fromBitmap( bmp : hxd.BitmapData, ?allocPos : h3d.impl.AllocPos ) : Tile {
 		var tex = h3d.mat.Texture.fromBitmap(bmp, allocPos);
 		var tex = h3d.mat.Texture.fromBitmap(bmp, allocPos);
 		return new Tile(tex, 0, 0, bmp.width, bmp.height);
 		return new Tile(tex, 0, 0, bmp.width, bmp.height);
 	}
 	}
@@ -226,18 +226,18 @@ class Tile {
 		return { main : main, tiles : tl };
 		return { main : main, tiles : tl };
 	}
 	}
 
 
-	public static function fromTexture( t : h3d.mat.Texture ) {
+	public static function fromTexture( t : h3d.mat.Texture ) : Tile {
 		return new Tile(t, 0, 0, t.width, t.height);
 		return new Tile(t, 0, 0, t.width, t.height);
 	}
 	}
 
 
-	public static function fromPixels( pixels : hxd.Pixels, ?allocPos : h3d.impl.AllocPos ) {
+	public static function fromPixels( pixels : hxd.Pixels, ?allocPos : h3d.impl.AllocPos ) : Tile {
 		var pix2 = pixels.makeSquare(true);
 		var pix2 = pixels.makeSquare(true);
 		var t = h3d.mat.Texture.fromPixels(pix2);
 		var t = h3d.mat.Texture.fromPixels(pix2);
 		if( pix2 != pixels ) pix2.dispose();
 		if( pix2 != pixels ) pix2.dispose();
 		return new Tile(t, 0, 0, pixels.width, pixels.height);
 		return new Tile(t, 0, 0, pixels.width, pixels.height);
 	}
 	}
 
 
-	static function isEmpty( b : hxd.BitmapData, px, py, width, height, bg : Int ) {
+	static function isEmpty( b : hxd.BitmapData, px : int, py : int, width : int, height : int, bg : Int ) {
 		var empty = true;
 		var empty = true;
 		var xmin = width, ymin = height, xmax = 0, ymax = 0;
 		var xmin = width, ymin = height, xmax = 0, ymax = 0;
 		for( x in 0...width )
 		for( x in 0...width )
@@ -260,4 +260,4 @@ class Tile {
 		return empty ? null : { dx : xmin, dy : ymin, w : xmax - xmin + 1, h : ymax - ymin + 1 };
 		return empty ? null : { dx : xmin, dy : ymin, w : xmax - xmin + 1, h : ymax - ymin + 1 };
 	}
 	}
 
 
-}
+}

+ 9 - 9
h2d/TileGroup.hx

@@ -391,7 +391,7 @@ class TileGroup extends Drawable {
 	public var rangeMin : Int;
 	public var rangeMin : Int;
 	public var rangeMax : Int;
 	public var rangeMax : Int;
 
 
-	public function new(t,?parent) {
+	public function new(t : Tile, ?parent : h2d.Sprite) {
 		super(parent);
 		super(parent);
 		tile = t;
 		tile = t;
 		rangeMin = rangeMax = -1;
 		rangeMin = rangeMax = -1;
@@ -399,12 +399,12 @@ class TileGroup extends Drawable {
 		content = new TileLayerContent();
 		content = new TileLayerContent();
 	}
 	}
 
 
-	override function getBoundsRec( relativeTo, out, forSize ) {
+	override function getBoundsRec( relativeTo : Sprite, out : h2d.col.Bounds, forSize : Bool ) {
 		super.getBoundsRec(relativeTo, out, forSize);
 		super.getBoundsRec(relativeTo, out, forSize);
 		addBounds(relativeTo, out, content.xMin, content.yMin, content.xMax - content.xMin, content.yMax - content.yMin);
 		addBounds(relativeTo, out, content.xMin, content.yMin, content.xMax - content.xMin, content.yMax - content.yMin);
 	}
 	}
 
 
-	public function clear() {
+	public function clear() : Void {
 		content.clear();
 		content.clear();
 	}
 	}
 
 
@@ -412,14 +412,14 @@ class TileGroup extends Drawable {
 		If you want to add tiles after the GPU memory has been allocated (when the tilegroup with sync/displayed),
 		If you want to add tiles after the GPU memory has been allocated (when the tilegroup with sync/displayed),
 		make sure to call invalidate() first to force a refresh of your data.
 		make sure to call invalidate() first to force a refresh of your data.
 	**/
 	**/
-	public function invalidate() {
+	public function invalidate() : Void {
 		content.dispose();
 		content.dispose();
 	}
 	}
 
 
 	/**
 	/**
 		Returns the number of tiles added to the group
 		Returns the number of tiles added to the group
 	**/
 	**/
-	public function count() {
+	public function count() : Int {
 		return content.triCount() >> 1;
 		return content.triCount() >> 1;
 	}
 	}
 
 
@@ -435,19 +435,19 @@ class TileGroup extends Drawable {
 		curColor.w = alpha;
 		curColor.w = alpha;
 	}
 	}
 
 
-	public inline function add(x, y, t) {
+	public inline function add(x : Int, y : Int, t : h2d.Tile) {
 		content.add(x, y, curColor.x, curColor.y, curColor.z, curColor.w, t);
 		content.add(x, y, curColor.x, curColor.y, curColor.z, curColor.w, t);
 	}
 	}
 
 
-	public inline function addColor(x, y, r, g, b, a, t) {
+	public inline function addColor( x : Int, y : Int, r : Float, g : Float, b : Float, a : Float, t : Tile) {
 		content.add(x, y, r, g, b, a, t);
 		content.add(x, y, r, g, b, a, t);
 	}
 	}
 
 
-	public inline function addAlpha(x, y, a, t) {
+	public inline function addAlpha(x : Int, y : Int, a : Float, t : h2d.Tile) {
 		content.add(x, y, curColor.x, curColor.y, curColor.z, a, t);
 		content.add(x, y, curColor.x, curColor.y, curColor.z, a, t);
 	}
 	}
 
 
-	public inline function addTransform(x, y, sx, sy, r, t) {
+	public inline function addTransform(x : Int, y : Int, sx : Float, sy : Float, r : Float, t : Tile) {
 		content.addTransform(x, y, sx, sy, r, curColor, t);
 		content.addTransform(x, y, sx, sy, r, curColor, t);
 	}
 	}