narraleaf-react
Version:
A React visual novel player framework
34 lines (33 loc) • 1.45 kB
TypeScript
import { CommonDisplayableConfig } from "../types";
import { LogicAction } from "../action/logicAction";
import { TransformDefinitions } from "../elements/transform/type";
import { Displayable } from "../elements/displayable/displayable";
import { EventfulDisplayable } from "../../player/elements/displayable/type";
import { Image } from "../elements/displayable/image";
import { Text } from "../elements/displayable/text";
import { Chained, Proxied } from "../action/chain";
export interface ILayerUserConfig extends CommonDisplayableConfig {
/**
* The z-index of the layer, higher z-index will be rendered on top of the lower z-index, allows negative values.
*
* **Note**: the default background layer has a z-index of -1, and the default displayable layer has a z-index of 0.
*/
zIndex: number;
}
export declare class Layer extends Displayable<LayerDataRaw, Layer, TransformDefinitions.ImageTransformProps> implements EventfulDisplayable {
constructor(name?: string, config?: Partial<ILayerUserConfig>);
/**
* Include displayables in the layer.
*
* Same as {@link Displayable.useLayer}
*/
include(elements: (Image | Text)[] | Image | Text): this;
/**
* Set the z-index of the layer
*
* @chainable
* @param zIndex - The z-index of the layer
* @returns The layer itself
*/
setZIndex(zIndex: number): Proxied<Layer, Chained<LogicAction.Actions>>;
}