Created
April 18, 2021 13:15
-
-
Save KinoAR/df2b8236a73d8a53fd1941a82d50f772 to your computer and use it in GitHub Desktop.
Example extern class taking from our own LunaTea development code.
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; | |
//Expose metatag is used to make sure that when the code is being referenced in the target language it'll be exposed | |
//for user's to override. I use this in JS to allow for modification, which is core to RPGMakerMV/MZ. | |
//Native metatag is used to make sure that when the code is compiled it uses the proper name. | |
//Native works both on classes and fields, which you can see for the x, y fields below. | |
@:expose("Point") | |
@:native("Point") | |
extern class Point extends pixi.core.math.Point { | |
/** | |
* The point class. | |
* | |
* @class Point | |
* @constructor | |
* @param {Number} x The x coordinate | |
* @param {Number} y The y coordinate | |
*/ | |
public function new(?x: Float, ?y: Float); | |
/** | |
* The x coordinate. | |
* | |
* @property x | |
* @type Number | |
*/ | |
@:native("x") | |
public var _x: Float; | |
/** | |
* The y coordinate. | |
* | |
* @property y | |
* @type Number | |
*/ | |
@:native("y") | |
public var _y: Float; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment