# Component aliases (/start/canvas-alias)





Each component added into the canvas must be assigned an `alias`. An `alias` is a way to refer to a component by a unique string.

<Accordions>
  <Accordion title="What does `alias` correspond to in PixiJS?" id="what-is-an-alias">
    The `alias` corresponds to `PixiJSComponent.label`, so do not change the `label`, but use the <DynamicLink href="/start/canvas-functions">methods provided by Pixi’VN</DynamicLink> to change the `alias`.
  </Accordion>
</Accordions>

If a component is added by assigning an existing `alias`, the new component will replace the old one.

## Heredity factor [#heredity-factor]

If a component is added using an existing `alias`, the new component, in addition to replacing the old one, will inherit the properties, the `zIndex`, and the <DynamicLink href="/start/canvas-tickers">tickers</DynamicLink> of the old component.

<HeredityFactorExample />

## Edit [#edit]

To edit the `alias` of a canvas component, you can use [`canvas.editAlias`](/jsdoc/pixi-vn/index/interfaces/CanvasManagerInterface#editalias). If the alias has one or more <DynamicLink href="/start/canvas-tickers">tickers</DynamicLink> associated, it will be automatically updated in the ticker.

```ts
import { canvas } from "@drincs/pixi-vn";

canvas.editAlias("sprite1", "sprite2");
```

## Other features [#other-features]

<Accordions>
  <Accordion title="Game layer alias" id="game-layer-alias">
    In Pixi’VN, the game layer is a special component that represents the main game area where all the game elements are rendered.

    This component has been assigned a special `alias`, [`CANVAS_APP_GAME_LAYER_ALIAS`](/jsdoc/pixi-vn/index/variables/CANVAS_APP_GAME_LAYER_ALIAS), which is used to reference the game layer in the script.

    This is very useful if you want to run some <DynamicLink href="/start/canvas-animations-effects">animations or effects</DynamicLink> on the entire layer. Some features are not allowed on this item, such as deletion.

    ```ts
    import { CANVAS_APP_GAME_LAYER_ALIAS, shakeEffect } from "@drincs/pixi-vn";

    shakeEffect(CANVAS_APP_GAME_LAYER_ALIAS);
    ```
  </Accordion>
</Accordions>
