added native math object
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
package js;
|
||||||
|
|
||||||
|
import js.annotations.native
|
||||||
|
|
||||||
|
native
|
||||||
|
val Math = object {
|
||||||
|
native
|
||||||
|
fun random() : Double = 0.0;
|
||||||
|
fun abs(value : Double) = 0.0
|
||||||
|
fun acos(value : Double) = 0.0
|
||||||
|
fun asin(value : Double) = 0.0
|
||||||
|
fun atan(value : Double) = 0.0
|
||||||
|
fun atan2(x : Double, y : Double) = 0.0
|
||||||
|
fun cos(value : Double) = 0.0
|
||||||
|
fun sin(value : Double) = 0.0
|
||||||
|
fun exp(value : Double) = 0.0
|
||||||
|
fun max(vararg values : Double) = 0.0
|
||||||
|
fun min(vararg values : Double) = 0.0
|
||||||
|
fun sqrt(value : Double) = 0.0
|
||||||
|
fun tan(value : Double) = 0.0
|
||||||
|
fun log(value : Double) = 0.0
|
||||||
|
fun pow(base : Double, exp : Double) = 0.0
|
||||||
|
fun round(value : Double) = 0.0
|
||||||
|
fun floor(value : Double) = 0.0
|
||||||
|
fun ceil(value : Double) = 0.0
|
||||||
|
}
|
||||||
@@ -51,12 +51,11 @@ class TextMetrics() {
|
|||||||
val width : Int = 0
|
val width : Int = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*custom helpers*/
|
||||||
native
|
native
|
||||||
fun getContext() : Context = Context();
|
fun getContext() : Context = Context();
|
||||||
|
//native
|
||||||
native
|
//fun random() : Double = 0.0
|
||||||
fun random() : Double = 0.0
|
|
||||||
|
|
||||||
native
|
native
|
||||||
fun getCanvasWidth() : Double = 0.0
|
fun getCanvasWidth() : Double = 0.0
|
||||||
native
|
native
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ public abstract class Config {
|
|||||||
PATH_TO_JS_LIB_SRC + "\\core\\javautil.kt",
|
PATH_TO_JS_LIB_SRC + "\\core\\javautil.kt",
|
||||||
PATH_TO_JS_LIB_SRC + "\\core\\javalang.kt",
|
PATH_TO_JS_LIB_SRC + "\\core\\javalang.kt",
|
||||||
PATH_TO_JS_LIB_SRC + "\\core\\core.kt",
|
PATH_TO_JS_LIB_SRC + "\\core\\core.kt",
|
||||||
PATH_TO_JS_LIB_SRC + "\\raphael\\raphael.kt",
|
PATH_TO_JS_LIB_SRC + "\\core\\math.kt",
|
||||||
PATH_TO_JS_LIB_SRC + "\\core\\json.kt",
|
PATH_TO_JS_LIB_SRC + "\\core\\json.kt",
|
||||||
|
PATH_TO_JS_LIB_SRC + "\\raphael\\raphael.kt",
|
||||||
PATH_TO_JS_LIB_SRC + "\\html5\\core.kt"
|
PATH_TO_JS_LIB_SRC + "\\html5\\core.kt"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user