screens update normal logic during transition now; added comments; book now has an initiate function; image has more functions; minor improvements on module system;
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using RhythmBullet.Zer01HD.UI.Modular;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -10,16 +11,51 @@ namespace RhythmBullet.Zer01HD.Utilities.UI.Modular.Modules
|
||||
{
|
||||
class Image : UIModule
|
||||
{
|
||||
Texture2D texture;
|
||||
public Texture2D Texture { get; set; }
|
||||
public float ScaleX
|
||||
{
|
||||
get
|
||||
{
|
||||
return (float)Bounds.Width / Texture.Width;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Bounds.Width = (int)(Texture.Width * value);
|
||||
}
|
||||
}
|
||||
|
||||
public float ScaleY
|
||||
{
|
||||
get
|
||||
{
|
||||
return (float)Bounds.Height / Texture.Height;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Bounds.Height = (int)(Texture.Height * value);
|
||||
}
|
||||
}
|
||||
|
||||
public float Scale
|
||||
{
|
||||
set
|
||||
{
|
||||
Bounds.Height = (int)(Texture.Height * value);
|
||||
Bounds.Width = (int)(Texture.Width * value);
|
||||
}
|
||||
}
|
||||
|
||||
public Image(Texture2D texture)
|
||||
{
|
||||
this.texture = texture;
|
||||
Texture = texture ?? throw new ArgumentException("Image requires a texture.");
|
||||
Bounds = texture.Bounds;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch batch)
|
||||
{
|
||||
batch.Draw(texture, Bounds, Color);
|
||||
batch.Draw(Texture, Bounds, Color);
|
||||
base.Draw(batch);
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ namespace RhythmBullet.Zer01HD.UI.Modular
|
||||
public Rectangle Bounds;
|
||||
public UIModuleGroup Parent;
|
||||
public string Name;
|
||||
public Color Color;
|
||||
public Color Color = Color.White;
|
||||
|
||||
public virtual void Update(GameTime gameTime)
|
||||
{
|
||||
|
@@ -18,7 +18,7 @@ namespace RhythmBullet.Zer01HD.UI.Modular
|
||||
RasterizerState scissorRasterizer = new RasterizerState();
|
||||
public Camera2D Camera { get; set; }
|
||||
|
||||
public UIModuleGroup(Camera2D camera = null, bool crop = false)
|
||||
public UIModuleGroup(bool crop = false, Camera2D camera = null)
|
||||
{
|
||||
Camera = camera;
|
||||
if (crop)
|
||||
|
Reference in New Issue
Block a user