Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GUI code. #35

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
2df50f9
feat: ui transform
cptbtptpbcptdtptp Jun 12, 2024
cf0643d
feat: update code
cptbtptpbcptdtptp Jun 17, 2024
22582e1
feat: merge code
cptbtptpbcptdtptp Jun 20, 2024
cdecbc5
feat: udpae code
cptbtptpbcptdtptp Jun 20, 2024
d3599b2
feat: update code
cptbtptpbcptdtptp Jun 20, 2024
9ed8451
feat: merge transform and uitransform
cptbtptpbcptdtptp Jun 26, 2024
ed65e2a
fix: merge code
cptbtptpbcptdtptp Aug 28, 2024
a04790f
fix: merge code
cptbtptpbcptdtptp Aug 28, 2024
ef86b49
feat: update code
cptbtptpbcptdtptp Aug 29, 2024
9a883be
Merge remote-tracking branch 'ck/feature/ui-init' into feature/ui-init
cptbtptpbcptdtptp Aug 30, 2024
0866129
feat: update ui input
cptbtptpbcptdtptp Sep 9, 2024
ff4bdb1
feat: update code
cptbtptpbcptdtptp Sep 19, 2024
75e4c83
feat: ui pointer event
cptbtptpbcptdtptp Sep 25, 2024
e87b7cd
feat: udpate code
cptbtptpbcptdtptp Oct 7, 2024
cc001f1
feat: merge code
cptbtptpbcptdtptp Oct 7, 2024
eea964a
feat: update code
cptbtptpbcptdtptp Oct 10, 2024
05f11da
feat: udpate code
cptbtptpbcptdtptp Oct 10, 2024
6c6be60
feat: udpate code
cptbtptpbcptdtptp Oct 10, 2024
c6cbdee
feat: update code
cptbtptpbcptdtptp Oct 10, 2024
8e70ce9
feat: update code
cptbtptpbcptdtptp Oct 10, 2024
c12b295
feat: update code
cptbtptpbcptdtptp Oct 11, 2024
9d90de5
feat: update code
cptbtptpbcptdtptp Oct 12, 2024
7abc773
feat: update code
cptbtptpbcptdtptp Oct 12, 2024
5c3c47d
feat: update code
cptbtptpbcptdtptp Oct 14, 2024
7f77234
feat: update code
cptbtptpbcptdtptp Oct 14, 2024
48f735c
feat: update code
cptbtptpbcptdtptp Oct 17, 2024
7aa2657
feat: update code
cptbtptpbcptdtptp Oct 20, 2024
0e36499
feat: update code
cptbtptpbcptdtptp Oct 21, 2024
f2158fc
feat: update code
cptbtptpbcptdtptp Oct 22, 2024
685e450
feat: update code
cptbtptpbcptdtptp Oct 22, 2024
45deb33
feat: update code
cptbtptpbcptdtptp Oct 22, 2024
fcb0994
feat: update code
cptbtptpbcptdtptp Oct 22, 2024
b30b2ee
feat: update code
cptbtptpbcptdtptp Oct 22, 2024
85a15fe
feat: merge code
cptbtptpbcptdtptp Oct 23, 2024
af4135d
feat: update code
cptbtptpbcptdtptp Oct 24, 2024
b61b9e7
feat: update code
cptbtptpbcptdtptp Oct 24, 2024
bb145d4
feat: update localbounds
cptbtptpbcptdtptp Oct 24, 2024
74de716
feat: update code
cptbtptpbcptdtptp Oct 27, 2024
49cc82a
feat: merge code
cptbtptpbcptdtptp Oct 27, 2024
c808352
feat: merge code
cptbtptpbcptdtptp Oct 27, 2024
c3c5568
feat: update code
cptbtptpbcptdtptp Oct 29, 2024
b154e57
feat: update ui code
cptbtptpbcptdtptp Nov 1, 2024
951b1a0
feat: udpate code
cptbtptpbcptdtptp Nov 4, 2024
4d930f2
feat: add button
cptbtptpbcptdtptp Nov 5, 2024
72be260
feat: add button
cptbtptpbcptdtptp Nov 5, 2024
c60fa0a
feat: update code
cptbtptpbcptdtptp Nov 5, 2024
f7ffd30
feat: update code
cptbtptpbcptdtptp Nov 5, 2024
7f25dc3
feat: update code
cptbtptpbcptdtptp Nov 6, 2024
c37bee4
feat: merge code
cptbtptpbcptdtptp Nov 6, 2024
a7249b3
feat: update code
cptbtptpbcptdtptp Nov 7, 2024
396656c
feat: update code
cptbtptpbcptdtptp Nov 7, 2024
5fea91f
feat: update code
cptbtptpbcptdtptp Nov 7, 2024
4e66663
feat: update code
cptbtptpbcptdtptp Nov 7, 2024
48d783d
feat: update code
cptbtptpbcptdtptp Nov 7, 2024
3b90739
feat: update code
cptbtptpbcptdtptp Nov 13, 2024
c0cf05a
feat: update code
cptbtptpbcptdtptp Nov 13, 2024
e68d510
feat: update code
cptbtptpbcptdtptp Nov 14, 2024
b385900
feat: update code
cptbtptpbcptdtptp Nov 18, 2024
7ba272c
feat: update code
cptbtptpbcptdtptp Nov 18, 2024
a09efd5
fix: lint error
cptbtptpbcptdtptp Nov 20, 2024
0a0155d
fix: lint error
cptbtptpbcptdtptp Nov 20, 2024
e12ff0b
fix: lint error
cptbtptpbcptdtptp Nov 20, 2024
3bd87bd
fix: lint error
cptbtptpbcptdtptp Nov 20, 2024
2860723
fix: lint error
cptbtptpbcptdtptp Nov 20, 2024
1eab47c
fix: lint error
cptbtptpbcptdtptp Nov 20, 2024
a7b232e
Merge remote-tracking branch 'ck/feature/ui-init' into feature/ui-init
cptbtptpbcptdtptp Dec 4, 2024
7bc504a
fix: udpate ui transform init
cptbtptpbcptdtptp Dec 5, 2024
dea19ce
Merge remote-tracking branch 'ck/feature/ui-init' into feature/ui-init
cptbtptpbcptdtptp Dec 6, 2024
8b8dab9
Merge branch 'feature/ui-init' of https://github.com/singlecoder/engi…
cptbtptpbcptdtptp Dec 12, 2024
0b3218d
feat: update code
cptbtptpbcptdtptp Dec 12, 2024
eb28c10
feat: update code
cptbtptpbcptdtptp Dec 13, 2024
7407f3e
feat: update code
cptbtptpbcptdtptp Dec 16, 2024
59782d3
feat: udpate code
cptbtptpbcptdtptp Dec 16, 2024
9f71641
feat: udpate code
cptbtptpbcptdtptp Dec 16, 2024
4d6b453
feat: update code
cptbtptpbcptdtptp Dec 16, 2024
d552ee8
feat: update code
cptbtptpbcptdtptp Dec 17, 2024
ae510a2
feat: merge code
cptbtptpbcptdtptp Dec 17, 2024
432c465
Merge remote-tracking branch 'ck/feature/ui-init' into feature/ui-init
cptbtptpbcptdtptp Dec 17, 2024
8ece555
feat: update code
cptbtptpbcptdtptp Dec 18, 2024
1eb88b5
feat: merge code
cptbtptpbcptdtptp Dec 18, 2024
1caa84d
feat: udpate code
cptbtptpbcptdtptp Dec 18, 2024
8527942
feat: update code
cptbtptpbcptdtptp Dec 19, 2024
4d3ae40
feat: update code
cptbtptpbcptdtptp Dec 23, 2024
7fb40e8
fix: merge code
cptbtptpbcptdtptp Dec 23, 2024
29446a9
feat: merge code
cptbtptpbcptdtptp Dec 24, 2024
6570a06
feat: merge code
cptbtptpbcptdtptp Dec 24, 2024
25e165d
feat: udpate code
cptbtptpbcptdtptp Dec 24, 2024
9254641
feat: udpate code
cptbtptpbcptdtptp Dec 24, 2024
1556d94
Merge remote-tracking branch 'ck/feature/ui-init' into feature/ui-init
cptbtptpbcptdtptp Dec 24, 2024
73662a9
feat: udpate code
cptbtptpbcptdtptp Dec 25, 2024
f85da64
feat: udpate code
cptbtptpbcptdtptp Dec 25, 2024
fcc7813
Merge remote-tracking branch 'ck/feature/ui-init' into feature/ui-init
cptbtptpbcptdtptp Dec 25, 2024
7137967
Merge remote-tracking branch 'ck/feature/ui-init' into feature/ui-init
cptbtptpbcptdtptp Dec 30, 2024
a31cd4e
feat: udpate code
cptbtptpbcptdtptp Dec 30, 2024
d4ce2dd
Merge remote-tracking branch 'ck/feature/ui-init' into feature/ui-init
cptbtptpbcptdtptp Dec 31, 2024
1ee2cc4
feat: udpate code
cptbtptpbcptdtptp Dec 31, 2024
026b219
feat: udpate code
cptbtptpbcptdtptp Dec 31, 2024
1719b32
feat: udpate code
cptbtptpbcptdtptp Dec 31, 2024
9de9ea5
Merge remote-tracking branch 'ck/feature/ui-init' into feature/ui-init
cptbtptpbcptdtptp Dec 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions packages/core/src/Transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,41 @@ export class Transform extends Component {
private static _tempMat42: Matrix = new Matrix();

@deepClone
protected _position: Vector3 = new Vector3();
private _position: Vector3 = new Vector3();
@deepClone
protected _rotation: Vector3 = new Vector3();
private _rotation: Vector3 = new Vector3();
@deepClone
protected _rotationQuaternion: Quaternion = new Quaternion();
private _rotationQuaternion: Quaternion = new Quaternion();
@deepClone
protected _scale: Vector3 = new Vector3(1, 1, 1);
private _scale: Vector3 = new Vector3(1, 1, 1);
@assignmentClone
protected _localUniformScaling: boolean = true;
private _localUniformScaling: boolean = true;
@deepClone
protected _worldPosition: Vector3 = new Vector3();
private _worldPosition: Vector3 = new Vector3();
@deepClone
protected _worldRotation: Vector3 = new Vector3();
private _worldRotation: Vector3 = new Vector3();
@deepClone
protected _worldRotationQuaternion: Quaternion = new Quaternion();
private _worldRotationQuaternion: Quaternion = new Quaternion();
@assignmentClone
protected _worldUniformScaling: boolean = true;
private _worldUniformScaling: boolean = true;
@deepClone
protected _lossyWorldScale: Vector3 = new Vector3(1, 1, 1);
private _lossyWorldScale: Vector3 = new Vector3(1, 1, 1);
@deepClone
protected _localMatrix: Matrix = new Matrix();
private _localMatrix: Matrix = new Matrix();
@deepClone
protected _worldMatrix: Matrix = new Matrix();
private _worldMatrix: Matrix = new Matrix();
@ignoreClone
protected _worldForward: Vector3 = null;
private _worldForward: Vector3 = null;
@ignoreClone
protected _worldRight: Vector3 = null;
private _worldRight: Vector3 = null;
@ignoreClone
protected _worldUp: Vector3 = null;
private _worldUp: Vector3 = null;

@ignoreClone
protected _isParentDirty: boolean = true;
private _isParentDirty: boolean = true;
@ignoreClone
protected _parentTransformCache: Transform = null;
protected _dirtyFlag: number = TransformModifyFlags.WmWpWeWqWs;
private _parentTransformCache: Transform = null;
private _dirtyFlag: number = TransformModifyFlags.WmWpWeWqWs;

/**
* Local position.
Expand Down
30 changes: 15 additions & 15 deletions packages/ui/src/component/UICanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export class UICanvas extends Component implements IElement {
return this._referenceResolution;
}

set referenceResolution(val: Vector2) {
set referenceResolution(value: Vector2) {
const referenceResolution = this._referenceResolution;
if (referenceResolution === val) return;
(referenceResolution.x !== val.x || referenceResolution.y !== val.y) && referenceResolution.copyFrom(val);
if (referenceResolution === value) return;
(referenceResolution.x !== value.x || referenceResolution.y !== value.y) && referenceResolution.copyFrom(value);
}

/**
Expand All @@ -120,10 +120,10 @@ export class UICanvas extends Component implements IElement {
return this._renderCamera;
}

set renderCamera(val: Camera) {
set renderCamera(value: Camera) {
const preCamera = this._renderCamera;
if (preCamera !== val) {
this._renderCamera = val;
if (preCamera !== value) {
this._renderCamera = value;
this._updateCameraObserver();
this._setRealRenderMode(this._getRealRenderMode());
}
Expand All @@ -136,9 +136,9 @@ export class UICanvas extends Component implements IElement {
return this._resolutionAdaptationStrategy;
}

set resolutionAdaptationStrategy(val: ResolutionAdaptationStrategy) {
if (this._resolutionAdaptationStrategy !== val) {
this._resolutionAdaptationStrategy = val;
set resolutionAdaptationStrategy(value: ResolutionAdaptationStrategy) {
if (this._resolutionAdaptationStrategy !== value) {
this._resolutionAdaptationStrategy = value;
const realRenderMode = this._realRenderMode;
if (
realRenderMode === CanvasRenderMode.ScreenSpaceCamera ||
Expand All @@ -156,9 +156,9 @@ export class UICanvas extends Component implements IElement {
return this._sortOrder;
}

set sortOrder(val: number) {
if (this._sortOrder !== val) {
this._sortOrder = val;
set sortOrder(value: number) {
if (this._sortOrder !== value) {
this._sortOrder = value;
this._realRenderMode === CanvasRenderMode.ScreenSpaceOverlay &&
// @ts-ignore
(this.scene._componentsManager._overlayCanvasesSortingFlag = true);
Expand All @@ -172,9 +172,9 @@ export class UICanvas extends Component implements IElement {
return this._distance;
}

set distance(val: number) {
if (this._distance !== val) {
this._distance = val;
set distance(value: number) {
if (this._distance !== value) {
this._distance = value;
if (this._realRenderMode === CanvasRenderMode.ScreenSpaceCamera) {
this._adapterPoseInScreenSpace();
this._adapterSizeInScreenSpace();
Expand Down
20 changes: 10 additions & 10 deletions packages/ui/src/component/UIGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export class UIGroup extends Component implements IGroupAble {
return this._ignoreParentGroup;
}

set ignoreParentGroup(val: boolean) {
if (this._ignoreParentGroup !== val) {
this._ignoreParentGroup = val;
set ignoreParentGroup(value: boolean) {
if (this._ignoreParentGroup !== value) {
this._ignoreParentGroup = value;
this._onGroupModify(GroupModifyFlags.All);
}
}
Expand All @@ -64,9 +64,9 @@ export class UIGroup extends Component implements IGroupAble {
return this._interactive;
}

set interactive(val: boolean) {
if (this._interactive !== val) {
this._interactive = val;
set interactive(value: boolean) {
if (this._interactive !== value) {
this._interactive = value;
this._onGroupModify(GroupModifyFlags.GlobalInteractive);
}
}
Expand All @@ -75,10 +75,10 @@ export class UIGroup extends Component implements IGroupAble {
return this._alpha;
}

set alpha(val: number) {
val = Math.max(0, Math.min(val, 1));
if (this._alpha !== val) {
this._alpha = val;
set alpha(value: number) {
value = Math.max(0, Math.min(value, 1));
if (this._alpha !== value) {
this._alpha = value;
this._onGroupModify(GroupModifyFlags.GlobalAlpha);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/component/UIRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export class UIRenderer extends Renderer implements IGraphics {
return this._raycastEnable;
}

set raycastEnable(val: boolean) {
this._raycastEnable = val;
set raycastEnable(value: boolean) {
this._raycastEnable = value;
}

/**
Expand Down
12 changes: 6 additions & 6 deletions packages/ui/src/component/UITransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export class UITransform extends Transform {
return this._size;
}

set size(val: Vector2) {
set size(value: Vector2) {
const { _size: size } = this;
if (size === val) return;
(size.x !== val.x || size.y !== val.y) && size.copyFrom(val);
if (size === value) return;
(size.x !== value.x || size.y !== value.y) && size.copyFrom(value);
}

/**
Expand All @@ -29,10 +29,10 @@ export class UITransform extends Transform {
return this._pivot;
}

set pivot(val: Vector2) {
set pivot(value: Vector2) {
const { _pivot: pivot } = this;
if (pivot === val) return;
(pivot.x !== val.x || pivot.y !== val.y) && pivot.copyFrom(val);
if (pivot === value) return;
(pivot.x !== value.x || pivot.y !== value.y) && pivot.copyFrom(value);
}

/**
Expand Down
Loading