@@ -16,10 +16,11 @@ import {
16
16
VIEWPORT_ONRESIZE ,
17
17
} from "../system/event.ts" ;
18
18
import { boundsPool } from "./../physics/bounds.ts" ;
19
+ import { colorPool } from "../math/color.ts" ;
19
20
20
21
/**
21
22
* @import {Bounds} from "./../physics/bounds.ts";
22
- * @import Color from "./../math/color.js ";
23
+ * @import { Color} from "./../math/color.ts ";
23
24
* @import Entity from "./../renderable/entity/entity.js";
24
25
* @import Sprite from "./../renderable/sprite.js";
25
26
* @import NineSliceSprite from "./../renderable/nineslicesprite.js";
@@ -519,7 +520,7 @@ export default class Camera2d extends Renderable {
519
520
* });
520
521
*/
521
522
fadeOut ( color , duration = 1000 , onComplete ) {
522
- this . _fadeOut . color = pool . pull ( "Color" ) . copy ( color ) ;
523
+ this . _fadeOut . color = colorPool . get ( ) . copy ( color ) ;
523
524
this . _fadeOut . tween = pool
524
525
. pull ( "Tween" , this . _fadeOut . color )
525
526
. to ( { alpha : 0.0 } , { duration } )
@@ -539,7 +540,7 @@ export default class Camera2d extends Renderable {
539
540
* me.game.viewport.fadeIn("#FFFFFF", 75);
540
541
*/
541
542
fadeIn ( color , duration = 1000 , onComplete ) {
542
- this . _fadeIn . color = pool . pull ( "Color" ) . copy ( color ) ;
543
+ this . _fadeIn . color = colorPool . get ( ) . copy ( color ) ;
543
544
const _alpha = this . _fadeIn . color . alpha ;
544
545
this . _fadeIn . color . alpha = 0.0 ;
545
546
this . _fadeIn . tween = pool
@@ -629,7 +630,7 @@ export default class Camera2d extends Renderable {
629
630
// remove the tween if over
630
631
if ( this . _fadeIn . color . alpha === 1.0 ) {
631
632
this . _fadeIn . tween = null ;
632
- pool . push ( this . _fadeIn . color ) ;
633
+ colorPool . release ( this . _fadeIn . color ) ;
633
634
this . _fadeIn . color = null ;
634
635
}
635
636
}
@@ -646,7 +647,7 @@ export default class Camera2d extends Renderable {
646
647
// remove the tween if over
647
648
if ( this . _fadeOut . color . alpha === 0.0 ) {
648
649
this . _fadeOut . tween = null ;
649
- pool . push ( this . _fadeOut . color ) ;
650
+ colorPool . release ( this . _fadeOut . color ) ;
650
651
this . _fadeOut . color = null ;
651
652
}
652
653
}
0 commit comments