Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Scene UI component

Vladimir Alyamkin edited this page Jul 9, 2014 · 15 revisions

All images can be opened with the orinal size by RMB -> "Open image in new tab"

Overview

Scene UI component is designed to be placed on scene as it was done in Doom 3. For example, you can use it to create ingame computer terminal, TV or even magical door look - it's the best place to use Scene UI.

To add the component to the blueprint select Va Quole Scene UI in the components list.

Check JavaScript API article to know how to interact with Scene UI component to setup any gameplay events you want.

Scene UI setup

To add UI into the scene you should make few steps:

  1. Create blueprint of actor with static mesh component
  2. Create master material with Texture2D parameter
  3. Add Scene UI component and set reference to master material
  4. On Begin Play event create material instance, set the UI texture as a parameter and apply to the mesh
  5. Place the blueprint into the scene and launch the game

Player input

Scene UI doesn't receive player input by default. To enable it you should call RegisterInput() function once you want to start receiving input by this component.

It's important to unregister component once it lost the player focus and no input required anymore.

Mouse position won't be grabbed by Scene UI component itself - it should be set externally with FHitResult parameter that defines desired mouse world position. Then it will be projected to the surface and transformed to the local widget XY coordinates.

Key idea of this approach is to make the mouse position input flexible and customizable. You can control the widget by camera view (classical approach for shooters), mouse screen position (default for RTS) or even projectile shooting - you just need to determine intersection point with FHitResult value.

Check the classic shooter "camera aim" controls example below.

Surface mapping

VaQuoleUI supports not only flat surfaces - you can use any curved surface that uses Planar or Cylindrical mapping. To handle mouse input properly set the corresponding value for SurfaceMapping variable in Scene UI component defaults.

Mesh axes align is very important! X must be a forward vector:

Limitations

  • Function ActorHasWebUI() returns only first StaticMesh component found in target actor. Multiple meshes or skeletal meshes are not supported.
Clone this wiki locally