示例#1
0
        public void Initialize(ScreenManager screenManager, PixelizerRenderer renderer)
        {
            _renderer      = renderer;
            _screenManager = screenManager;

            screenCanvas = new GUICanvas(Vector2.Zero, new Vector2(GameSettings.g_ScreenWidth, GameSettings.g_ScreenHeight), 0, GUIStyle.GUIAlignment.None);

            baseList = new GuiListToggle(Vector2.Zero, new Vector2(200, 30), 0, GUIStyle.GUIAlignment.TopRight, screenCanvas.Dimensions);
            screenCanvas.AddElement(baseList);

            baseList.AddElement(new GUITextBlockButton(Vector2.Zero, new Vector2(200, 35), "return", GUIRenderer.MonospaceFont, Color.Gray, Color.White)
            {
                ButtonObject = this,
                ButtonMethod = this.GetType().GetMethod("MainMenu")
            });


            baseList.AddElement(new GUITextBlockToggle(Vector2.Zero, new Vector2(200, 35), "Random points", GUIRenderer.MonospaceFont, Color.Gray, Color.White)
            {
                ToggleObject = renderer,
                ToggleField  = renderer.GetType().GetField("Random"),
                Toggle       = (bool)renderer.GetType().GetField("Random").GetValue(renderer)
            });

            baseList.AddElement(_splitChance = new GUITextBlock(Vector2.Zero, new Vector2(200, 25), "Split Chance: " + renderer.SplitChance, GUIRenderer.MonospaceFont, Color.Gray, Color.White));
            baseList.AddElement(new GuiSliderFloat(Vector2.Zero, new Vector2(200, 35), 0, 1, Color.Gray, Color.White)
            {
                SliderObject = renderer,
                SliderField  = renderer.GetType().GetField("SplitChance"),
                SliderValue  = (float)renderer.GetType().GetField("SplitChance").GetValue(renderer)
            });

            baseList.AddElement(_endChance = new GUITextBlock(Vector2.Zero, new Vector2(200, 25), "End Chance: " + renderer.EndChance, GUIRenderer.MonospaceFont, Color.Gray, Color.White));
            baseList.AddElement(new GuiSliderFloat(Vector2.Zero, new Vector2(200, 35), 0, 1, Color.Gray, Color.White)
            {
                SliderObject = renderer,
                SliderField  = renderer.GetType().GetField("EndChance"),
                SliderValue  = (float)renderer.GetType().GetField("EndChance").GetValue(renderer)
            });

            baseList.AddElement(_scale = new GUITextBlock(Vector2.Zero, new Vector2(200, 25), "Scale: " + renderer.Scale, GUIRenderer.MonospaceFont, Color.Gray, Color.White));
            baseList.AddElement(new GuiSliderInt(Vector2.Zero, new Vector2(200, 35), 0, 3, 1, Color.Gray, Color.White)
            {
                SliderObject = renderer,
                SliderField  = renderer.GetType().GetField("Scale"),
                SliderValue  = (int)renderer.GetType().GetField("Scale").GetValue(renderer)
            });

            baseList.AddElement(new GUIColorPicker(Vector2.Zero, new Vector2(200, 200), Color.Gray, GUIRenderer.MonospaceFont)
            {
                ReferenceObject = renderer,
                ReferenceField  = renderer.GetType().GetField("LineColor")
            });

            baseList.AddElement(new GUITextBlock(Vector2.Zero, new Vector2(200, 55), "Click to add effect ", GUIRenderer.MonospaceFont, Color.Gray, Color.White));

            baseList.ParentResized(screenCanvas.Dimensions);
        }
 public void Initialize(ScreenManager screenManager, PixelizerRenderer renderer)
 {
     guiLogic.Initialize(screenManager, renderer);
 }