Skip to content

Commit

Permalink
fixed : alpha get from context
Browse files Browse the repository at this point in the history
  • Loading branch information
lirongf committed Sep 30, 2024
1 parent 009fdfb commit d2d82fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/layaAir/laya/spine/Spine2DRenderNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ export class Spine2DRenderNode extends BaseRenderNode2D implements ISpineSkeleto
this._spriteShaderData.setBuffer(SpineShaderInit.NMatrix, buffer);
Vector2.TempVector2.setValue(context.width, context.height);
this._spriteShaderData.setVector2(SpineShaderInit.Size, Vector2.TempVector2);

if (this._oldAlpha !== (this.owner as Sprite).alpha) {
context.globalAlpha
if (this._oldAlpha !== context.globalAlpha) {
let scolor = this.spineItem.getSpineColor();
let a = scolor.a * (this.owner as Sprite).alpha;
let a = scolor.a * context.globalAlpha;
let color = new Color(scolor.r , scolor.g , scolor.b , a);
this._spriteShaderData.setColor(SpineShaderInit.Color, color);
this._oldAlpha = (this.owner as Sprite).alpha;
this._oldAlpha = context.globalAlpha;
}
context._copyClipInfoToShaderData(this._spriteShaderData);
}
Expand Down

0 comments on commit d2d82fe

Please sign in to comment.