began trying to fix primitive batch.

This commit is contained in:
2019-01-30 07:45:55 -06:00
parent c7211323fd
commit 2acdda2338
4 changed files with 76 additions and 94 deletions

View File

@@ -1,6 +1,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.ContentSystem;
using RecrownedAthenaeum.Render;
using RecrownedAthenaeum.UI.BookSystem;
using RecrownedAthenaeum.UI.Modular.Modules;
using RecrownedAthenaeum.UI.Modular.Modules.Interactive;
@@ -15,6 +16,8 @@ namespace RhythmBullet.Screens.MainMenu
TextButton playButton;
TextButton quitButton;
PrimitiveBatch primitiveBatch = new PrimitiveBatch();
internal MainPage() : base(0, 0)
{
}
@@ -26,8 +29,6 @@ namespace RhythmBullet.Screens.MainMenu
SpriteFont font = assets.Get<SpriteFont>("gasalt_regular");
var test = skin.ObtainDefinition<TextButtonSkinDefinition>(typeof(TextButton));
playButton = new TextButton("Play!", font, skin);
AddModule(playButton);
@@ -38,15 +39,19 @@ namespace RhythmBullet.Screens.MainMenu
public override void ApplySize(int width, int height)
{
title.Scale = (width - 40) / title.Texture.Width;
title.CenterOrigin();
title.bounds.X = width / 2;
title.bounds.Y = height / 2;
title.bounds.X = (int)(width / 2f);
title.bounds.Y = (int)(height / 2f);
base.ApplySize(width, height);
}
public override void Draw(SpriteBatch batch)
{
primitiveBatch.Begin(PrimitiveType.LineList);
primitiveBatch.AddVertex(new Vector2(20, 20), Color.Red);
primitiveBatch.AddVertex(new Vector2(50, 60), Color.Red);
primitiveBatch.End();
base.Draw(batch);
}
}