dcl-ui-toolkit
Version:
A collection of UI helpers to make it easier to build a Decentraland scene using the SDK 7.
40 lines (39 loc) • 1.45 kB
TypeScript
import ReactEcs from '@dcl/sdk/react-ecs';
import { EntityPropTypes } from '@dcl/react-ecs/dist/components/types';
import { UIObject, UIObjectConfig } from '../UIObject';
import { ImageAtlasData } from '../../utils/imageUtils';
export type IconImageElement = Omit<EntityPropTypes, 'uiTransform' | 'uiBackground'> & {
uiTransform?: Omit<NonNullable<EntityPropTypes['uiTransform']>, 'display' | 'position' | 'width' | 'height'>;
uiBackground?: Omit<NonNullable<EntityPropTypes['uiBackground']>, 'texture' | 'uvs'>;
};
export type IconConfig = UIObjectConfig & {
image: string;
width?: number;
height?: number;
xOffset?: number;
yOffset?: number;
section?: ImageAtlasData;
};
export type IconInitialConfig = {
initial?: Omit<Required<IconConfig>, 'section'>;
};
export declare class Icon extends UIObject {
imageElement: IconImageElement;
image: string;
width: number;
height: number;
xOffset: number;
yOffset: number;
section: ImageAtlasData | undefined;
constructor({ section, initial, startHidden, image, width, height, xOffset, yOffset, }: IconConfig & IconInitialConfig);
render(key?: string): ReactEcs.JSX.Element;
}
export declare class SmallIcon extends Icon {
constructor(config: IconConfig);
}
export declare class MediumIcon extends Icon {
constructor(config: IconConfig);
}
export declare class LargeIcon extends Icon {
constructor(config: IconConfig);
}