Show text overlay for ImagePresentationComponent

With the new ImagePresentationComponent in visionOS 26, how can text/overlays be shown on top of the image as seen in the Spatial Gallery app?

Answered by Vision Pro Engineer in 845911022

Hi @davespatialmatters,

You can overlay UI on the entity with the ImagePresentationComponent by using the ViewAttachmentComponent. There is a new initializer that helps you add SwiftUI View as a component to an entity without using the RealityViewAttachments.

The presentationScreenSize API gives you the size of the image and you can use it to place the UI relative to the image.

You will need to use the ModelSortGroupComponent to render the UI above the image.

To achieve the feathered glass background effect you can use the feathered property of the GlassBackgroundEffect protocol. 
 Let me know if you have any further questions. Happy to help !

Accepted Answer

Hi @davespatialmatters,

You can overlay UI on the entity with the ImagePresentationComponent by using the ViewAttachmentComponent. There is a new initializer that helps you add SwiftUI View as a component to an entity without using the RealityViewAttachments.

The presentationScreenSize API gives you the size of the image and you can use it to place the UI relative to the image.

You will need to use the ModelSortGroupComponent to render the UI above the image.

To achieve the feathered glass background effect you can use the feathered property of the GlassBackgroundEffect protocol. 
 Let me know if you have any further questions. Happy to help !

Thank you very much! I am loving all of the updates for spatial photo presentation in visionOS 26!

Show text overlay for ImagePresentationComponent
 
 
Q