Beispiel #1
0
    void pelaa(int num3)
    {
        LoadGame(kaamos[num3]);
        ColorTileMap maailma1ilmentymä = new ColorTileMap(maailma1);
        LataaKentta(maailma1ilmentymä);
        //Vedikartta = new List<PhysicsObject>();
        Gravity = new Vector(0, -900);
        //LataaKentta(new ColorTileMap(generate(200, 60, kentanNimi)));
        LisaaNappaimet();
        //Inventory inventory = new Inventory();
        //Add(inventory);
        yu = new HorizontalLayout();
        yu.Spacing = 5;
        qq = new VerticalLayout();
        //foreach (PhysicsObject esine in esineet())
        //{
        //    inventory.AddItem(esine, kivihakku);
        //    inventory.SelectItem(esine);
        //}
        //inventory.Y = Screen.Top - 20;

        int luku = RandomGen.NextInt(1, 200);
        luopuu(luku);
        ////luopuu(new Vector kentanPiste = Level.GetRandomPosition());

        Camera.Zoom(1.5);
        ////Camera.ZoomToLevel();
        Camera.Follow(pelaaja1);

        luojano();
        esineet2 = new List<GameObject>();
        esineslotit = new List<Widget>();
        käsiselecteditem = 1;
        GameObject banaanit = new GameObject(35, 35);
        banaanit.Image = banaanikuva;
        esineet2.Add(banaanit);
        GameObject puuhakku = new GameObject(35, 35);
        puuhakku.Image = kivihakku;
        esineet2.Add(puuhakku);
        käsitaso = new List<Widget>();
        luoesinevalikko();
    }
Beispiel #2
0
    void LuoUusiMaailma(InputWindow ikkuna)
    {
        kentanNimi = ikkuna.InputBox.Text;
        Vedikartta = new List<PhysicsObject>();
        Gravity = new Vector(0, -900);
        LataaKentta(new ColorTileMap( generate(200, 60,kentanNimi) ) );
        LisaaNappaimet();
        Inventory inventory = new Inventory();
        Add(inventory);
        yu = new HorizontalLayout();
        yu.Spacing = 5;
        qq = new VerticalLayout();
        foreach (PhysicsObject esine in esineet())
        {
            inventory.AddItem(esine, kivihakku);
            inventory.SelectItem(esine);
        }
        inventory.Y = Screen.Top - 20;

        int luku = RandomGen.NextInt(1, 200);
        luopuu(luku);
        //luopuu(new Vector kentanPiste = Level.GetRandomPosition());

        Camera.Zoom(1.5);
        //Camera.ZoomToLevel();
        Camera.Follow(pelaaja1);

        luojano();
        esineet2 = new List<GameObject>();
        esineslotit = new List<Widget>();
        käsiselecteditem = 1;
        GameObject banaanit = new GameObject(35, 35);
        banaanit.Image = banaanikuva;
        esineet2.Add(banaanit);
        GameObject puuhakku = new GameObject(35, 35);
        puuhakku.Image = kivihakku;
        esineet2.Add(puuhakku);
        käsitaso = new List<Widget>();
        luoesinevalikko();
    }
Beispiel #3
0
    void LataaMaailma()
    {
        int num2=montamaailmaa();

        lll = new VerticalLayout();
        Widget tarjotin = new Widget(lll);
        Add(tarjotin,3);
        for (int i = 0; i < num2; i++)
        {
            Label tonttu1 = new Label(nykymaailma(i));
            tonttu1.Color = Color.LightGray;
            tarjotin.Add(tonttu1);
            Mouse.ListenOn(tonttu1, MouseButton.Left, ButtonState.Pressed, delegate { pelaa(i); }, "");

        }
        //for(int i=0; i> System.IO.

        //lataakenttä funktiolle annetaan parametreiksi bitmapimage josta se lataa kentän
        //LisaaNappaimet();
        //Inventory inventory = new Inventory();
        //Add(inventory);
        /*
        foreach (PhysicsObject esine in esineet())
        {
            inventory.AddItem(esine, kivihakku);
            inventory.SelectItem(esine);
        }
        inventory.Y = Screen.Top - 20;

        int luku = RandomGen.NextInt(1, 200);
        luopuu(luku);
        //luopuu(new Vector kentanPiste = Level.GetRandomPosition());

        Camera.Zoom(1.5);
        //Camera.ZoomToLevel();
        Camera.Follow(pelaaja1);
         */
    }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HSVColorPicker"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public HSVColorPicker(ControlBase parent)
            : base(parent)
        {
            MouseInputEnabled = true;

            int baseSize = BaseUnit;

            m_LerpBox               = new ColorLerpBox(this);
            m_LerpBox.Margin        = Margin.Two;
            m_LerpBox.ColorChanged += ColorBoxChanged;
            m_LerpBox.Dock          = Dock.Fill;

            ControlBase values = new VerticalLayout(this);

            values.Dock = Dock.Right;
            {
                m_After      = new ColorDisplay(values);
                m_After.Size = new Size(baseSize * 5, baseSize * 2);

                m_Before        = new ColorDisplay(values);
                m_Before.Margin = new Margin(2, 0, 2, 2);
                m_Before.Size   = new Size(baseSize * 5, baseSize * 2);

                GridLayout grid = new GridLayout(values);
                grid.Margin = new Margin(2, 0, 2, 2);
                grid.SetColumnWidths(GridLayout.AutoSize, GridLayout.Fill);
                {
                    {
                        Label label = new Label(grid);
                        label.Text      = "R: ";
                        label.Alignment = Alignment.Left | Alignment.CenterV;

                        m_Red     = new NumericUpDown(grid);
                        m_Red.Min = 0;
                        m_Red.Max = 255;
                        m_Red.SelectAllOnFocus = true;
                        m_Red.ValueChanged    += NumericTyped;
                    }

                    {
                        Label label = new Label(grid);
                        label.Text      = "G: ";
                        label.Alignment = Alignment.Left | Alignment.CenterV;

                        m_Green     = new NumericUpDown(grid);
                        m_Green.Min = 0;
                        m_Green.Max = 255;
                        m_Green.SelectAllOnFocus = true;
                        m_Green.ValueChanged    += NumericTyped;
                    }

                    {
                        Label label = new Label(grid);
                        label.Text      = "B: ";
                        label.Alignment = Alignment.Left | Alignment.CenterV;

                        m_Blue     = new NumericUpDown(grid);
                        m_Blue.Min = 0;
                        m_Blue.Max = 255;
                        m_Blue.SelectAllOnFocus = true;
                        m_Blue.ValueChanged    += NumericTyped;
                    }
                }
            }

            m_ColorSlider               = new ColorSlider(this);
            m_ColorSlider.Margin        = Margin.Two;
            m_ColorSlider.ColorChanged += ColorSliderChanged;
            m_ColorSlider.Dock          = Dock.Right;

            EnableDefaultColor = false;

            SetColor(DefaultColor);
        }
Beispiel #5
0
        public ComboBoxTest(ControlBase parent)
            : base(parent)
        {
            VerticalLayout layout = new VerticalLayout(this);

            {
                ComboBox combo = new ComboBox(layout);
                combo.Margin = Net.Margin.Five;
                combo.Width  = 200;

                combo.AddItem("Option One", "one");
                combo.AddItem("Number Two", "two");
                combo.AddItem("Door Three", "three");
                combo.AddItem("Four Legs", "four");
                combo.AddItem("Five Birds", "five");

                combo.ItemSelected += OnComboSelect;
            }

            {
                // Empty
                ComboBox combo = new ComboBox(layout);
                combo.Margin = Net.Margin.Five;
                combo.Width  = 200;
            }

            {
                // Lots of things
                ComboBox combo = new ComboBox(layout);
                combo.Margin = Net.Margin.Five;
                combo.Width  = 200;

                for (int i = 0; i < 500; i++)
                {
                    combo.AddItem(String.Format("Option {0}", i));
                }

                combo.ItemSelected += OnComboSelect;
            }

            {
                // Editable
                EditableComboBox combo = new EditableComboBox(layout);
                combo.Margin = Net.Margin.Five;
                combo.Width  = 200;

                combo.AddItem("Option One", "one");
                combo.AddItem("Number Two", "two");
                combo.AddItem("Door Three", "three");
                combo.AddItem("Four Legs", "four");
                combo.AddItem("Five Birds", "five");

                combo.ItemSelected += (s, a) => UnitPrint(String.Format("ComboBox: OnComboSelect: {0}", combo.SelectedItem.Text));;

                combo.TextChanged   += (s, a) => UnitPrint(String.Format("ComboBox: OnTextChanged: {0}", combo.Text));
                combo.SubmitPressed += (s, a) => UnitPrint(String.Format("ComboBox: OnSubmitPressed: {0}", combo.Text));
            }

            {
                HorizontalLayout hlayout = new HorizontalLayout(layout);
                {
                    // In-Code Item Change
                    ComboBox combo = new ComboBox(hlayout);
                    combo.Margin = Net.Margin.Five;
                    combo.Width  = 200;

                    MenuItem Triangle = combo.AddItem("Triangle");
                    combo.AddItem("Red", "color");
                    combo.AddItem("Apple", "fruit");
                    combo.AddItem("Blue", "color");
                    combo.AddItem("Green", "color", 12);
                    combo.ItemSelected += OnComboSelect;

                    //Select by Menu Item
                    {
                        Button TriangleButton = new Button(hlayout);
                        TriangleButton.Text     = "Triangle";
                        TriangleButton.Width    = 100;
                        TriangleButton.Clicked += delegate(ControlBase sender, ClickedEventArgs args)
                        {
                            combo.SelectedItem = Triangle;
                        };
                    }

                    //Select by Text
                    {
                        Button TestBtn = new Button(hlayout);
                        TestBtn.Text     = "Red";
                        TestBtn.Width    = 100;
                        TestBtn.Clicked += delegate(ControlBase sender, ClickedEventArgs args)
                        {
                            combo.SelectByText("Red");
                        };
                    }

                    //Select by Name
                    {
                        Button TestBtn = new Button(hlayout);
                        TestBtn.Text     = "Apple";
                        TestBtn.Width    = 100;
                        TestBtn.Clicked += delegate(ControlBase sender, ClickedEventArgs args)
                        {
                            combo.SelectByName("fruit");
                        };
                    }

                    //Select by UserData
                    {
                        Button TestBtn = new Button(hlayout);
                        TestBtn.Text     = "Green";
                        TestBtn.Width    = 100;
                        TestBtn.Clicked += delegate(ControlBase sender, ClickedEventArgs args)
                        {
                            combo.SelectByUserData(12);
                        };
                    }
                }
            }
        }
Beispiel #6
0
        public void Init(IQFrameworkContainer container)
        {
            Container = container;

            PackageManagerApp.Send <PackageManagerInitCommand>();

            mRootLayout = new VerticalLayout();

            new LabelView(LocaleText.FrameworkPackages).FontSize(12).AddTo(mRootLayout);

            var verticalLayout = new VerticalLayout("box").AddTo(mRootLayout);

            var searchView = new HorizontalLayout("box")
                             .AddTo(verticalLayout);

            searchView.AddChild(new LabelView("搜索:")
                                .FontBold()
                                .FontSize(12)
                                .Width(40));

            searchView.AddChild(
                new TextView().Height(20)
                .Do(search =>
            {
                search.Content
                .Bind(key => { PackageManagerApp.Send(new SearchCommand(key)); }).AddTo(mDisposableList);
            })
                );

            mAccessRightView = new ToolbarView()
                               .Menus(new List <string>()
            {
                "all", PackageAccessRight.Public.ToString(), PackageAccessRight.Private.ToString()
            })
                               .AddTo(verticalLayout)
                               .Do(self =>
            {
                self.Index.Bind(value =>
                {
                    PackageManagerState.AccessRightIndex.Value = value;
                    PackageManagerApp.Send(new SearchCommand(PackageManagerState.SearchKey.Value));
                }).AddTo(mDisposableList);
            });

            mCategoriesSelectorView = new ToolbarView()
                                      .AddTo(verticalLayout)
                                      .Do(self =>
            {
                self.Index.Bind(value =>
                {
                    PackageManagerState.CategoryIndex.Value = value;
                    PackageManagerApp.Send(new SearchCommand(PackageManagerState.SearchKey.Value));
                }).AddTo(mDisposableList);
            });

            new PackageListHeaderView()
            .AddTo(verticalLayout);

            var packageList = new VerticalLayout("box")
                              .AddTo(verticalLayout);

            mRepositoryList = new ScrollLayout()
                              .Height(600)
                              .AddTo(packageList);

            PackageManagerState.Categories.Bind(value => { Categories = value; }).AddTo(mDisposableList);

            PackageManagerState.PackageRepositories
            .Bind(list => { this.PackageRepositories = list; }).AddTo(mDisposableList);
        }