added default skin books can use for their pages.
This commit is contained in:
parent
9d84b641db
commit
ac97cc64c0
@ -2,6 +2,7 @@
|
|||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using RecrownedAthenaeum.Camera;
|
using RecrownedAthenaeum.Camera;
|
||||||
using RecrownedAthenaeum.ContentSystem;
|
using RecrownedAthenaeum.ContentSystem;
|
||||||
|
using RecrownedAthenaeum.UI.SkinSystem;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@ -13,6 +14,7 @@ namespace RecrownedAthenaeum.UI.BookSystem
|
|||||||
public class Book
|
public class Book
|
||||||
{
|
{
|
||||||
readonly ContentManagerController assets;
|
readonly ContentManagerController assets;
|
||||||
|
readonly Skin skin;
|
||||||
Camera2D camera;
|
Camera2D camera;
|
||||||
Page targetPage;
|
Page targetPage;
|
||||||
Rectangle dimensions;
|
Rectangle dimensions;
|
||||||
@ -22,7 +24,8 @@ namespace RecrownedAthenaeum.UI.BookSystem
|
|||||||
/// Creates a book.
|
/// Creates a book.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="assets"><see cref="ContentManagerController"/> that holds the assets that are to be used in the pages for this book during initialization.</param>
|
/// <param name="assets"><see cref="ContentManagerController"/> that holds the assets that are to be used in the pages for this book during initialization.</param>
|
||||||
public Book(ContentManagerController assets)
|
/// <param name="skin">The skin that will be passed to pages during their initialization.</param>
|
||||||
|
public Book(ContentManagerController assets, Skin skin)
|
||||||
{
|
{
|
||||||
this.assets = assets;
|
this.assets = assets;
|
||||||
}
|
}
|
||||||
@ -30,6 +33,7 @@ namespace RecrownedAthenaeum.UI.BookSystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Should be called whenever a valid camera and dimensions for the book exist.
|
/// Should be called whenever a valid camera and dimensions for the book exist.
|
||||||
/// Initializes book with given parameters.
|
/// Initializes book with given parameters.
|
||||||
|
/// Generally used with a <see cref="ScreenSystem.Screen"/> and called in the <see cref="ScreenSystem.Screen.Initiate(Rectangle, Camera2D)"/> function.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="camera">Camera game is currently using.</param>
|
/// <param name="camera">Camera game is currently using.</param>
|
||||||
/// <param name="dimensions">Dimensions of the book and the dimensions the pages will use.</param>
|
/// <param name="dimensions">Dimensions of the book and the dimensions the pages will use.</param>
|
||||||
@ -87,7 +91,7 @@ namespace RecrownedAthenaeum.UI.BookSystem
|
|||||||
{
|
{
|
||||||
foreach (Page page in pages)
|
foreach (Page page in pages)
|
||||||
{
|
{
|
||||||
page.Initialize(assets);
|
page.Initialize(assets, skin);
|
||||||
this.pages.Add(page.Name, page);
|
this.pages.Add(page.Name, page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using RecrownedAthenaeum.ContentSystem;
|
using RecrownedAthenaeum.ContentSystem;
|
||||||
using RecrownedAthenaeum.UI.Modular;
|
using RecrownedAthenaeum.UI.Modular;
|
||||||
|
using RecrownedAthenaeum.UI.SkinSystem;
|
||||||
|
|
||||||
namespace RecrownedAthenaeum.UI.BookSystem
|
namespace RecrownedAthenaeum.UI.BookSystem
|
||||||
{
|
{
|
||||||
@ -45,7 +46,8 @@ namespace RecrownedAthenaeum.UI.BookSystem
|
|||||||
/// Called only once after a page is added to a <see cref="Book"/>. Generally used to instantiate the modules of the page.
|
/// Called only once after a page is added to a <see cref="Book"/>. Generally used to instantiate the modules of the page.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="assets">The assets to be used during initialization passed by the book this page belongs to.</param>
|
/// <param name="assets">The assets to be used during initialization passed by the book this page belongs to.</param>
|
||||||
protected internal virtual void Initialize(ContentManagerController assets)
|
/// <param name="skin">The skin the book containing this page is given that can be used by this page.</param>
|
||||||
|
protected internal virtual void Initialize(ContentManagerController assets, Skin skin)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user