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

Method constructExtension

packages/fairygui/src/widgets/GSlider.ts:201–231  ·  view source on GitHub ↗
(buffer: ByteBuffer)

Source from the content-addressed store, hash-verified

199 }
200
201 protected constructExtension(buffer: ByteBuffer): void {
202 buffer.seek(0, 6);
203
204 this._titleType = buffer.readByte();
205 this._reverse = buffer.readBool();
206 if (buffer.version >= 2) {
207 this._wholeNumbers = buffer.readBool();
208 this.changeOnClick = buffer.readBool();
209 }
210
211 this._titleObject = this.getChild('title');
212 this._barObjectH = this.getChild('bar');
213 this._barObjectV = this.getChild('bar_v');
214 this._gripObject = this.getChild('grip');
215
216 if (this._barObjectH) {
217 this._barMaxWidth = this._barObjectH.width;
218 this._barMaxWidthDelta = this.width - this._barMaxWidth;
219 this._barStartX = this._barObjectH.x;
220 }
221 if (this._barObjectV) {
222 this._barMaxHeight = this._barObjectV.height;
223 this._barMaxHeightDelta = this.height - this._barMaxHeight;
224 this._barStartY = this._barObjectV.y;
225 }
226 if (this._gripObject) {
227 this._gripObject.on(FGUIEvents.TOUCH_BEGIN, this.handleGripTouchBegin, this);
228 }
229
230 this.on(FGUIEvents.TOUCH_BEGIN, this.handleBarTouchBegin, this);
231 }
232
233 protected handleSizeChanged(): void {
234 super.handleSizeChanged();

Callers

nothing calls this directly

Calls 5

readByteMethod · 0.80
readBoolMethod · 0.80
seekMethod · 0.65
getChildMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected