查看: 2440|回复: 0

[已经解决] bitmap的颜色混入问题

[复制链接]
梦石
0
星屑
50
在线时间
1281 小时
注册时间
2006-8-27
回帖
550
发表于 2016-4-8 05:38:38 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 wbsy8241 于 2016-4-8 15:11 编辑

[pre lang="javascript" file="Blendtest"]var Ccc = Ccc || {};

Ccc.Sprite_Enemy_initMembers = Sprite_Enemy.prototype.initMembers
Sprite_Enemy.prototype.initMembers = function() {
    Ccc.Sprite_Enemy_initMembers.call(this);
    this.createShadowSprite();
};

Sprite_Enemy.prototype.createShadowSprite = function() {
    this._shadowSprite = new Sprite();
    this._shadowSprite.anchor.x = 0.5;//ox
    this._shadowSprite.anchor.y = 1;//oy
    this._shadowSprite.y = 0;
    this.addChild(this._shadowSprite);
};

Sprite_Enemy.prototype.refresh = function() {
    this._shadowSprite.bitmap = new Bitmap(this.bitmap.width, this.bitmap.height);
    this._shadowSprite.bitmap.blt(this.bitmap,0,0,this.bitmap.width,this.bitmap.height,-10,0,this.bitmap.width,this.bitmap.height);
    this._shadowSprite.bitmap.blt(this.bitmap,0,0,this.bitmap.width,this.bitmap.height,10,0,this.bitmap.width,this.bitmap.height);
    this._shadowSprite.bitmap.blt(this.bitmap,0,0,this.bitmap.width,this.bitmap.height,0,-10,this.bitmap.width,this.bitmap.height);
    this._shadowSprite.bitmap.blt(this.bitmap,0,0,this.bitmap.width,this.bitmap.height,0,10,this.bitmap.width,this.bitmap.height);
    this._shadowSprite.setBlendColor([0, 255, 255, 0]);
};

Sprite_Enemy.prototype.update = function() {
    Sprite_Battler.prototype.update.call(this);
    if (this._enemy) {
        this.updateEffect();
        this.updateStateSprite();
        if (this.bitmap.width > 0) {
            this.refresh();
        }
    }
};[/pre]

==》 this._shadowSprite.setBlendColor([0, 255, 255, 0]);

请问我混入颜色 透明度是0的时候图片还是在的
但是选1-255 整个图片就消失了 这是为什么?


回:refresh 执行一次就可以正常显示 真实奇怪的设定
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部