Skip to content

Game.PageView

Assembly:
Assembly-CSharp

Namespace:
Game.UI.Widgets

Type:
class

Base:
LayoutContainer

Summary:
A simple UI container that represents a paged view. It exposes a currentPage property to track the currently visible page index. When the currentPage changes, the component marks its properties as changed so the UI system can react (for example, for serialization or re-render). The constructor sets the container's flex layout to fill available space.


Fields

  • private int m_CurrentPage
    Backs the public currentPage property. Defaults to 0. Represents the index of the currently active page.

Properties

  • public int currentPage { get; private set }
    Public getter and setter for the currently selected page index. When the value changes, the setter calls SetPropertiesChanged() to notify the UI/property system of the change so the state can be serialized / reprocessed.

Constructors

  • public PageView()
    Initializes a new PageView and sets base.flex = FlexLayout.Fill so the control fills available layout space.

Methods

  • protected override void WriteProperties(IJsonWriter writer)
    Overrides the base WriteProperties to include the currentPage property in JSON output. Writes a property named "currentPage" with the currentPage value. This is used by the UI/property serialization system.

Usage Example

var pageView = new PageView();
pageView.currentPage = 1; // sets the active page and marks properties changed

// Example: adding to a parent layout container
// parentContainer.Add(pageView);

// During serialization/write, PageView will emit:
// { "currentPage": 1 }