Scene クラスは、画面に描写する全てのオブジェクトの最上位に位置するコンテナです。 Scene は特定数のレイヤーを持っており、レイヤー自身はいくつかのEntityを(固定的もしくは動的に)保持することができます。 camera の位置に関わらずScene の同じ位置に自身を描写する、CameraScene/HUD/MenuSceneのようなサブクラスがあります。 Scene は Entity クラスのサブクラス(拡張版)です。
Creating and understanding Scenes:The Scene class is the root container for all objects to be drawn on the screen. A Scene has a specific amount of Layers, which themselves can contain a (fixed or dynamic) amount of Entities. There are subclasses, like the CameraScene/HUD/MenuScene that are drawing themselves to the same position of the Scene no matter where the camera is positioned to. |
Sceneを作成するのは本当に簡単で、一行だけでできます:
Scene newScene = new Scene();
Scene を管理する方法(表示や切り替え)をまだ知らない場合は、この記事を読んでください。
1. Creating new Scenes:Creating scenes is really easy, its just matter of one line:
Scene newScene = new Scene();
Read this article, if you still do not know how to manage scenes (display/switch them) |
yourScene.setBackgroundEnabled(false);
2. Scene without background:I found it especially useful, while using child scenes, lets say we have game play scene, and we want to set child scene to our game-play scene (Ex. some kind of popup)
yourScene.setBackgroundEnabled(false);
|
注意事項
|