diff --git a/packages/graphics/traits/visible.trait.js b/packages/graphics/traits/visible.trait.js index e2a6771..e81734c 100644 --- a/packages/graphics/traits/visible.trait.js +++ b/packages/graphics/traits/visible.trait.js @@ -74,9 +74,9 @@ export class Visible extends decorate(Trait) { } acceptPacket(packet) { - if (packet instanceof TraitUpdatedVisiblePacket) { + if (packet instanceof TraitUpdateVisiblePacket) { this.entity.isVisible = packet.data.isVisible; - this.entity.opacity = packet.data.opacity / 255; + this.entity.opacity = packet.data.opacity; } } @@ -93,7 +93,7 @@ export class Visible extends decorate(Trait) { } } - packetsForUpdate() { + packets(informed) { const {isVisible, opacity} = this.stateDifferences(); if (isVisible || opacity) { return new TraitUpdateVisiblePacket(this.state);