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

Method setup_beforeAdd

packages/fairygui/src/core/GObject.ts:965–1044  ·  view source on GitHub ↗

* Setup before adding to parent * 添加到父容器之前的设置

(buffer: ByteBuffer, beginPos: number)

Source from the content-addressed store, hash-verified

963 * 添加到父容器之前的设置
964 */
965 public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {
966 buffer.seek(beginPos, 0);
967 buffer.skip(5); // skip type, src, pkgId
968
969 this._id = buffer.readS() || this._id;
970 this._name = buffer.readS() || '';
971
972 let f1: number;
973 let f2: number;
974
975 f1 = buffer.getInt32();
976 f2 = buffer.getInt32();
977 this.setXY(f1, f2);
978
979 if (buffer.readBool()) {
980 this.initWidth = buffer.getInt32();
981 this.initHeight = buffer.getInt32();
982 this.setSize(this.initWidth, this.initHeight, true);
983 }
984
985 if (buffer.readBool()) {
986 this.minWidth = buffer.getInt32();
987 this.maxWidth = buffer.getInt32();
988 this.minHeight = buffer.getInt32();
989 this.maxHeight = buffer.getInt32();
990 }
991
992 if (buffer.readBool()) {
993 f1 = buffer.getFloat32();
994 f2 = buffer.getFloat32();
995 this.setScale(f1, f2);
996 }
997
998 if (buffer.readBool()) {
999 f1 = buffer.getFloat32();
1000 f2 = buffer.getFloat32();
1001 this.setSkew(f1, f2);
1002 }
1003
1004 if (buffer.readBool()) {
1005 f1 = buffer.getFloat32();
1006 f2 = buffer.getFloat32();
1007 this.setPivot(f1, f2, buffer.readBool());
1008 }
1009
1010 f1 = buffer.getFloat32();
1011 if (f1 !== 1) {
1012 this.alpha = f1;
1013 }
1014
1015 f1 = buffer.getFloat32();
1016 if (f1 !== 0) {
1017 this.rotation = f1;
1018 }
1019
1020 if (!buffer.readBool()) {
1021 this.visible = false;
1022 }

Callers 1

Calls 12

setXYMethod · 0.95
setSizeMethod · 0.95
setScaleMethod · 0.95
setSkewMethod · 0.95
setPivotMethod · 0.95
skipMethod · 0.80
readSMethod · 0.80
getInt32Method · 0.80
readBoolMethod · 0.80
getFloat32Method · 0.80
readByteMethod · 0.80
seekMethod · 0.65

Tested by

no test coverage detected