# Functions (/ink/functions)



<Callout type="warning">
  It is preferable to use <DynamicLink href="/ink/hashtag">hashtag commands</DynamicLink> to add custom functionality to your game, instead of defining custom functions. Hashtag commands are more flexible and integrate better with the game engine.
</Callout>

The ***ink* + Pixi’VN integration*&#x2A; allows the use of custom functions, but unlike &#x2A;**native ink***, these functions are defined in JavaScript and not in *ink*.

In fact, if you define a function in *ink*, it will be ignored by Pixi’VN. For example, the following function will have no effect:

```ink title="ink"
=== function myfunction(x) === // ❌ This will be ignored  [!code warning]
~ return x * 2 // ❌ This will be ignored  [!code warning]
```

However, you can use the functions defined in <DynamicLink href="/start/labels#steplabelprops">`StepLabelProps`</DynamicLink>.

**Warning**: It is important to note that functions used in *ink* cannot have optional parameters.

<CodeBlockTabs defaultValue="ink/start.ink">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="ink/start.ink">
      ink/start.ink
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pixi-vn.d.ts">
      pixi-vn.d.ts
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="ink/start.ink">
    ```ink
    === start ===
    Navigate to main menu screen
    ~ navigate("/") // [!code focus]
    -> DONE
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pixi-vn.d.ts">
    ```ts
    import { narration } from '@drincs/pixi-vn'

    declare module '@drincs/pixi-vn' {
        interface StepLabelProps {
            navigate: (route: string) => void,
        }
    }
    ```
  </CodeBlockTab>
</CodeBlockTabs>
