A themed set of notifications
Updated
A script themes every notification once, with colours, a font and a party icon for successes; a connection error overrides the theme for itself.
Press Lose connection to show a themed error notification.
A themed set of notifications
#pragma lifecycle(startup)
// Scene: nothing to prepare. Run this before other scripts show notifications// (give it a lower execution index).function startup() { NotificationService.theme({ screenScale: 0.9, width: 380, backgroundColor: '#0f172a', borderColor: '#334155', borderRadius: 16, titleColor: '#f8fafc', contentColor: '#cbd5e1', fontFamily: 'nunito', types: { success: { icon: 'PartyPopper', color: '#22c55e' } }, });
on('quest/complete', (data) => { NotificationService.show(NotificationType.Success, { title: 'Quest complete', text: data.name }, { anchor: 'top' }); });
on('net/lost', () => { NotificationService.show( NotificationType.Error, { title: 'Connection lost', text: 'Trying to reconnect…' }, { anchor: 'top', theme: { backgroundColor: '#7f1d1d' } }, ); });}How it works
Section titled “How it works”The script is explained step by step in A themed set of notifications.
Open it in XR Creator
Section titled “Open it in XR Creator”Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.
NotificationTheme.xrproj