diff --git a/.vscode/settings.json b/.vscode/settings.json index 782aca5..2d19c9c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "[haxe]": { - "editor.formatOnSave": true + "editor.formatOnSave": true, + "files.trimTrailingWhitespace": false, } -} \ No newline at end of file +} diff --git a/echo/Body.hx b/echo/Body.hx index c1ce6ca..e13821e 100644 --- a/echo/Body.hx +++ b/echo/Body.hx @@ -198,11 +198,11 @@ class Body implements Disposable #if cog implements cog.IComponent #end { /** * If set, this method is called whenever the Body's X or Y changes. */ - public var on_move:NullFloat->Void>; + public var on_move:Null<(x:Float, y:Float) -> Void>; /** * If set, this method is called whenever the Body's rotation changes. */ - public var on_rotate:NullVoid>; + public var on_rotate:Null<(angle:Float) -> Void>; @:allow(echo.Physics.step_body) public var last_x(default, null):Float; @@ -231,6 +231,7 @@ class Body implements Disposable #if cog implements cog.IComponent #end { * Sets a Body's values from a `BodyOptions` object. * @param options */ + @:haxe.warning("-WDeprecated") public function load_options(?options:BodyOptions) { options = echo.util.JSON.copy_fields(options, defaults); clear_shapes(); diff --git a/echo/data/Data.hx b/echo/data/Data.hx index 02eae63..7700094 100644 --- a/echo/data/Data.hx +++ b/echo/data/Data.hx @@ -244,7 +244,6 @@ class QuadTreeData { public var flag = false; } -@:enum -abstract Direction(Int) from Int to Int { +enum abstract Direction(Int) from Int to Int { var TOP = 0; } diff --git a/echo/data/Types.hx b/echo/data/Types.hx index 0f25d2c..8315c05 100644 --- a/echo/data/Types.hx +++ b/echo/data/Types.hx @@ -1,17 +1,17 @@ package echo.data; -@:enum abstract MassType(Float) from Float to Float { +enum abstract MassType(Float) from Float to Float { var AUTO = -1; var STATIC = 0; } -@:enum abstract ShapeType(Int) from Int to Int { +enum abstract ShapeType(Int) from Int to Int { var RECT; var CIRCLE; var POLYGON; } -@:enum abstract ForceType(Int) from Int to Int { +enum abstract ForceType(Int) from Int to Int { var ACCELERATION; var VELOCITY; var POSITION; diff --git a/echo/util/Bezier.hx b/echo/util/Bezier.hx index 09a7e07..6819d1d 100644 --- a/echo/util/Bezier.hx +++ b/echo/util/Bezier.hx @@ -600,7 +600,7 @@ class Bezier implements Disposable { } } -@:enum abstract BezierCurve(Int) to Int from Int { +enum abstract BezierCurve(Int) to Int from Int { var Linear = 1; var Quadratic = 2; var Cubic = 3;