# Canvas 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.

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

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.

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 canvas component alias [#edit-canvas-component-alias]

To edit the alias of a canvas component, you can use `canvas.editAlias`. If the alias has one or more <DynamicLink href="/start/canvas-tickers">tickers</DynamicLink> associated, it will be automatically updated in the ticker.

The `editAlias` method has the following parameters:

* `oldAlias`: The old alias of the component to edit.
* `newAlias`: The new alias of the component.

```typescript
import { canvas } from '@drincs/pixi-vn'

canvas.editAlias('sprite1', 'sprite2')
```

Game layer alias [#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, `const CANVAS_APP_GAME_LAYER_ALIAS = "__game_layer__"`, 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.

```typescript
import { CANVAS_APP_GAME_LAYER_ALIAS, shakeEffect } from '@drincs/pixi-vn'

shakeEffect(CANVAS_APP_GAME_LAYER_ALIAS)
```
