@@ -29,29 +29,28 @@ if(!tc){ var tc = {}; }
29
29
( function ( tc ) {
30
30
31
31
32
- ( function ( ) {
33
- var lastTime = 0 ;
34
- var vendors = [ 'ms' , 'moz' , 'webkit' , 'o' ] ;
35
- for ( var x = 0 ; x < vendors . length && ! window . requestAnimationFrame ; ++ x ) {
36
- window . requestAnimationFrame = window [ vendors [ x ] + 'RequestAnimationFrame' ] ;
37
- window . cancelAnimationFrame =
38
- window [ vendors [ x ] + 'CancelAnimationFrame' ] || window [ vendors [ x ] + 'CancelRequestAnimationFrame' ] ;
39
- }
40
-
41
- if ( ! window . requestAnimationFrame )
42
- window . requestAnimationFrame = function ( callback , element ) {
43
- var currTime = new Date ( ) . getTime ( ) ;
44
- var timeToCall = Math . max ( 0 , 16 - ( currTime - lastTime ) ) ;
45
- var id = window . setTimeout ( function ( ) { callback ( currTime + timeToCall ) ; } ,
46
- timeToCall ) ;
47
- lastTime = currTime + timeToCall ;
48
- return id ;
49
- } ;
50
-
51
- if ( ! window . cancelAnimationFrame )
52
- window . cancelAnimationFrame = function ( id ) {
53
- clearTimeout ( id ) ;
54
- } ;
32
+ ( function requestAnimationFrame ( ) {
33
+ var lastTime = 0 ;
34
+ var vendors = [ 'ms' , 'moz' , 'webkit' , 'o' ] ;
35
+ for ( var x = 0 ; x < vendors . length && ! window . requestAnimationFrame ; ++ x ) {
36
+ window . requestAnimationFrame = window [ vendors [ x ] + 'RequestAnimationFrame' ] ;
37
+ window . cancelAnimationFrame =
38
+ window [ vendors [ x ] + 'CancelAnimationFrame' ] || window [ vendors [ x ] + 'CancelRequestAnimationFrame' ] ;
39
+ }
40
+
41
+ if ( ! window . requestAnimationFrame )
42
+ window . requestAnimationFrame = function ( callback , element ) {
43
+ var currTime = new Date ( ) . getTime ( ) ;
44
+ var timeToCall = Math . max ( 0 , 16 - ( currTime - lastTime ) ) ;
45
+ var id = window . setTimeout ( function ( ) { callback ( currTime + timeToCall ) ; } , timeToCall ) ;
46
+ lastTime = currTime + timeToCall ;
47
+ return id ;
48
+ } ;
49
+
50
+ if ( ! window . cancelAnimationFrame )
51
+ window . cancelAnimationFrame = function ( id ) {
52
+ clearTimeout ( id ) ;
53
+ } ;
55
54
} ( ) ) ;
56
55
57
56
if ( ! tc . particle ) { tc . particle = { } ; }
@@ -77,7 +76,6 @@ if(!tc){ var tc = {}; }
77
76
_me . particles = [ ] ;
78
77
_me . frame = 0 ;
79
78
_me . stopped = true ;
80
- _me . paused = false ;
81
79
_me . timer = null ;
82
80
_me . mouse_pos = null ;
83
81
_me . mouse_down_pos = null ;
@@ -153,12 +151,7 @@ if(!tc){ var tc = {}; }
153
151
154
152
}
155
153
156
- _me . isPaused = function ( ) {
157
- return _paused ;
158
- }
159
-
160
154
_me . start = function ( ) {
161
- _me . paused = false ;
162
155
_me . mouse_pos = null ;
163
156
_me . mouse_down_pos = null ;
164
157
if ( _me . stopped ) {
@@ -167,15 +160,11 @@ if(!tc){ var tc = {}; }
167
160
}
168
161
}
169
162
170
- _me . pause = function ( ) {
171
- _me . paused = true ;
172
- }
173
-
174
163
_me . stop = function ( ) {
175
164
_me . stopped = true ;
176
165
}
177
166
178
- function _draw ( ) {
167
+ function _draw ( drawing_context ) {
179
168
var opacity , i , alpha ;
180
169
181
170
_me . context . globalAlpha = 1.0 ;
@@ -205,10 +194,15 @@ if(!tc){ var tc = {}; }
205
194
206
195
_me . context . globalAlpha = alpha ;
207
196
197
+ _me . context . fillStyle = '#000000' ;
208
198
for ( i = 0 ; i < _me . particles . length ; i ++ ) {
209
199
_me . particles [ i ] . draw ( _me . context ) ;
210
200
}
211
201
}
202
+
203
+ function _render ( ) {
204
+
205
+ }
212
206
213
207
return this . initialize ( ) ;
214
208
}
0 commit comments