Skip to content

Commit d62024e

Browse files
authored
fix: support AvatarTexture in UIImage component (#122)
1 parent 5134267 commit d62024e

File tree

6 files changed

+37
-14
lines changed

6 files changed

+37
-14
lines changed

packages/@dcl/legacy-ecs/src/decentraland/UIShapes.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { Color4 } from '@dcl/ecs-math'
2-
32
import {
43
ObservableComponent,
54
DisposableComponent,
65
getComponentId
76
} from '../ecs/Component'
8-
import { CLASS_ID, OnUUIDEvent, Texture, Font } from './Components'
7+
import {
8+
CLASS_ID,
9+
OnUUIDEvent,
10+
Texture,
11+
AvatarTexture,
12+
Font
13+
} from './Components'
914
import { OnTextSubmit, OnBlur, OnChanged, OnClick, OnFocus } from './UIEvents'
1015
/**
1116
* @public
@@ -386,7 +391,7 @@ export class UIImage extends UIShape {
386391
sourceHeight: number = 1
387392

388393
@ObservableComponent.component
389-
source?: Texture
394+
source?: Texture | AvatarTexture
390395

391396
@ObservableComponent.field
392397
paddingTop: number = 0
@@ -406,7 +411,7 @@ export class UIImage extends UIShape {
406411
@OnUUIDEvent.uuidEvent
407412
onClick: OnClick | null = null
408413

409-
constructor(parent: UIShape, source: Texture) {
414+
constructor(parent: UIShape, source: Texture | AvatarTexture) {
410415
super(parent)
411416
this.source = source
412417
}

packages/decentraland-ecs/types/dcl/decentraland-ecs.api.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44487,6 +44487,15 @@
4448744487
"text": "Texture",
4448844488
"canonicalReference": "@dcl/legacy-ecs!Texture:class"
4448944489
},
44490+
{
44491+
"kind": "Content",
44492+
"text": " | "
44493+
},
44494+
{
44495+
"kind": "Reference",
44496+
"text": "AvatarTexture",
44497+
"canonicalReference": "@dcl/legacy-ecs!AvatarTexture:class"
44498+
},
4449044499
{
4449144500
"kind": "Content",
4449244501
"text": ");"
@@ -44506,7 +44515,7 @@
4450644515
"parameterName": "source",
4450744516
"parameterTypeTokenRange": {
4450844517
"startIndex": 3,
44509-
"endIndex": 4
44518+
"endIndex": 6
4451044519
}
4451144520
}
4451244521
]
@@ -44692,6 +44701,15 @@
4469244701
"text": "Texture",
4469344702
"canonicalReference": "@dcl/legacy-ecs!Texture:class"
4469444703
},
44704+
{
44705+
"kind": "Content",
44706+
"text": " | "
44707+
},
44708+
{
44709+
"kind": "Reference",
44710+
"text": "AvatarTexture",
44711+
"canonicalReference": "@dcl/legacy-ecs!AvatarTexture:class"
44712+
},
4469544713
{
4469644714
"kind": "Content",
4469744715
"text": ";"
@@ -44702,7 +44720,7 @@
4470244720
"name": "source",
4470344721
"propertyTypeTokenRange": {
4470444722
"startIndex": 1,
44705-
"endIndex": 2
44723+
"endIndex": 4
4470644724
},
4470744725
"isStatic": false
4470844726
},

packages/decentraland-ecs/types/dcl/decentraland-ecs.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,7 +2174,7 @@ export class UIContainerStack extends UIShape {
21742174

21752175
// @public (undocumented)
21762176
export class UIImage extends UIShape {
2177-
constructor(parent: UIShape, source: Texture);
2177+
constructor(parent: UIShape, source: Texture | AvatarTexture);
21782178
// (undocumented)
21792179
onClick: OnClick | null;
21802180
// (undocumented)
@@ -2188,7 +2188,7 @@ export class UIImage extends UIShape {
21882188
// (undocumented)
21892189
sizeInPixels: boolean;
21902190
// (undocumented)
2191-
source?: Texture;
2191+
source?: Texture | AvatarTexture;
21922192
// (undocumented)
21932193
sourceHeight: number;
21942194
// (undocumented)

packages/decentraland-ecs/types/dcl/index-beta.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4754,14 +4754,14 @@ export declare class UIImage extends UIShape {
47544754
sourceTop: number;
47554755
sourceWidth: number;
47564756
sourceHeight: number;
4757-
source?: Texture;
4757+
source?: Texture | AvatarTexture;
47584758
paddingTop: number;
47594759
paddingRight: number;
47604760
paddingBottom: number;
47614761
paddingLeft: number;
47624762
sizeInPixels: boolean;
47634763
onClick: OnClick | null;
4764-
constructor(parent: UIShape, source: Texture);
4764+
constructor(parent: UIShape, source: Texture | AvatarTexture);
47654765
}
47664766

47674767
/**

packages/decentraland-ecs/types/dcl/index-full.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4768,14 +4768,14 @@ export declare class UIImage extends UIShape {
47684768
sourceTop: number;
47694769
sourceWidth: number;
47704770
sourceHeight: number;
4771-
source?: Texture;
4771+
source?: Texture | AvatarTexture;
47724772
paddingTop: number;
47734773
paddingRight: number;
47744774
paddingBottom: number;
47754775
paddingLeft: number;
47764776
sizeInPixels: boolean;
47774777
onClick: OnClick | null;
4778-
constructor(parent: UIShape, source: Texture);
4778+
constructor(parent: UIShape, source: Texture | AvatarTexture);
47794779
}
47804780

47814781
/**

packages/decentraland-ecs/types/dcl/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4754,14 +4754,14 @@ declare class UIImage extends UIShape {
47544754
sourceTop: number;
47554755
sourceWidth: number;
47564756
sourceHeight: number;
4757-
source?: Texture;
4757+
source?: Texture | AvatarTexture;
47584758
paddingTop: number;
47594759
paddingRight: number;
47604760
paddingBottom: number;
47614761
paddingLeft: number;
47624762
sizeInPixels: boolean;
47634763
onClick: OnClick | null;
4764-
constructor(parent: UIShape, source: Texture);
4764+
constructor(parent: UIShape, source: Texture | AvatarTexture);
47654765
}
47664766

47674767
/**

0 commit comments

Comments
 (0)