From d5a2a991215535902895ffd89af65d8af5ee6e6a Mon Sep 17 00:00:00 2001 From: damoebius Date: Wed, 8 Jun 2016 11:07:26 +0200 Subject: [PATCH 1/4] Add transformMatrix to DisplayObject http://www.createjs.com/docs/easeljs/classes/DisplayObject.html#property_transformMatrix --- createjs/easeljs/DisplayObject.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/createjs/easeljs/DisplayObject.hx b/createjs/easeljs/DisplayObject.hx index d5aee6b..c906f06 100644 --- a/createjs/easeljs/DisplayObject.hx +++ b/createjs/easeljs/DisplayObject.hx @@ -51,6 +51,7 @@ extern class DisplayObject extends EventDispatcher{ public var visible:Bool; public var x:Float; public var y:Float; + public var transformMatrix:Matrix2D; public var onClick:Dynamic; public var onDoubleClick:Dynamic; From 2851048ea2845ad959124cdd5390ac1e558a1424 Mon Sep 17 00:00:00 2001 From: damoebius Date: Wed, 8 Jun 2016 11:53:28 +0200 Subject: [PATCH 2/4] Update ColorMatrix.hx --- createjs/easeljs/ColorMatrix.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/createjs/easeljs/ColorMatrix.hx b/createjs/easeljs/ColorMatrix.hx index 2959755..56cf00d 100644 --- a/createjs/easeljs/ColorMatrix.hx +++ b/createjs/easeljs/ColorMatrix.hx @@ -10,8 +10,8 @@ extern class ColorMatrix { public function adjustHue(value:Float):ColorMatrix; public function adjustSaturation(value:Float):ColorMatrix; public function clone():ColorMatrix; - public function concat(matrix:Array):ColorMatrix; - public function copyMatrix(matrix:Array):ColorMatrix; + public function concat(matrix:ColorMatrix):ColorMatrix; + public function copyMatrix(matrix:ColorMatrix):ColorMatrix; public function reset():ColorMatrix; public function toArray():Array; From 2305a2f2a9b3fe303f9dcb7cf60f9e3802c93eaa Mon Sep 17 00:00:00 2001 From: damoebius Date: Wed, 8 Jun 2016 11:54:56 +0200 Subject: [PATCH 3/4] Update Graphics.hx http://www.createjs.com/docs/easeljs/classes/Graphics.html#method_setStrokeDash --- createjs/easeljs/Graphics.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/createjs/easeljs/Graphics.hx b/createjs/easeljs/Graphics.hx index 2b14a47..8c07bdc 100644 --- a/createjs/easeljs/Graphics.hx +++ b/createjs/easeljs/Graphics.hx @@ -43,10 +43,11 @@ extern class Graphics { public function rect(x:Float, y:Float, w:Float, h:Float):Graphics; public function setStrokeStyle(thickness:Float, ?caps:Dynamic = 0, ?joints:Dynamic = 0, ?miterLimit:Float = 10, ?ignoreScale:Bool = false):Graphics; public function toString():String; + public function setStrokeDash(?elements:Array,?offset:Int=0):Graphics; public static var BASE_64:Dynamic; public static var Command:Dynamic; public static var STROKE_CAPS_MAP:Array; public static var STROKE_JOINTS_MAP :Array; -} \ No newline at end of file +} From 78a2a1018e52adfceed58cbd115d36b8f1028603 Mon Sep 17 00:00:00 2001 From: David Mouton Date: Fri, 18 Nov 2016 16:41:46 +0100 Subject: [PATCH 4/4] add tamina utils --- org/tamina/events/CreateJSEvent.hx | 91 ++++++++++++++++++++++++++++++ org/tamina/utils/GraphicUtils.hx | 14 +++++ org/tamina/view/Group.hx | 63 +++++++++++++++++++++ package.json | 59 +++++++++++++++++++ 4 files changed, 227 insertions(+) create mode 100644 org/tamina/events/CreateJSEvent.hx create mode 100644 org/tamina/utils/GraphicUtils.hx create mode 100644 org/tamina/view/Group.hx create mode 100644 package.json diff --git a/org/tamina/events/CreateJSEvent.hx b/org/tamina/events/CreateJSEvent.hx new file mode 100644 index 0000000..6dcf098 --- /dev/null +++ b/org/tamina/events/CreateJSEvent.hx @@ -0,0 +1,91 @@ +package org.tamina.events; + +/** + * CreateJSEvent Type + * @class CreateJSEvent + * @module EaselJS + * @static + */ +class CreateJSEvent { + + +/** + * @property BITMAP_LOAD + * @type String + * @static + * @readOnly + */ + static public inline var BITMAP_LOAD:String='load'; + + +/** + * @property MOUSE_UP + * @type String + * @static + * @readOnly + */ + static public inline var MOUSE_UP:String='pressup'; + + +/** + * @property MOUSE_MOVE + * @type String + * @static + * @readOnly + */ + static public inline var MOUSE_MOVE:String='pressmove'; + + +/** + * @property MOUSE_DOWN + * @type String + * @static + * @readOnly + */ + static public inline var MOUSE_DOWN:String='mousedown'; + + +/** + * @property DOUBLE_CLICK + * @type String + * @static + * @readOnly + */ + static public inline var DOUBLE_CLICK:String='dblclick'; + + +/** + * @property CLICK + * @type String + * @static + * @readOnly + */ + static public inline var CLICK:String='click'; + + +/** + * @property TICKER_TICK + * @type String + * @static + * @readOnly + */ + static public inline var TICKER_TICK:String='tick'; + + +/** + * @property STAGE_MOUSE_UP + * @type String + * @static + * @readOnly + */ + static public inline var STAGE_MOUSE_UP:String='stagemouseup'; + +/** + * @property STAGE_MOUSE_MOVE + * @type String + * @static + * @readOnly + */ + static public inline var STAGE_MOUSE_MOVE:String='stagemousemove'; + +} diff --git a/org/tamina/utils/GraphicUtils.hx b/org/tamina/utils/GraphicUtils.hx new file mode 100644 index 0000000..71da113 --- /dev/null +++ b/org/tamina/utils/GraphicUtils.hx @@ -0,0 +1,14 @@ +package org.tamina.utils; + +import createjs.easeljs.Point; +import createjs.easeljs.Rectangle; +class GraphicUtils { + + + public static function isPointInsideRectangle(p:Point,rec:Rectangle):Bool{ + return (p.x > rec.x + && p.x < rec.x + rec.width + && p.y > rec.y + && p.y < rec.y + rec.height); + } +} diff --git a/org/tamina/view/Group.hx b/org/tamina/view/Group.hx new file mode 100644 index 0000000..107c7c9 --- /dev/null +++ b/org/tamina/view/Group.hx @@ -0,0 +1,63 @@ +package org.tamina.view; + +import createjs.easeljs.Container; +import createjs.easeljs.DisplayObject; + +/** + * EaselJS Typed Container + * @module EaselJS + * @class Group[T] + * @extends Container + * @constructor + */ +class Group extends Container { + + /** + * @constructor + * @method new + * @example + * var _contentGroup = new Group(); + * + * var item = new TestElementSprite(); + * item.x = element.x; + * item.y = element.y; + * _contentGroup.addElement(item); + * + * for (i in 0..._contentGroup.getNumChildren()) { + * _contentGroup.getElementAt(i).dispose(); + * } + * _contentGroup.removeAllChildren(); + */ + public function new() { + super(); + } + +/** + * Add an Element to the group + * @method addElement + * @param element {T} the element. T MUST be a DisplayObject + */ + public function addElement(element:T):Void { + this.addChild(element); + } + +/** + * Add an Element to the group at a specific position + * @method addElementAt + * @param element {T} the element. T MUST be a DisplayObject + * @param index {Int} the index + */ + public function addElementAt(element:T, index:Float):Void { + this.addChildAt(element,index); + } + +/** + * Return an Element of the group at a specific position + * @method getElementAt + * @param index {Int} the index + * @return {T} the element. + */ + public function getElementAt(index:Int):T { + return cast getChildAt(index); + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..a777b5b --- /dev/null +++ b/package.json @@ -0,0 +1,59 @@ +{ + "name": "createjs-haxe", + "description": "The project includes Haxe externs for CreateJS libraries: EaselJS, TweenJS, SoundJS, PreloadJS", + "keywords": [ + "haxe", + "createjs", + "easeljs", + "tweenjs", + "preloadjs", + "canvas" + ], + "author": { + "name": "Nikolay Glushchenko" + }, + "version": "1.7.0", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + }, + "main": "", + "preferGlobal": false, + "homepage": "https://github.com/nickalie/CreateJS-Haxe/", + "bugs": { + "url": "https://github.com/nickalie/CreateJS-Haxe/issues" + }, + "repository": { + "type": "git", + "url": "git://github.com/nickalie/CreateJS-Haxe.git" + }, + "dependencies": {}, + "_id": "createjs-haxe@1.6.5", + "_shasum": "762a6bb1764482c1d001d2d354c23fdd1069f004", + "_from": "createjs-haxe@>=1.5.6", + "_npmVersion": "1.4.9", + "_npmUser": { + "name": "haxelib.js", + "email": "haxelibjs@tamina-online.com" + }, + "maintainers": [ + { + "name": "damoebius", + "email": "damo@tamina-online.com" + }, + { + "name": "haxelib.js", + "email": "haxelibjs@tamina-online.com" + } + ], + "dist": { + "shasum": "304c5e6a81681beb7cd01f3d761e14050e49dc9a", + "tarball": "http://registry.npmjs.org/createjs-haxe/-/createjs-haxe-1.6.5.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/createjs-haxe-1.6.5.tgz_1455115044626_0.04731920990161598" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/createjs-haxe/-/createjs-haxe-1.6.5.tgz" +}