> For the complete documentation index, see [llms.txt](https://tanishisherewith.gitbook.io/dynamic-hud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tanishisherewith.gitbook.io/dynamic-hud/integrating-dynamichud/passing-abstractmoveablescreen-instance.md).

# Passing AbstractMoveableScreen instance

DynamicHUD integration necessitates a key object. The mod must return an [AbstractMoveableScreen](/dynamic-hud/screens/abstractmoveablescreen.md), which will display the widgets and record user inputs.

{% hint style="info" %}
Since the AbstractMoveableScreen is well, abstract, you can extend the class, add your own features, and still pass it to DynamicHudIntegration.
{% endhint %}

```java
public class MyIntegration implements DynamicHudIntegration{
    TextWidget exampleWidget;
    WidgetRenderer renderer;
    
    @Override
    public void init() {
       //Previously added and initialised text widget
    }

    @Override
    public void addWidgets() {
       //Previously added and initialised text widget
    }
  
    public void initAfter() {
       //Previously initialised WidgetRenderer object
    }

    @Override
    public WidgetRenderer getWidgetRenderer() {
        return renderer;
    }
    
    @Override
    public AbstractMoveableScreen getMovableScreen() {
        return new AbstractMoveableScreen(Text.literal("MyText"), renderer) {
        };
    }
}
```

{% hint style="danger" %}
The AbstractMoveableScreen instance returned should never be null.
{% endhint %}

{% content-ref url="/spaces/DVOerbBYig9gngF4saif/pages/D0kDLjf2hZE7VTVvCcUQ" %}
[AbstractMoveableScreen](/dynamic-hud/screens/abstractmoveablescreen.md)
{% endcontent-ref %}
