Já viram qual a arte dessa semana?Exposição dos Artistas #8
0 Respostas   106 Visualizações
0 Membros e 1 Visitante estão vendo este tópico.
//-----------------------------------------------------------------------------// Sprite Transition//-----------------------------------------------------------------------------function Sprite_Trans() { this.initialize.apply(this, arguments);}Sprite_Trans.prototype = Object.create(Sprite_Base.prototype);Sprite_Trans.prototype.constructor = Sprite_Trans;Sprite_Trans.prototype.initialize = function(x, y, bitmapType, url, color) { Sprite_Base.prototype.initialize.call(this); this.x = x; this.y = y; this.rect_Clear = new Rectangle(0, 0, Graphics.width, Graphics.height); this.start_clear = false; // switch(bitmapType){ case 'fillAll': this.fill_All_Color(color); break; case 'bitmap': this.fill_All_Bitmap(url); break; };}; Sprite_Trans.prototype.update = function() { Sprite_Base.prototype.update.call(this); this.clearBuff_Update();}; Sprite_Trans.prototype.fill_All_Bitmap = function(url) { this.bitmap = ImageManager.loadCardSystem(url); this.bitmap_clone = ImageManager.loadCardSystem(url);}; Sprite_Trans.prototype.fill_All_Color = function(color) { this.bitmap = new Bitmap(816, 624); this.bitmap.fillAll(color); this.bitmap_clone = new Bitmap(816, 624); this.bitmap_clone.fillAll(color);}; Sprite_Trans.prototype.clearBuff = function(){ this.start_clear = true;};Sprite_Trans.prototype.clearBuff_Update = function(){ if(this.start_clear){ if(this.rect_Clear.width > -16){ this.bitmap.blt(this.bitmap_clone, 0, 0, this.bitmap_clone.width, this.bitmap_clone.height, 0, 0); this.bitmap.clearRect(this.rect_Clear.x, this.rect_Clear.y, this.rect_Clear.width, this.rect_Clear.height); this.rect_Clear.x += 8; this.rect_Clear.y += 6; this.rect_Clear.width -= 16; this.rect_Clear.height -= 12; }else{ this.start_clear = false; }; };};
Sprite_Trans.prototype.clearBuff_Update = function(){ if(this.start_clear){ if(this.rect_Clear.width > -16){ //this.bitmap.clear(); this.bitmap = new Bitmap(816, 624); this.bitmap.blt(this.bitmap_clone, 0, 0, this.bitmap_clone.width, this.bitmap_clone.height, 0, 0); if(this.bitmap.isReady()){ this.bitmap.clearRect(this.rect_Clear.x, this.rect_Clear.y, this.rect_Clear.width, this.rect_Clear.height); this.rect_Clear.x += 8; this.rect_Clear.y += 6; this.rect_Clear.width -= 16; this.rect_Clear.height -= 12; }; }else{ this.start_clear = false; }; };};