-
You can add
-watchas an arg when running/testing a Lime based project (openfl, haxeflixel, etc.), and it will auto-recompile anytime there's a file change in any of your source directories. -
Snippet for pixel perfect HTML5 rendering for HaxeFlixel.
#if web // pixel perfect render fix! Application.current.window.element.style.setProperty("image-rendering", "pixelated"); #end -
You can use
@:depricated()for functions no longer in use and put some text in the ()'s to tell yourself its depricated
-
You can use
@:haxe.warning("WDeprecated")
to disable deprication warnings or in the terminal use the compiler conditional
-w WDeprecated -
You can use
haxe.PosInfos
for things related to position in code, for example
class Main { static function assert(cond:Bool, ?pos:haxe.PosInfos) { if (!cond) haxe.Log.trace("Assert in " + pos.className + "::" + pos.methodName, pos); } static function main() { assert(1 == 1); // nothing assert(0 == 3); // trace "Assert in Test::main" } }
-
Dynamic Functions can be overriden by just doing this
updateScore = function(miss:Bool = false) { ... }
-
For defines
-D value=anymeans it ends upany=anyand
// looking for it being a bumber
#if (value > 5)will result in an error.