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

Method setup_beforeAdd

packages/fairygui/src/widgets/GTextField.ts:415–458  ·  view source on GitHub ↗
(buffer: ByteBuffer, beginPos: number)

Source from the content-addressed store, hash-verified

413 }
414
415 public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {
416 super.setup_beforeAdd(buffer, beginPos);
417
418 buffer.seek(beginPos, 5);
419
420 this.font = buffer.readS();
421 this.fontSize = buffer.getInt16();
422 this.color = buffer.readColorS();
423 const alignValue = buffer.readByte();
424 this.align =
425 alignValue === 0
426 ? EAlignType.Left
427 : alignValue === 1
428 ? EAlignType.Center
429 : EAlignType.Right;
430 const valignValue = buffer.readByte();
431 this.valign =
432 valignValue === 0
433 ? EVertAlignType.Top
434 : valignValue === 1
435 ? EVertAlignType.Middle
436 : EVertAlignType.Bottom;
437 this.leading = buffer.getInt16();
438 this.letterSpacing = buffer.getInt16();
439 this.ubbEnabled = buffer.readBool();
440 this.autoSize = buffer.readByte();
441 this.underline = buffer.readBool();
442 this.italic = buffer.readBool();
443 this.bold = buffer.readBool();
444 this.singleLine = buffer.readBool();
445 if (buffer.readBool()) {
446 this.strokeColor = buffer.readColorS();
447 this.stroke = buffer.getFloat32() + 1;
448 }
449
450 if (buffer.readBool()) {
451 // Shadow - skip for now
452 buffer.skip(12);
453 }
454
455 if (buffer.readBool()) {
456 this._textField.templateVars = {};
457 }
458 }
459
460 public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {
461 super.setup_afterAdd(buffer, beginPos);

Callers

nothing calls this directly

Calls 8

readSMethod · 0.80
getInt16Method · 0.80
readColorSMethod · 0.80
readByteMethod · 0.80
readBoolMethod · 0.80
getFloat32Method · 0.80
skipMethod · 0.80
seekMethod · 0.65

Tested by

no test coverage detected