using RecrownedAthenaeum.ContentSystem;
using RecrownedAthenaeum.Render;
using RecrownedAthenaeum.UI.Modular;
using RecrownedAthenaeum.UI.SkinSystem;
namespace RecrownedAthenaeum.UI.BookSystem
{
///
/// A page a part of a .
///
public class Page : UIModuleGroup
{
private readonly int pageX, pageY;
///
/// Whether or not this book needs to be refreshed with new dimensions.
///
public bool requiresSizeUpdate;
///
/// Constructs a page.
///
/// The X position in the book.
/// The Y position in the book.
public Page(int pageX, int pageY) : base()
{
this.pageX = pageX;
this.pageY = pageY;
requiresSizeUpdate = true;
name = ToString();
}
///
/// Called when this page is flagged as needing a size update.
///
/// New width.
/// New Height
public virtual void ApplySize(int width, int height)
{
situation.X = pageX * width;
situation.Y = pageY * height;
situation.Width = width;
situation.Height = height;
requiresSizeUpdate = false;
}
///
/// Called only once after a page is added to a . Generally used to instantiate the modules of the page.
///
/// The assets to be used during initialization passed by the book this page belongs to.
/// The skin the book containing this page is given that can be used by this page.
/// The scissor box to use for cropping.
protected internal virtual void Initialize(ContentManagerController assets, ISkin skin, BasicScissor basicScissor)
{
this.basicScissor = basicScissor;
}
}
}