@@ -33,39 +33,48 @@ export interface PosComp extends Comp {
33
33
moveTo ( dest : Vec2 , speed ?: number ) : void ;
34
34
moveTo ( x : number , y : number , speed ?: number ) : void ;
35
35
/**
36
- * Get the position of the object on the screen.
36
+ * Get / Set the position of the object on the screen.
37
+ *
38
+ * @since v2000.0
37
39
*/
38
- screenPos ( ) : Vec2 | null ;
40
+ screenPos ( newPos ?: Vec2 ) : Vec2 | null ;
39
41
/**
40
- * Get the position of the object relative to the root.
42
+ * Get / Set the position of the object relative to the root.
43
+ *
44
+ * @since v2000.0
41
45
*/
42
- worldPos ( ) : Vec2 | null ;
46
+ worldPos ( newPos ?: Vec2 ) : Vec2 | null ;
43
47
/**
44
48
* Transform a local point (relative to this) to a screen point (relative to the camera)
45
49
*/
46
50
toScreen ( this : GameObj < PosComp | FixedComp > , p : Vec2 ) : Vec2 ;
47
51
/**
48
52
* Transform a local point (relative to this) to a world point (relative to the root)
53
+ *
49
54
* @since v3001.0
50
55
*/
51
56
toWorld ( this : GameObj < PosComp > , p : Vec2 ) : Vec2 ;
52
57
/**
53
58
* Transform a screen point (relative to the camera) to a local point (relative to this)
59
+ *
54
60
* @since v3001.0
55
61
*/
56
62
fromScreen ( this : GameObj < PosComp | FixedComp > , p : Vec2 ) : Vec2 ;
57
63
/**
58
64
* Transform a world point (relative to the root) to a local point (relative to this)
65
+ *
59
66
* @since v3001.0
60
67
*/
61
68
fromWorld ( this : GameObj < PosComp > , p : Vec2 ) : Vec2 ;
62
69
/**
63
70
* Transform a point relative to this to a point relative to other
71
+ *
64
72
* @since v3001.0
65
73
*/
66
74
toOther ( this : GameObj < PosComp > , other : GameObj < PosComp > , p : Vec2 ) : Vec2 ;
67
75
/**
68
76
* Transform a point relative to other to a point relative to this
77
+ *
69
78
* @since v3001.0
70
79
*/
71
80
fromOther ( this : GameObj < PosComp > , other : GameObj < PosComp > , p : Vec2 ) : Vec2 ;
0 commit comments