GiG
November 13, 2019, 11:25am
#1
Hi,
I’d like to use GSAP, the Greensock tweening libraries made for JS (originally AS3): how do you link a JS library to an Haxe/Openfl project? Well, how do you make externs/wrappers? I am totally new to this.
I asked in the GSAP forum, and a moderator replied this:
"What do you need, just the externs? Those look similar to typescript definitions. Maybe you could modify them once we are finished with the definitions.
https://github.com/greensock/GSAP/blob/b3b57ff1e84cde04153abed4ca3dfcad50d70d38/gsap.d.ts "
Just because I have a grudge with greensock doesn’t mean I shouldn’t help you
Have you tried this?
Perhaps the OpenFL /lib directory would also help (as it has both Haxe and TypeScript versions of definitions)
package openfl.display;
#if (display || !flash)
import openfl.geom.Rectangle;
import openfl.media.SoundTransform;
#if !openfl_global
@:jsRequire("openfl/display/Sprite", "default")
#end
/**
* The Sprite class is a basic display list building block: a display list
* node that can display graphics and can also contain children.
*
* A Sprite object is similar to a movie clip, but does not have a
* timeline. Sprite is an appropriate base class for objects that do not
* require timelines. For example, Sprite would be a logical base class for
* user interface(UI) components that typically do not use the timeline.
*
* The Sprite class is new in ActionScript 3.0. It provides an alternative
This file has been truncated. show original
import DisplayObject from "./DisplayObject";
import DisplayObjectContainer from "./DisplayObjectContainer";
import Graphics from "./Graphics";
import Rectangle from "./../geom/Rectangle";
import SoundTransform from "./../media/SoundTransform";
declare namespace openfl.display {
/**
* The Sprite class is a basic display list building block: a display list
* node that can display graphics and can also contain children.
*
* A Sprite object is similar to a movie clip, but does not have a
* timeline. Sprite is an appropriate base class for objects that do not
* require timelines. For example, Sprite would be a logical base class for
* user interface(UI) components that typically do not use the timeline.
*
* The Sprite class is new in ActionScript 3.0. It provides an alternative
This file has been truncated. show original