예제 #1
0
        private void _setupControls()
        {
            TrayManager.ShowCursor();

            // make room for the controls
            TrayManager.ShowLogo(TrayLocation.TopRight);
            TrayManager.ShowFrameStats(TrayLocation.TopRight);
            TrayManager.ToggleAdvancedFrameStats();

            this.infoLabel = TrayManager.CreateLabel(TrayLocation.Top, "TInfo", "", 350);

            this.editMenu = TrayManager.CreateLongSelectMenu(TrayLocation.Bottom, "EditMode", "Edit Mode", 370, 250, 3);
            this.editMenu.AddItem("None");
            this.editMenu.AddItem("Elevation");
            this.editMenu.AddItem("Blend");
            this.editMenu.SelectItem(0); // no edit mode
            this.editMenu.SelectedIndexChanged += _itemSelected;

            this.flyBox = TrayManager.CreateCheckBox(TrayLocation.Bottom, "Fly", "Fly");
            this.flyBox.SetChecked(false, false);
            this.flyBox.CheckChanged += _checkBoxToggled;

            this.shadowsMenu = TrayManager.CreateLongSelectMenu(TrayLocation.Bottom, "Shadows", "Shadows", 370, 250, 3);
            this.shadowsMenu.AddItem("None");
            this.shadowsMenu.AddItem("Color Shadows");
            this.shadowsMenu.AddItem("Depth Shadows");
            this.shadowsMenu.SelectItem(0);
            this.shadowsMenu.SelectedIndexChanged += _itemSelected;

            var names = new List <string>();

            names.Add("Help");
            //a friendly reminder
            TrayManager.CreateParamsPanel(TrayLocation.TopLeft, "Help", 100, names).SetParamValue(0, "H/F1");
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        protected override void SetupContent()
        {
            // set background and some fog
            Viewport.BackgroundColor = new ColorEx(1.0f, 1.0f, 0.8f);
            SceneManager.SetFog(FogMode.Linear, new ColorEx(1.0f, 1.0f, 1.0f), 0, 15, 100);

            // set shadow properties
            SceneManager.ShadowTechnique    = ShadowTechnique.TextureModulative;
            SceneManager.ShadowColor        = new ColorEx(0.5f, 0.5f, 0.5f);
            SceneManager.ShadowTextureSize  = 1024;
            SceneManager.ShadowTextureCount = 1;

            // disable default camera control so the character can do its own
            CameraManager.setStyle(CameraStyle.Manual);

            // use a small amount of ambient lighting
            SceneManager.AmbientLight = new ColorEx(0.3f, 0.3f, 0.3f);

            // add a bright light above the scene
            Light light = SceneManager.CreateLight("CharacterLight");

            light.Type     = LightType.Point;
            light.Position = new Vector3(-10, 40, 20);
            light.Specular = ColorEx.White;

            MeshManager.Instance.CreatePlane("floor", ResourceGroupManager.DefaultResourceGroupName,
                                             new Plane(Vector3.UnitY, 0), 100, 100, 10, 10, true, 1, 10, 10, Vector3.UnitZ);

            // create a floor entity, give it a material, and place it at the origin
            Entity floor = SceneManager.CreateEntity("Floor", "floor");

            floor.MaterialName = "Examples/Rockwall";
            floor.CastShadows  = false;
            SceneManager.RootSceneNode.AttachObject(floor);


            // create our character controller
            this.chara = new SinbadCharacterController(Camera);

            TrayManager.ToggleAdvancedFrameStats();

            var items = new List <string>();

            items.Add("Help");
            ParamsPanel help = TrayManager.CreateParamsPanel(TrayLocation.TopLeft, "HelpMessage", 100, items);

            help.SetParamValue("Help", " H / F1");
        }