rhythmbullet/RhythmBullet/Zer01HD/Utilities/UI/Book/Page.cs

37 lines
895 B
C#

using Microsoft.Xna.Framework.Graphics;
using RhythmBullet.Zer01HD.UI.Modular;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.UI.Book
{
class Page : UIModuleGroup
{
private readonly int pageX, pageY;
public Page(int pageX, int pageY, int width, int height)
{
this.pageX = pageX;
this.pageY = pageY;
ApplySize(width, height);
}
public virtual void ApplySize(int width, int height)
{
Bounds.X = pageX * width;
Bounds.Y = pageY * height;
Bounds.Width = width;
Bounds.Height = height;
}
public void DisplayWithViewport(Viewport viewport)
{
viewport.X = Bounds.X;
viewport.Y = Bounds.Y;
}
}
}