-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59095ba
commit 28fd0b6
Showing
4 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Basalt.Common.Components; | ||
using Basalt.Common.Entities; | ||
using Raylib_cs; | ||
using System.Numerics; | ||
using static Raylib_cs.Raylib; | ||
namespace Basalt.Raylib.Components | ||
{ | ||
public class Panel : UIComponent | ||
{ | ||
public Vector2 Size { get; set; } = Vector2.One; | ||
public Color Color { get; set; } = Color.White; | ||
public Panel(Entity entity) : base(entity) | ||
{ | ||
} | ||
|
||
public override void OnStart() | ||
{ | ||
} | ||
|
||
public override void OnUpdate() | ||
{ | ||
} | ||
|
||
public override void OnUIRender() | ||
{ | ||
var position = GetPivotedPosition(new(GetScreenWidth(), GetScreenHeight())) + Offset; | ||
DrawRectanglePro(new Rectangle(position.X - Size.X / 2, position.Y - Size.Y / 2, Size.X, Size.Y), Size / 2, Rotation, Color); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters