一部の開発者、特に初心者にとってはHUD が何を意味するのが正しく理解することは難しいかもしれません。 - (ヘッドアップディスプレイ) とは、情報をユーザーインタフェースの一部としてプレイヤーへ視覚的に提示する手法です。 もうお分かりかもしれませんが、例えばスコアテキストやプレイヤーの状態やコントローラーやその他ボタンが該当します。 それらは、単純にあなたのカメラの動きを"追跡します"。
HUD は Scene クラスのサブクラスで、Entity を貼り付ける分には違いがありません。そのため、HUDを作成して使用する簡単なサンプルは以下になります:
HUD hud = new HUD(); hud.attachChild(yourEntity); camera.setHUD(hud);
基本的にはこれで完了です。上記のサンプルを見て気づいたでしょうが、HUD はCameraに '登録' しなければなりません。 大抵の人は子SceneとしてHUD を使用していることが多く、それでも動作はしますが、正しいやり方ではありません。
Creating HUD:Some developers especially beginners, might find it problematic to understand what does exactly HUD mean - (heads-up display) is the method by which information is visually relayed to the player as part of a game's user interface. So as you can understand it might be for example score text, player's health, controller or different buttons. They will simply 'chase' your camera movement. HUD is a subclass of the Scene class, there are no differences while attaching your entities there, so here's a simple example how to create and use it: HUD hud = new HUD(); hud.attachChild(yourEntity); camera.setHUD(hud); That's basically all, as you noticed in example above, you have to 'stick' your HUD to your Camera, people usually use HUD as a child scene, which will work, but is NOT correct. |
注意事項
|