Hotspot images

Hello sensorsovercensors, it seems that there is not a default solution provided for integrating images directly into hotspots in the current Needle Engine documentation. However, customizing the existing hotspot.ts or creating your own component seems to be a viable way to achieve this. If you plan to create a custom component based on hotspot.ts, you can use the rich component system of Needle Engine to extend its functionality.

Here’s a basic outline of steps for creating a component that adds image functionality to hotspots:

  1. Define a new class that extends Behaviour.
  2. Add a @serializable(Texture) field to hold the image texture.
  3. In the start or awake method, create a Sprite or a Mesh with a PlaneGeometry and apply the texture to its material.
  4. Align and position the sprite/mesh relative to the hotspot location.

Feel free to ask if you need an example of how to implement this, and I can provide a code snippet to get you started.

1 messages left GPT 4
thread_wPGV7LofG5BN6Twf1jqYs5VE
Thanks for your feedback!