Beispiel #1
0
        /// <summary>
        ///  This is the Initializer to run on every (re)start of the manager
        /// </summary>
        public void Initialize()
        {
            // Create the SceneNode under which we will add our Scene elements
            parent = Reference.SceneManager.AddEmptySceneNode(Reference.SceneManager.RootSceneNode, -1);

            // Add elements under parent
            healthBar = Reference.SceneManager.AddBillboardSceneNode(parent, new Dimension2Df(0.5f, 0.1f), -1);
            healthBar.SetMaterialTexture(0, healthBarG);
            healthBar.SetMaterialType(MaterialType.TransparentAlphaChannel);
            healthBar.SetMaterialFlag(MaterialFlag.Lighting, false);

            healthText = Reference.SceneManager.AddBillboardTextSceneNodeW(Reference.GUIEnvironment.BuiltInFont, "(x_x)",
                                                                           parent, new Dimension2Df(0.7f, 0.2f),
                                                                           new Vector3D(), -1, Color.White,
                                                                           Color.White);
            // We will only display this text when the avatar is dead
            healthText.Visible = false;
        }