summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Events/Graphics.cs
diff options
context:
space:
mode:
authorZoryn Aaron <zoryn4163@gmail.com>2016-03-27 04:30:17 -0400
committerZoryn Aaron <zoryn4163@gmail.com>2016-03-27 04:30:17 -0400
commit668b6b10b588d2f0fbe98ad75e0d4c256b6b13bb (patch)
treeaf561cd50a8aafb27d8f3577cb903620acf80577 /StardewModdingAPI/Events/Graphics.cs
parent863b6cb0448f1dfdca69e14e018c4820f3075b81 (diff)
downloadSMAPI-668b6b10b588d2f0fbe98ad75e0d4c256b6b13bb.tar.gz
SMAPI-668b6b10b588d2f0fbe98ad75e0d4c256b6b13bb.tar.bz2
SMAPI-668b6b10b588d2f0fbe98ad75e0d4c256b6b13bb.zip
fuck you @CJBok
Diffstat (limited to 'StardewModdingAPI/Events/Graphics.cs')
-rw-r--r--StardewModdingAPI/Events/Graphics.cs93
1 files changed, 87 insertions, 6 deletions
diff --git a/StardewModdingAPI/Events/Graphics.cs b/StardewModdingAPI/Events/Graphics.cs
index 2b91144a..79c5b4aa 100644
--- a/StardewModdingAPI/Events/Graphics.cs
+++ b/StardewModdingAPI/Events/Graphics.cs
@@ -2,11 +2,47 @@
namespace StardewModdingAPI.Events
{
+ /// <summary>
+ ///
+ /// </summary>
public static class GraphicsEvents
{
+ /// <summary>
+ /// Occurs when the form (game) is resized.
+ /// </summary>
public static event EventHandler Resize = delegate { };
- public static event EventHandler DrawTick = delegate { };
- public static event EventHandler DrawInRenderTargetTick = delegate { };
+
+
+
+ /// <summary>
+ /// Occurs before anything is drawn.
+ /// </summary>
+ public static event EventHandler OnPreRenderEvent = delegate { };
+
+ /// <summary>
+ /// Occurs before the GUI is drawn.
+ /// </summary>
+ public static event EventHandler OnPreRenderGuiEvent = delegate { };
+
+ /// <summary>
+ /// Occurs after the GUI is drawn.
+ /// </summary>
+ public static event EventHandler OnPostRenderGuiEvent = delegate { };
+
+ /// <summary>
+ /// Occurs before the HUD is drawn.
+ /// </summary>
+ public static event EventHandler OnPreRenderHudEvent = delegate { };
+
+ /// <summary>
+ /// Occurs after the HUD is drawn.
+ /// </summary>
+ public static event EventHandler OnPostRenderHudEvent = delegate { };
+
+ /// <summary>
+ /// Occurs after everything is drawn.
+ /// </summary>
+ public static event EventHandler OnPostRenderEvent = delegate { };
/// <summary>
/// Draws when SGame.Debug is true. F3 toggles this.
@@ -16,6 +52,52 @@ namespace StardewModdingAPI.Events
/// </summary>
public static event EventHandler DrawDebug = delegate { };
+ internal static void InvokeDrawDebug(object sender, EventArgs e)
+ {
+ DrawDebug.Invoke(sender, e);
+ }
+
+ internal static void InvokeOnPreRenderEvent(object sender, EventArgs e)
+ {
+ OnPreRenderEvent.Invoke(sender, e);
+ }
+
+ internal static void InvokeOnPreRenderGuiEvent(object sender, EventArgs e)
+ {
+ OnPreRenderGuiEvent.Invoke(sender, e);
+ }
+
+ internal static void InvokeOnPostRenderGuiEvent(object sender, EventArgs e)
+ {
+ OnPostRenderGuiEvent.Invoke(sender, e);
+ }
+
+ internal static void InvokeOnPreRenderHudEvent(object sender, EventArgs e)
+ {
+ OnPreRenderHudEvent.Invoke(sender, e);
+ }
+
+ internal static void InvokeOnPostRenderHudEvent(object sender, EventArgs e)
+ {
+ OnPostRenderHudEvent.Invoke(sender, e);
+ }
+
+ internal static void InvokeOnPostRenderEvent(object sender, EventArgs e)
+ {
+ OnPostRenderEvent.Invoke(sender, e);
+ }
+
+
+
+ #region To Remove
+
+ [Obsolete("Use the other Pre/Post render events instead.")]
+ public static event EventHandler DrawTick = delegate { };
+
+ [Obsolete("Use the other Pre/Post render events instead. All of them will automatically be drawn into the render target if needed.")]
+ public static event EventHandler DrawInRenderTargetTick = delegate { };
+
+ [Obsolete("Should not be used.")]
public static void InvokeDrawTick()
{
try
@@ -28,19 +110,18 @@ namespace StardewModdingAPI.Events
}
}
+ [Obsolete("Should not be used.")]
public static void InvokeDrawInRenderTargetTick()
{
DrawInRenderTargetTick.Invoke(null, EventArgs.Empty);
}
+ [Obsolete("Should not be used.")]
public static void InvokeResize(object sender, EventArgs e)
{
Resize.Invoke(sender, e);
}
- public static void InvokeDrawDebug(object sender, EventArgs e)
- {
- DrawDebug.Invoke(sender, e);
- }
+ #endregion
}
} \ No newline at end of file