-
-
Notifications
You must be signed in to change notification settings - Fork 11
Create Overlays
MrScautHD edited this page Oct 28, 2023
·
5 revisions
To create an overlay, you simply need to create a new class that extends from the Overlay class.
public class MyOverlay : Overlay {
public MyOverlay(string name) : base(name) { }
protected override void Init() {
base.Init();
}
protected override void Update() {
base.Update();
}
protected override void AfterUpdate() {
base.AfterUpdate();
}
protected override void FixedUpdate() {
base.FixedUpdate();
}
protected override void Draw() { }
}
Create a new MyOverlay object (the class you've crafted) and activate it with ease.
public class MyGame : Game {
public MyGame(GameSettings settings) : base(settings) { }
protected override void Init() {
base.Init();
MyOverlay myOverlay = new MyOverlay("name");
myOverlay.Enabled = true;
OverlayManager.AddOverlay(myOverlay);
}
}
Sparkle Engine - Visit the official Sparkle GitHub repository for the latest updates and source code.
Copyright © [Stellution Studios] | Licensed under the MIT License