This file contains hidden or 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
@:build(kha.internal.AssetsBuilder.build("image")) | |
class ImageList { | |
var images:Map<String, ImageInstance>; | |
public function new() { | |
} | |
} | |
class ImageInstance { | |
var image:kha.Image; | |
var load:Void->Void; |
This file contains hidden or 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 motion.actuators.SimpleActuator; | |
class Game | |
{ | |
public function new() | |
{ | |
} | |
This file contains hidden or 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 drawProgressMask(graphics:Graphics, progress:Float, radius:Float = 50, x:Float = 0, y:Float = 0, rotation:Float = 0, sides:Int = 6):Void | |
{ | |
graphics.clear(); | |
graphics.beginFill(0); | |
// graphics should have its beginFill function already called by now | |
graphics.moveTo(x, y); | |
if (sides < 3) sides = 3; // 3 sides minimum | |
// Increase the length of the radius to cover the whole target | |
radius /= Math.cos(1 / sides * Math.PI); | |
// Shortcut function |
This file contains hidden or 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 openfl.Assets; | |
import openfl.display.Bitmap; | |
import openfl.display.Graphics; | |
import openfl.display.Sprite; | |
import openfl.events.TimerEvent; | |
import openfl.utils.Timer; | |
class Entity extends Sprite |
This file contains hidden or 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
abstract UserId(Int) { | |
inline function new(id) { | |
this = id; | |
} | |
public static inline function generate():UserId { | |
return new UserId(Std.random(100)); | |
} | |
} |
This file contains hidden or 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 com.crosswalktest; | |
import android.app.Application; | |
import android.util.Log; | |
import com.facebook.react.ReactApplication; | |
import com.facebook.react.ReactInstanceManager; | |
import com.facebook.react.ReactNativeHost; | |
import com.facebook.react.ReactPackage; | |
import com.facebook.react.shell.MainReactPackage; |
This file contains hidden or 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
abstract DataEvent<T>(String) to String | |
{ | |
public inline function new(name) this = name; | |
} | |
typedef Handler<T> = T->Void; | |
class GlobalDispatcher | |
{ | |
static var eventToHandlers = new Map<String,Array<Handler<Dynamic>>>(); |
This file contains hidden or 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 test.message; | |
/** | |
* ... | |
* @author Heorhiy Kharvat | |
*/ | |
class MessageData | |
{ | |
public var id:Int; | |
public var message:String; |