PsmStudioはソニーのPlayStation用のアプリを開発するための開発環境です。
この開発環境をインストールしたときに一緒にサンプルプログラムもインストールされます。
このなかのサンプルプログラムについてのメモです。
今回は、サンプルプログラム「Hello World」てらす。
「参照」に追加
Sce.PlayStation.HighLevel.UI
*****************************
ソースコード「AppMain.cs」
*****************************
「using」でUIを参照します。
-------------------------------------
using Sce.PlayStation.HighLevel.UI;
-------------------------------------
関数「Initialize」の一部
Labelを設定してSceneに組み込み
さらにSceneをUISystemに組み込む
-------------------------------------
// UI Toolkit 初期化
UISystem.Initialize (graphics);
// sceneを用意する
Scene myScene = new Scene();
// LabelをSceneに組み込む
Label label = new Label();
label.X = 10.0f;
label.Y = 50.0f;
label.Text = "Hello World!";
myScene.RootWidget.AddChildLast(label);
// UIシステムにsceneを組み込む
UISystem.SetScene(myScene, null);
-------------------------------------
関数「Update」の一部
この関数の中で、UISystemの「Update」を呼び出しています。
-------------------------------------
// Query touch for current state
List<TouchData> touchDataList = Touch.GetData (0);
// Update UI Toolkit
UISystem.Update(touchDataList);
-------------------------------------
関数「Render」の一部
UIシステムを表示させます。
-------------------------------------
UISystem.Render ();
-------------------------------------
