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

37 lines
909 B
C#
Raw Normal View History

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 : ModuleGroup
{
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)
{
2018-09-15 19:05:14 +00:00
Position.X = pageX * width;
Position.Y = pageY * height;
this.Width = width;
this.Height = height;
}
public void DisplayWithViewport(Viewport viewport)
{
2018-09-15 19:05:14 +00:00
viewport.X = (int) Position.X;
viewport.Y = (int) Position.Y;
}
}
}