MCPcopy Create free account
hub / github.com/esengine/esengine / setup_beforeAdd

Method setup_beforeAdd

packages/fairygui/src/widgets/GLoader.ts:687–740  ·  view source on GitHub ↗
(buffer: ByteBuffer, beginPos: number)

Source from the content-addressed store, hash-verified

685 }
686
687 public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {
688 super.setup_beforeAdd(buffer, beginPos);
689
690 buffer.seek(beginPos, 5);
691
692 this._url = buffer.readS();
693
694 const alignValue = buffer.readByte();
695 this._align =
696 alignValue === 0 ? EAlignType.Left : alignValue === 1 ? EAlignType.Center : EAlignType.Right;
697
698 const valignValue = buffer.readByte();
699 this._valign =
700 valignValue === 0 ? EVertAlignType.Top : valignValue === 1 ? EVertAlignType.Middle : EVertAlignType.Bottom;
701
702 this._fill = buffer.readByte();
703 this._shrinkOnly = buffer.readBool();
704 this._autoSize = buffer.readBool();
705 this._showErrorSign = buffer.readBool();
706
707 const playingValue = buffer.readBool();
708 const frameValue = buffer.getInt32();
709 if (this._content) {
710 this._content.playing = playingValue;
711 this._content.frame = frameValue;
712 }
713
714 if (buffer.readBool()) {
715 this.color = buffer.readS();
716 }
717
718 const fillMethodValue = buffer.readByte();
719 if (this._content) {
720 this._content.fillMethod = fillMethodValue;
721 if (this._content.fillMethod !== EFillMethod.None) {
722 this._content.fillOrigin = buffer.readByte();
723 this._content.fillClockwise = buffer.readBool();
724 this._content.fillAmount = buffer.getFloat32();
725 }
726 } else if (fillMethodValue !== EFillMethod.None) {
727 // Skip bytes if _content not ready
728 buffer.readByte(); // fillOrigin
729 buffer.readBool(); // fillClockwise
730 buffer.getFloat32(); // fillAmount
731 }
732
733 if (buffer.version >= 7) {
734 this._useResize = buffer.readBool();
735 }
736
737 if (this._url) {
738 this.loadContent();
739 }
740 }
741}

Callers

nothing calls this directly

Calls 7

loadContentMethod · 0.95
readSMethod · 0.80
readByteMethod · 0.80
readBoolMethod · 0.80
getInt32Method · 0.80
getFloat32Method · 0.80
seekMethod · 0.65

Tested by

no test coverage detected