> For the complete documentation index, see [llms.txt](https://wiki.redmodding.org/scripting-cyberpunk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.redmodding.org/scripting-cyberpunk/scripting/game-systems/ui-scripting.md).

# UI Scripting

Interacting with UI with scripting

## Summary

**Published**: Mar 31 2024 by [mana vortex](mailto:undefined)\
**Last documented update**: Aug 25 2026 by [nolvalir](mailto:undefined)

This section will show you how to interact with the game's UI with scripting.

### Wait, this is not what I want!

* For help on [Logging Widget Trees](/scripting-cyberpunk/scripting/game-systems/ui-scripting/logging-widget-trees.md), check the corresponding wiki page!
* You can find guides on how to add custom UI elements in [InkWidgets Basics](/scripting-cyberpunk/scripting/game-systems/ui-scripting/inkwidgets-basics.md) or [Codeware's github wiki](https://github.com/psiberx/cp2077-codeware/wiki#layers-and-windows).

## General Information

All different kinds of UI are loaded at the same time. Components don't get added or removed, but are simply rendered inactive (hidden).

At any point in time, by hooking into the right methods or classes, you're able to fully add, modify, or delete any UI element you see on screen (barring the visibility for some, for example the game may force a specific element to be visible, but hiding their parent or grandparent may work).

Additionally, the game has template UIs such as messages or prompts that you can use for your mod, which you see how here: [User Interface](/scripting-cyberpunk/scripting/snippets-and-examples/user-interface.md)

## Ink Inspector

If you're going to mod this game, (please) download [RedHotTools](https://github.com/psiberx/cp2077-red-hot-tools) as it gives you various useful toolkits for modding in general, but notably Ink Inspector which is **invaluable** for messing with UI elements.

In the CET overlay, Ink Inspector gives you a menu to inspect all rendered UI elements on screen in addition to their properties, context, and other important information. Additionally it also has a "Pick" mode where you can move your cursor to an element so you don't have to manually traverse the tree.

Either using the "Pick" option or manually by searching, selecting an ink widget will cause Ink Inspector to show the respective properties and other important information for that widget.

{% hint style="info" %}
For more documentation about RedHotTools and the various tools it provides, look here: [RedHotTools](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/modding-tools/redhottools)
{% endhint %}

### Widget Tab

The widget tab shows information regarding the respective properties of that widget.

For example, if you were to select a `inkTextWidget`, it would show information such as the `text`, `fontSize`, and `fontStyle` for the widget. If instead you were to select a `inkCanvasWidget`, it would show properties for containers such as `childMargin`.

By default, other information that is respective to all widgets such as margins and anchor points are also visible here.

### Context Tab

The context tab shows meta-information regarding the widget, such as what [`.inkWidget`](/scripting-cyberpunk/scripting/game-systems/ui-scripting/.inkwidget-files.md) file the widget spawned from in addition to the full name and index path to the selected widget.

### Example

As an example, here's how it would like when finding the ink widget that contains the minimap.

Ink Inspector gives you a lot of important information, such as what layer it's in and the full name path to get a reference to the selected element (which you can directly use when accessing widgets with [`inkCompoundWidget#GetWidgetByPathName`](https://nativedb.red4ext.com/inkCompoundWidget#GetWidgetByPathName), as long as the path is unique along each step).

<figure><img src="https://1927068511-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffwsaoju1TBAUvMpI6NIw%2Fuploads%2FOQ7ULmQ0jspHPwznrlta%2Fimage.png?alt=media&amp;token=7e8f3df6-0749-4bfe-b11c-ac744ad892e3" alt=""><figcaption></figcaption></figure>

## Ink Layers (as of 2.12\_a)

The game separates different UI contexts into different layers:

| Layer name (as CName)         | Class                            |                                                                                                                        |
| ----------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `inkHUDLayer`                 | `gameuiRootHudGameController`    | the generic hud                                                                                                        |
| `inkWatermarksLayer`          |                                  |                                                                                                                        |
| `inkWaitingSignLayer`         |                                  |                                                                                                                        |
| `inkSystemNotificationsLayer` |                                  |                                                                                                                        |
| `inkLoadingLayer`             |                                  |                                                                                                                        |
| `inkGameNotificationsLayer`   | `gameuiPopupsManager`            |                                                                                                                        |
| `inkMenuLayer`                | `gameuiInGameMenuGameController` | the container for menus, such as the escape menu, main menu, and all sub menus of the main menu (map, inventory, etc). |
| `inkVideoLayer`               | `gameuiHUDVideoPlayerController` |                                                                                                                        |
| `inkWorldLayer`               |                                  |                                                                                                                        |
| `inkOffscreenLayer`           |                                  |                                                                                                                        |
| `inkAdvertisementsLayer`      |                                  |                                                                                                                        |
| `inkStreetSignsLayer`         |                                  |                                                                                                                        |
| `inkPhotoModeLayer`           | `gameuiWidgetGameController`     | photo mode HUD                                                                                                         |

### Accessing Ink Layers

If you have [Codeware](/scripting-cyberpunk/introduction/tools-and-frameworks/codeware.md) installed, at any point in your mod (assuming game systems are available),  you're able to [get a reference to the game's ink system on demand](/scripting-cyberpunk/scripting/game-systems/ui-scripting/guide-to-ui-basics/ui-basics-part-1-accessing-ink-widgets.md#accessing-widgets-on-demand) with `GameInstance.GetInkSystem()`, allowing you to get a reference to any spawned widget.

## More UI Documentation

{% content-ref url="/pages/zip39N2azOyeCDEYWKwd" %}
[.inkWidget Files](/scripting-cyberpunk/scripting/game-systems/ui-scripting/.inkwidget-files.md)
{% endcontent-ref %}

{% content-ref url="/pages/USf8NtCuSGPBcnhjWTgZ" %}
[Ink Widgets](/scripting-cyberpunk/scripting/game-systems/ui-scripting/ink-widgets.md)
{% endcontent-ref %}

{% content-ref url="/pages/d3ZOTam5MpBigGim7Pzw" %}
[Ink Controllers](/scripting-cyberpunk/scripting/game-systems/ui-scripting/ink-controllers.md)
{% endcontent-ref %}

{% content-ref url="/pages/2Z71ISvhO7lZuQHDkQtB" %}
[Logging Widget Trees](/scripting-cyberpunk/scripting/game-systems/ui-scripting/logging-widget-trees.md)
{% endcontent-ref %}

{% content-ref url="/pages/8HZpa670YYJddbrS6BEe" %}
[InkWidgets Basics](/scripting-cyberpunk/scripting/game-systems/ui-scripting/inkwidgets-basics.md)
{% endcontent-ref %}

## Guides

{% content-ref url="/pages/XThP8A2cvCI8pqqua4h6" %}
[Guide to UI Basics](/scripting-cyberpunk/scripting/game-systems/ui-scripting/guide-to-ui-basics.md)
{% endcontent-ref %}

## More Snippets & Examples For UI

{% content-ref url="/pages/jiubywOIA5CuLwNiITjO" %}
[User Interface](/scripting-cyberpunk/scripting/snippets-and-examples/user-interface.md)
{% endcontent-ref %}
