This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import luxe.Mesh; | |
import haxe.io.StringInput; | |
import luxe.options.MeshOptions; | |
import luxe.Vector; | |
import phoenix.Batcher; | |
import phoenix.geometry.Geometry; | |
import PlyParser; | |
import phoenix.geometry.Vertex; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tools { | |
public static macro function extract(value:haxe.macro.Expr.ExprOf<EnumValue>, pattern:haxe.macro.Expr) { | |
return switch (pattern) { | |
case macro $a => $b: | |
macro switch ($value) { | |
case $a: | |
$b; | |
default: | |
throw "no match"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.macro.Expr; | |
class OrMacro { | |
/** | |
* @return The first non-null argument. | |
*/ | |
public static macro function or(options:Array<Expr>):Expr { | |
var ifElseStatements:Expr = options[options.length - 1]; | |
var i:Int = options.length - 1; | |
while(i --> 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
/** | |
* Avoid holes or border artifacts between tiles. | |
* Sometimes the scale by 1.01 trick doesn't work, a greater value should be used. This method finds the correct value for you. | |
* If you use openfl_legacy, pack your atlas using reduceBorderArtifact option in TexturePacker. There is no need to use this option on openfl_next. | |
* You should update the scale of your tiles if your resize the screen during the game to always have the best scale value. | |
* @author loudo | |
*/ | |
class FixTile | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function scaleAroundPoint(target:DisplayObject, point:Point, scaleFactor:Number):void | |
{ | |
var m:Matrix = target.transform.matrix; | |
m.translate( -point.x, -point.y ); | |
m.scale( scaleFactor, scaleFactor); | |
m.translate( point.x, point.y ); | |
target.transform.matrix = m; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Getter<T> { | |
var name:String; | |
var obj:T; | |
public inline function new(name:String,obj:T) { | |
this.name = name; | |
this.obj = obj; | |
} | |
public inline function get() return untyped (obj:haxe.DynamicAccess<Dynamic>)[name]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KeyValueIterator<K,V> { | |
var map:Map<K,V>; | |
var keys:Iterator<K>; | |
static public inline function pairs<K,V>(map:Map<K,V>) return new KeyValueIterator(map); | |
public inline function new(map:Map<K,V>) { | |
this.map = map; | |
this.keys = map.keys(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
class Macros { | |
macro public static function autoInt():Array<Field> { | |
var fields = Context.getBuildFields(); | |
var t = switch(Context.getLocalClass().get().kind) { | |
case KAbstractImpl(c): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Implements different bin packer algorithms that use the MAXRECTS data structure. | |
See http://clb.demon.fi/projects/even-more-rectangle-bin-packing | |
Author: Jukka Jylänki | |
- Original | |
Author: Claus Wahlers | |
- Ported to ActionScript3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.app.Instrumentation; | |
import android.app.KeyguardManager; | |
import android.app.KeyguardManager.KeyguardLock; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.os.IBinder; | |
import android.os.PowerManager; | |
import android.os.PowerManager.WakeLock; | |
import android.support.test.InstrumentationRegistry; |
OlderNewer