-
Notifications
You must be signed in to change notification settings - Fork 57
Scene UI component
All images can be opened with the orinal size by RMB -> "Open image in new tab"
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.
To add UI into the scene you should make few steps:
- Create blueprint of actor with static mesh component
- Create master material with Texture2D parameter
- Add Scene UI component and set reference to master material
- On Begin Play event create material instance, set the UI texture as a parameter and apply to the mesh
- Place the blueprint into the scene and launch the game
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.
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:
- Function
ActorHasWebUI()
returns only first StaticMesh component found in target actor. Multiple meshes or skeletal meshes are not supported.