Class: Ton

Mononotonkaの中核となるシングルトンクラスです。全てのサブシステムへのアクセスポイントを提供します。

Properties

static Ton Instance

Tonクラスの唯一のインスタンスを取得します。

static TonGame Game

ウィンドウ・解像度管理クラスへのアクセス。
(推奨短縮形: Ton.Game / 実体: Ton.Instance.game)

static TonInput Input

入力管理クラスへのアクセス。
(推奨短縮形: Ton.Input / 実体: Ton.Instance.input)

static TonGraphics Gra

描画管理クラスへのアクセス。
(推奨短縮形: Ton.Gra / 実体: Ton.Instance.gra)

static TonSound Sound

音声管理クラスへのアクセス。
(推奨短縮形: Ton.Sound / 実体: Ton.Instance.sound)

static TonScene Scene

シーン管理クラスへのアクセス。
(推奨短縮形: Ton.Scene / 実体: Ton.Instance.scene)

static TonMessage Msg

メッセージウィンドウ管理クラスへのアクセス。
(推奨短縮形: Ton.Msg / 実体: Ton.Instance.msg)

static TonCharacter Character

キャラクター管理クラスへのアクセス。
(推奨短縮形: Ton.Character / 実体: Ton.Instance.character)

static TonLog Log

ログ管理クラスへのアクセス。
(推奨短縮形: Ton.Log / 実体: Ton.Instance.log)

static TonMath Math

数学ヘルパクラスへのアクセス。
(推奨短縮形: Ton.Math / 実体: Ton.Instance.math)

static TonStorage Storage

セーブデータ管理クラスへのアクセス。
(推奨短縮形: Ton.Storage / 実体: Ton.Instance.storage)

static TonParticle Particle

パーティクル管理クラスへのアクセス。
(推奨短縮形: Ton.Particle / 実体: Ton.Instance.particle)

static TonGameData Data

ゲーム実行データ(HP, 所持金など)へのアクセス。
(推奨短縮形: Ton.Data / 実体: Ton.Instance.gamedata)
オートセーブ用データコンテナとして機能します。

static TonPrimitive Primitive

図形・エフェクト描画クラスへのアクセス。
(推奨短縮形: Ton.Primitive / 実体: Ton.Instance.primitive)

static TonMagicEffect Magic

魔法エフェクト管理クラスへのアクセス。
(推奨短縮形: Ton.Magic / 実体: Ton.Instance.magic)
※ TonParticleのサンプル実装です。

Methods

void Initialize(Game game, GraphicsDeviceManager graphics)

ライブラリを初期化します。Game1.Initialize内で呼び出してください。

void Update(GameTime gameTime)

全てのサブシステムを更新します。Game1.Update内で呼び出してください。

void Draw(GameTime gameTime)

全てのサブシステムの描画処理を実行します。Game1.Draw内で呼び出してください。

void Terminate()

ライブラリ終了時の処理を行います。

Sample Code

// In Game1.cs
protected override void Initialize()
{
    // Initialize Mononotonka with Game and GraphicsDeviceManager
    Ton.Initialize(this, _graphics);
    base.Initialize();
}

protected override void Update(GameTime gameTime)
{
    // Update all subsystems
    Ton.Update(gameTime);
    base.Update(gameTime);
}

protected override void Draw(GameTime gameTime)
{
    GraphicsDevice.Clear(Color.Black);

    // Draw all subsystems
    Ton.Draw(gameTime);
    
    base.Draw(gameTime);
}

protected override void UnloadContent()
{
    Ton.Terminate();
}