MCPcopy
hub / github.com/4ian/GDevelop / update

Method update

Extensions/3D/JsExtension.js:3605–3636  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3603 }
3604
3605 update() {
3606 const width = this.getWidth();
3607 const height = this.getHeight();
3608 const centerPoint = this.getCenterPoint();
3609 const centerX = width * centerPoint[0];
3610 const centerY = height * centerPoint[1];
3611
3612 const minX = 0 - centerX;
3613 const minY = 0 - centerY;
3614 const maxX = width - centerX;
3615 const maxY = height - centerY;
3616 this._pixiObject.clear();
3617 this._pixiObject.beginFill(0x0033ff);
3618 this._pixiObject.lineStyle(1, 0xffd900, 1);
3619 this._pixiObject.moveTo(minX, minY);
3620 this._pixiObject.lineTo(maxX, minY);
3621 this._pixiObject.lineTo(maxX, maxY);
3622 this._pixiObject.lineTo(minX, maxY);
3623 this._pixiObject.endFill();
3624
3625 this._pixiObject.moveTo(minX, minY);
3626 this._pixiObject.lineTo(maxX, maxY);
3627 this._pixiObject.moveTo(maxX, minY);
3628 this._pixiObject.lineTo(minX, maxY);
3629
3630 const originPoint = this.getOriginPoint();
3631 this._pixiObject.position.x =
3632 this._instance.getX() - width * (originPoint[0] - centerPoint[0]);
3633 this._pixiObject.position.y =
3634 this._instance.getY() - height * (originPoint[1] - centerPoint[1]);
3635 this._pixiObject.angle = this._instance.getAngle();
3636 }
3637
3638 getDefaultWidth() {
3639 return this._defaultWidth;

Callers

nothing calls this directly

Calls 13

getCenterPointMethod · 0.95
getOriginPointMethod · 0.95
beginFillMethod · 0.80
lineStyleMethod · 0.80
endFillMethod · 0.80
getWidthMethod · 0.65
getHeightMethod · 0.65
clearMethod · 0.65
moveToMethod · 0.45
lineToMethod · 0.45
getXMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected