# Controlling the main window from a Multi Window

{% stepper %}
{% step %}

## :page\_facing\_up: Requirements

To have a basic understanding on how this plugin gets used

* you followed step **2:** [**Installing This Plugin**](https://kibibyte.gitbook.io/multi-window-extension/installing-this-plugin)
* you followed step 3: [**Enabling This Plugin**](https://kibibyte.gitbook.io/multi-window-extension/enabling-this-plugin)
* you followed step 4: [**Working With The Subystem**](https://kibibyte.gitbook.io/multi-window-extension/working-with-the-subsystem)
  {% endstep %}

{% step %}

## :heavy\_plus\_sign: Creating the widget

1. Locate your content browser (If not visible, press CTRL+Spacebar) and create a widget blueprint. Then select “User Widget”. After that, open the widget blueprint by double-clicking on it.

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2F7BnZJ8tdBvE0Bz0XFdr2%2FAufzeichnung-2024-09-09-173851.gif?alt=media&#x26;token=343cc9f8-190b-40bb-95cd-e867f9c9d5a8" alt=""><figcaption></figcaption></figure>

2. In the widget, add a canvas panel and a button. Then select the button.

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2Fl7imbjA3Ykj9yKkC20nI%2FAufzeichnung-2024-09-09-174727_3gif.gif?alt=media&#x26;token=aa22f4ce-674b-4d91-9057-38ba539ed59a" alt=""><figcaption></figcaption></figure>

3. Make the button expand the whole canvas panel by setting the anchors and tweaking these values. You can also make the button invisible by setting the background opacity to 0. Then create an event whenever we click a button.

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2F73xZKYJrb2XJxthygZRh%2FAufzeichnung-2024-09-09-174812.gif?alt=media&#x26;token=8ffc9e0d-225c-40ec-a174-1f774cb26e76" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## :computer: Creating the window

1. In pretty much any blueprint you like (I used the level blueprint) you need to create a new multi window and input the widget we just created. You can feel free to change the settings of the multi window.
   {% endstep %}

{% step %}

## :heavy\_plus\_sign: Creating the blueprint

1. Then locate your content browser again and create an actor blueprint

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2FE83IhZWv53zQxu7vYX50%2FAufzeichnung-2024-09-09-181753.gif?alt=media&#x26;token=ace34cc0-d225-4661-901b-bf4943f03961" alt=""><figcaption></figcaption></figure>

2. In the actor, we will add a cube which we will later rotate based on the mouse input of the user

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2F9V586DYYJWzuOTDHbVoh%2FAufzeichnung-2024-09-09-181832.gif?alt=media&#x26;token=4eeb0760-c4ae-4491-ac72-d6dff7ada491" alt=""><figcaption></figcaption></figure>

3. Drag the actor into your level

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2FGU5bBB8yZXSxA0LgfRlX%2FAufzeichnung-2024-09-09-181912.gif?alt=media&#x26;token=ba60c97c-57e0-4833-86a2-6125f9d8ca53" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## :heavy\_plus\_sign: Adding the functionality in the widget

1. Flip Flop a bool on button click

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2FFgHfF2NUud7IB2j3Bqt3%2Fimage.png?alt=media&#x26;token=cde43648-c509-4ef1-a5d6-e7553d609ccd" alt=""><figcaption></figcaption></figure>

2. On Event Tick you want to check if the rotation is active and get the mouse position on the platform. Then on Do Once, save the position of the mouse.

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2FiG6TujTzUlzojv2OO4bb%2Fimage.png?alt=media&#x26;token=9ea09f86-4b66-44d2-a8a0-f20be9dcd53e" alt=""><figcaption></figcaption></figure>

4. Then get a reference to your blueprint. You could call any function of the blueprint from here but I will just add world rotation. Then make sure to set the last position variable again.

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2FD1AKTNmomFl1QvFYYUeE%2Fimage.png?alt=media&#x26;token=8e36b552-b31c-4981-9838-6b5c0f6a784c" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

## :fire: Final Result

<figure><img src="https://3004307226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6enYcHpHQYBydrytzoC1%2Fuploads%2FcNu99KNO6sAMve0h2zGO%2FAufzeichnung-2024-09-09-184539.gif?alt=media&#x26;token=e8139140-5613-4275-bf08-fa55326a38b3" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

## :pray: Final Words

Are you enjoying this plugin? Then don’t forget to [leave a review to support the creator!](https://www.fab.com/listings/c979e063-985b-4ea5-9fbb-bef1340b6a1c?tab=reviews)
{% endstep %}
{% endstepper %}
