-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGLPixiLayerElements.ts
More file actions
73 lines (54 loc) · 1.71 KB
/
GLPixiLayerElements.ts
File metadata and controls
73 lines (54 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/// <reference path="GLPixiLayer.ts"/>
module GLPixLayerElement {
export class GLElement extends PIXI.Sprite {
// lat / lon position of the element
public lon: number;
public lat: number;
public properties: Object;
public timeline: gsap.TimelineLite;
public associatedScale: Object;
}
// GLElement with an associated state (for animation)
/**
* an animated gl element is an extension of a glelement
containing a state object
*/
export class AnimatedGLElement extends GLElement {
public _state: State;
public setState(state: State): void {
this._state = state;
}
public getState(): State {
return this._state;
}
public hasState(): boolean {
return this._state != null;
}
public setPosition(x: number, y: number): void {
this.x = x;
this.y = y;
}
public layer: any; // can't make a typed reference
// original width and hight of the image (permit to handle the scale)
public originalWidth: number;
public originalHeight: number;
public linkAttribute: string;
}
// abstract base class for state handling
export class State {
// the associated animated element
_context: AnimatedGLElement;
constructor(context: AnimatedGLElement) {
this._context = context;
};
public onOver(): void { };
public onOut(): void { };
public onClick(): void { };
public onReplaceElementOnContainer(newx: number, newy: number): void { };
public onChanged(): void { };
// touch
public onTouchStart(): void { };
public onTouchEnd(): void { };
public onTouchEndOutside(): void { };
}
}