Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ASTRA228b/Experimental/llms.txt

Use this file to discover all available pages before exploring further.

OnScreenNotify is a singleton MonoBehaviour that renders timed text notifications at the bottom-center of the player’s screen using Unity’s IMGUI system. Messages appear automatically when room events fire — such as joining or leaving a Photon room — and can be triggered from any part of the mod with a single static call.

Display Behavior

Notifications are drawn with GUI.Label during Unity’s OnGUI pass. Key rendering characteristics:
  • Position: horizontally centered, anchored to the bottom of the screen
  • Stacking: multiple active notifications appear as separate lines stacked above one another
  • Auto-removal: each notification disappears after its individual duration expires; there is no manual dismiss
  • Font: 35 px, white, with Unity rich text enabled (supports <b>, <color>, etc.)
Because OnScreenNotify uses IMGUI, notifications render in screen space and are always visible regardless of where the player is looking — including during cutscenes or loading transitions.

API

OnScreenNotify.SendIT

public static void SendIT(string msg, float det = 2f)
The only public entry point. Call this static method from anywhere in the mod; it routes the message to the singleton instance internally via SendNotifyScreen.
ParameterTypeDefaultDescription
msgstringThe text to display. Rich text tags are supported.
detfloat2fHow long the notification stays visible, in seconds.
SendIT silently does nothing if the singleton Instance is null. The instance is set in Awake when the OnScreenNotify component is initialized. Do not call SendIT before Awake has run.

Built-In Usage

Experimental automatically sends notifications for Photon room events via JoinManager in JoinAndLeave.cs. JoinManager is a MonoBehaviour whose Update method polls PhotonNetwork.InRoom each frame and fires OnScreenNotify.SendIT whenever the room state changes:
// Fired when the local player successfully joins a room
OnScreenNotify.SendIT($"{PlayerName} Joined Room: {IndexName} | Players {PlayerCount}/10");
These calls use the default 2-second duration. The join message includes the player’s display name, the room code, and the current player count.

Calling From Your Own Code

If you are extending Experimental with a new mod or patch, you can send a notification at any point after the plugin has initialized:
// Show a message for the default 2 seconds
OnScreenNotify.SendIT("Speed boost activated!");
Keep notification text short enough to fit on one line at 35 px. Long strings will wrap and push other stacked notifications upward, which can look cluttered if multiple notifications are active simultaneously.

Build docs developers (and LLMs) love