From 567c422f8cd42eba2437f9a8c2522716a1649be7 Mon Sep 17 00:00:00 2001 From: hazel Date: Mon, 26 Jan 2026 22:04:39 +0100 Subject: celesteia archive, last updated april 9th 2024 Signed-off-by: hazel --- source/ui/elements/IElement.cs | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 source/ui/elements/IElement.cs (limited to 'source/ui/elements/IElement.cs') diff --git a/source/ui/elements/IElement.cs b/source/ui/elements/IElement.cs new file mode 100644 index 0000000..094d7b7 --- /dev/null +++ b/source/ui/elements/IElement.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace Celesteia.UI.Elements { + public interface IElement { + // Is the element enabled? + bool GetEnabled(); + + // Set whether the element is enabled. + bool SetEnabled(bool value); + + // Get the containing rect of the element. + Rect GetRect(); + + // Set the containing rect of the element. + void SetRect(Rect rect); + + // Move to a point. + void MoveTo(Point point); + + // Get the rectangle with a pivot point. + Rectangle GetRectangle(); + + // Gets the pivot point of the element; + Vector2 GetPivot(); + + // Sets the pivot point of the element; + void SetPivot(Vector2 pivot); + + // Called when the mouse position is within the element's containing rect. + void OnMouseIn(); + + // Called when the mouse position is within the element's containing rect. + void OnMouseOut(); + + // Get if the element has the mouse over it. + bool GetMouseOver(); + + // Update the element. + void Update(GameTime gameTime, out bool clickedAnything); + + // Draw the element. + void Draw(SpriteBatch spriteBatch); + + // Get the element's parent. + IContainer GetParent(); + + // Set the element's parent. + void SetParent(IContainer container); + } +} \ No newline at end of file -- cgit v1.2.3