Skip to content

Commit

Permalink
BREAKING CHANGE: default Alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
BlurOne-GIT committed Mar 29, 2024
1 parent bbe864d commit d31e504
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MmgEngine/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Button : DrawableGameComponent
#endregion

//Constructor
public Button(Game game, Rectangle actionBox, SimpleImage texture = null, Alignment anchor = Alignment.Center, bool enabled = true, bool hasHover = false) : base(game)
public Button(Game game, Rectangle actionBox, SimpleImage texture = null, Alignment anchor = Alignment.TopLeft, bool enabled = true, bool hasHover = false) : base(game)
{
actionBox.Location -= (actionBox.Size.ToVector2() * EngineStatics.Aligner(anchor)).ToPoint();

Expand Down
2 changes: 1 addition & 1 deletion MmgEngine/HoverDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class HoverDetector : GameComponent
public Rectangle ActionBox { get; private set; }
public bool Hovering { get; private set; }

public HoverDetector(Game game, Rectangle actionBox, Alignment alignment = Alignment.Center, bool enabled = true) : base(game)
public HoverDetector(Game game, Rectangle actionBox, Alignment alignment = Alignment.TopLeft, bool enabled = true) : base(game)
{
actionBox.Location -= (actionBox.Size.ToVector2() * EngineStatics.Aligner(alignment)).ToPoint();

Expand Down
2 changes: 1 addition & 1 deletion MmgEngine/SimpleImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class SimpleImage : DrawableGameComponent
public float Scale { get; set; }
#endregion

public SimpleImage(Game game, Texture2D texture, Vector2 position, int layer, bool visible = true, Alignment anchor = Alignment.Center, Animation<Rectangle> animation = null, Color? color = null, float opacity = 1f, float rotation = 0f, float scale = 1f) : base(game)
public SimpleImage(Game game, Texture2D texture, Vector2 position, int layer, bool visible = true, Alignment anchor = Alignment.TopCenter, Animation<Rectangle> animation = null, Color? color = null, float opacity = 1f, float rotation = 0f, float scale = 1f) : base(game)
{
Texture = texture;
Position = position;
Expand Down
2 changes: 1 addition & 1 deletion MmgEngine/TextComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TextComponent : DrawableGameComponent

#endregion

public TextComponent(Game game, SpriteFont font, string defaultText, Vector2 position, int layer, bool visible = true, Alignment anchor = Alignment.CenterLeft, Color? color = null, float opacity = 1f, float rotation = 0f, float scale = 1f) : base(game)
public TextComponent(Game game, SpriteFont font, string defaultText, Vector2 position, int layer, bool visible = true, Alignment anchor = Alignment.TopLeft, Color? color = null, float opacity = 1f, float rotation = 0f, float scale = 1f) : base(game)
{
_font = font;
Position = position;
Expand Down

0 comments on commit d31e504

Please sign in to comment.