コード例 #1
0
        public static void draw(View Vw, ViewWindow Window)
        {
            Window.title = "Past Reviews";
            InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance;

            if (GameInstance == null)
            {
                Log.Error("StateFundingHubReviewsView.draw, Inst is null");
                return;
            }

            curView   = Vw;
            curWindow = Window;

            int buttonWidth  = 180;
            int buttonHeight = 30;
            int buttonMargin = 10;
            // int xOffset = 0;
            int yOffset = 0;

            ViewScroll PastReviewsScroll = new ViewScroll();

            PastReviewsScroll.setRelativeTo(Window);
            PastReviewsScroll.setWidth(Window.getWidth() - 140);
            PastReviewsScroll.setHeight(Window.getHeight() - 50);
            PastReviewsScroll.setLeft(140);
            PastReviewsScroll.setTop(40);

            Vw.addComponent(PastReviewsScroll);

            for (int i = GameInstance.getReviews().Length - 1; i >= 0; i--)
            {
                Review Rev = GameInstance.Reviews[i];

                ViewReviewButton Btn = new ViewReviewButton(Rev, OnReviewClick);
                Btn.setRelativeTo(PastReviewsScroll);

                int left = 0;
                int top  = yOffset * buttonMargin + yOffset * buttonHeight;

                Btn.setLeft(left);
                Btn.setTop(top);
                Btn.setWidth(buttonWidth);
                Btn.setHeight(buttonHeight);
                Btn.setColor(Color.white);

                yOffset++;

                PastReviewsScroll.Components.Add(Btn);
            }
        }
コード例 #2
0
        private void LoadPastReviews()
        {
            reloadBase();

            Window.title = "Past Reviews";
            Instance GameInstance = StateFundingGlobal.fetch.GameInstance;

            int buttonWidth  = 60;
            int buttonHeight = 20;
            int buttonMargin = 10;
            int xOffset      = 0;
            int yOffset      = 0;

            for (int i = GameInstance.getReviews().Length - 1; i >= 0; i--)
            {
                Review Rev = GameInstance.getReviews() [i];

                ViewReviewButton Btn = new ViewReviewButton(Rev, OnReviewClick);
                Btn.setRelativeTo(Window);

                int left          = 140 + xOffset * buttonMargin + xOffset * buttonWidth;
                int top           = 40 + yOffset * buttonMargin + yOffset * buttonHeight;
                int absoluteRight = Window.getTopLeftX() + left + buttonWidth + 10;

                if (absoluteRight > Window.getBottomRightX())
                {
                    xOffset = 0;
                    yOffset++;

                    left = 140 + xOffset * buttonMargin + xOffset * buttonWidth;
                    top  = 40 + yOffset * buttonMargin + yOffset * buttonHeight;
                }


                Btn.setLeft(left);
                Btn.setTop(top);
                Btn.setWidth(buttonWidth);
                Btn.setHeight(buttonHeight);

                xOffset++;

                this.addComponent(Btn);
            }
        }
コード例 #3
0
        public static void draw(View Vw, ViewWindow Window)
        {
            Window.title = "Past Reviews";
              InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance;

              curView = Vw;
              curWindow = Window;

              int buttonWidth = 180;
              int buttonHeight = 30;
              int buttonMargin = 10;
              int xOffset = 0;
              int yOffset = 0;

              ViewScroll PastReviewsScroll = new ViewScroll ();
              PastReviewsScroll.setRelativeTo (Window);
              PastReviewsScroll.setWidth (Window.getWidth () - 140);
              PastReviewsScroll.setHeight (Window.getHeight () - 50);
              PastReviewsScroll.setLeft (140);
              PastReviewsScroll.setTop (40);

              Vw.addComponent (PastReviewsScroll);

              for (int i = GameInstance.getReviews ().Length - 1; i >= 0; i--) {
            Review Rev = GameInstance.Reviews[i];

            ViewReviewButton Btn = new ViewReviewButton (Rev, OnReviewClick);
            Btn.setRelativeTo (PastReviewsScroll);

            int left = 0;
            int top = yOffset * buttonMargin + yOffset * buttonHeight;

            Btn.setLeft (left);
            Btn.setTop (top);
            Btn.setWidth (buttonWidth);
            Btn.setHeight (buttonHeight);
            Btn.setColor (Color.white);

            yOffset++;

            PastReviewsScroll.Components.Add (Btn);
              }
        }
コード例 #4
0
        private void LoadPastReviews()
        {
            reloadBase ();

              Window.title = "Past Reviews";
              Instance GameInstance = StateFundingGlobal.fetch.GameInstance;

              int buttonWidth = 60;
              int buttonHeight = 20;
              int buttonMargin = 10;
              int xOffset = 0;
              int yOffset = 0;

              for (int i = GameInstance.getReviews ().Length - 1; i >= 0; i--) {
            Review Rev = GameInstance.getReviews () [i];

            ViewReviewButton Btn = new ViewReviewButton (Rev, OnReviewClick);
            Btn.setRelativeTo (Window);

            int left = 140 + xOffset * buttonMargin + xOffset * buttonWidth;
            int top = 40 + yOffset * buttonMargin + yOffset * buttonHeight;
            int absoluteRight = Window.getTopLeftX() + left + buttonWidth + 10;

            if (absoluteRight > Window.getBottomRightX()) {
              xOffset = 0;
              yOffset++;

              left = 140 + xOffset * buttonMargin + xOffset * buttonWidth;
              top = 40 + yOffset * buttonMargin + yOffset * buttonHeight;
            }

            Btn.setLeft (left);
            Btn.setTop (top);
            Btn.setWidth (buttonWidth);
            Btn.setHeight (buttonHeight);

            xOffset++;

            this.addComponent (Btn);
              }
        }