예제 #1
0
        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            float tabX = VectorPosition.X;

            foreach (TabPanel curTP in tabPanels)
            {
                Vector2 curVectorPosition = new Vector2(tabX, VectorPosition.Y);

                Vector2 curHdrVectorPosition = curVectorPosition;
                curHdrVectorPosition.X += tabHdrTxtPxlSpacingX;
                curHdrVectorPosition.Y += tabHdrTxtPxlSpacingY;

                if (curTP.selected)
                {
                    Texture2D curTexture = TabSelectedTexture;
                    curTP.panel.Draw(curGameDrawComponents);
                    curGameDrawComponents._spriteBatch.Draw(curTexture, Model.Utilities.getRectFromTexture2D(curTexture, curVectorPosition), Color.White);
                    curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, curTP.TabText, curHdrVectorPosition, Color.Black);
                }
                else
                {
                    Texture2D curTexture = TabUnselectedTexture;
                    curGameDrawComponents._spriteBatch.Draw(curTexture, Model.Utilities.getRectFromTexture2D(curTexture, curVectorPosition), Color.White);
                    curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, curTP.TabText, curHdrVectorPosition, Color.Black);
                }

                tabX += TabSelectedTexture.Width + tabHdrPxlSpacing;
            }
        }
예제 #2
0
        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            float tabX = VectorPosition.X;

            foreach (TabPanel curTP in tabPanels)
            {
                Vector2 curVectorPosition = new Vector2(tabX, VectorPosition.Y);

                Vector2 curHdrVectorPosition = curVectorPosition;
                curHdrVectorPosition.X += tabHdrTxtPxlSpacingX;
                curHdrVectorPosition.Y += tabHdrTxtPxlSpacingY;


                if (curTP.selected)
                {
                    Texture2D curTexture = TabSelectedTexture;
                    curTP.panel.Draw(curGameDrawComponents);
                    curGameDrawComponents._spriteBatch.Draw(curTexture, Model.Utilities.getRectFromTexture2D(curTexture, curVectorPosition), Color.White);
                    curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, curTP.TabText, curHdrVectorPosition, Color.Black);
                }
                else
                {
                    Texture2D curTexture = TabUnselectedTexture;
                    curGameDrawComponents._spriteBatch.Draw(curTexture, Model.Utilities.getRectFromTexture2D(curTexture, curVectorPosition), Color.White);
                    curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, curTP.TabText, curHdrVectorPosition, Color.Black);
                }



                tabX += TabSelectedTexture.Width + tabHdrPxlSpacing;
            }
        }
예제 #3
0
        //private void RedrawScroller()
        //{
        //    int sizeX = size.X;
        //    int sizeY = size.Y;

        //    switch (axis)
        //    {
        //        case Axis.Horizontal:
        //            sizeX = (int)(size.X / System.Math.Min(max, size.X / 20));
        //            sizeY -= 2;
        //            break;
        //        case Axis.Vertical:
        //            sizeY = (int)(size.Y / System.Math.Min(max, size.Y / 20));
        //            sizeX -= 2;
        //            break;
        //    }

        //    scrollerTex = new Texture2D(BaseGame.Device, sizeX, sizeY, 1, Control.resourceUsage, SurfaceFormat.Color);

        //    Color[] pixel = new Color[sizeX * sizeY];

        //    for (int y = 0; y < sizeY; y++)
        //    {
        //        for (int x = 0; x < sizeX; x++)
        //        {
        //            pixel[x + y * sizeX] = new Color(new Vector4(0.7f, 0.7f, 0.7f, 1f));

        //            float cX = pixel[x + y * sizeX].ToVector3().X;
        //            float cY = pixel[x + y * sizeX].ToVector3().X;
        //            float cZ = pixel[x + y * sizeX].ToVector3().X;

        //            if (x < 2 || y < 2)
        //            {
        //                cX *= 1.15f;
        //                cY *= 1.15f;
        //                cZ *= 1.15f;
        //            }
        //            else if (x > sizeX - 3 || y > sizeY - 3)
        //            {
        //                cX *= .75f;
        //                cY *= .75f;
        //                cZ *= .75f;
        //            }

        //            pixel[x + y * sizeX] = new Color(new Vector4(cX, cY, cZ, 1f));
        //        }
        //    }

        //    scrollerTex.SetData<Color>(pixel);
        //}



        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            //Texture2D visibleBuff = new Texture2D(curGameDrawComponents._graphicsDevice, rectControl.Width, (int)Model.Utilities.getTextHeight(scrlPnlText,curGameDrawComponents._staticFonts));


            //GraphicsDevice mgd = curGameDrawComponents._graphicsDevice;
            //mgd.Viewport.Height = rectControl.Height;



            //ScrollPanel
            curGameDrawComponents._spriteBatch.Draw(this.scrollPanelImg, this.rectControl, Color.White);

            //visibleBuff.
            //Effect scrlPnlFX = curGameDrawComponents._Content.Load<Effect>("scrollPanelFX");



            //spr
            //scrlPnlFX.Parameters["fShieldFacing"].SetValue(shieldFacing);
            //scrlPnlFX.Parameters["fShieldSize"].SetValue(shieldSize);
            //scrlPnlFX.Parameters["fShieldInnerRadius"].SetValue(shieldInnerRadius);


            //Display Description
            Vector2 descVector = new Vector2(this.rectControl.X + 10, this.rectControl.Y + 10);

            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, Model.Utilities.parseTextWidthHeight(this.scrlPnlText, this.rectControl.Width - 60, this.rectControl.Height - 20, curGameDrawComponents._staticFonts), descVector, Color.Black);
        }
        //Draw Commands
        public void Draw(GameDrawClassComponents curGameDrawClassComponents)
        {
            if (!_isNull)
            {
                menuBackground.Draw(curGameDrawClassComponents);

                //Display build time and cost.

                /////Implement later. This is temp gap solution?!?
                if (!curGameDrawClassComponents._staticDataCards._isNull)
                {
                    Vector2 vectManuTime = new Vector2(110, 250);
                    Vector2 vectManuCost = new Vector2(110, 300);

                    string strFacilityTypeName = facilityTypeDropDown.textOptions[facilityTypeDropDown.selectedIndex];

                    DataCards.Facility facilCheck = curGameDrawClassComponents._staticDataCards.getFacilityByName(strFacilityTypeName);

                    string strManuTimeDisplay = "Construction Day(s): " + facilCheck.baseManufactureCost.BaseConstructionTime.ToString();

                    string strManuCostDisplay = "Construction Cost: " + facilCheck.baseManufactureCost.ResourceCost.ToString();

                    curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, strManuTimeDisplay, vectManuTime, Color.Black);

                    curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, strManuCostDisplay, vectManuCost, Color.Black);
                }

                displayButtonsInMenu(curGameDrawClassComponents);

                destinationDropDown.Draw(curGameDrawClassComponents);

                facilityTypeDropDown.Draw(curGameDrawClassComponents);

            }
        }
예제 #5
0
        //Draw Methods


        //public void drawStartMenu(SpriteBatch spriteBatch, Model.StaticFonts curStaticFonts)
        public void drawStartMenu(GameDrawClassComponents curGameDrawComponents)
        {
            checkMenuStates();


            if (_startMenu._isVisible)
            {
                curGameDrawComponents._spriteBatch.Begin();

                //Display Background Image
                //spriteBatch.Draw(_startMenu.backgroundTexture, _startMenu.backgroundVector, Color.White);

                //Display Header
                //Vector2 textVector = new Vector2(curControl.vectorPos.X + 10, curControl.vectorPos.Y + 10);
                curGameDrawComponents._spriteBatch.DrawString(_startMenu.headerFont, _startMenu.strHeaderText, _startMenu.headerVector, Color.Black);

                //Display Menu Buttons
                displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, _startMenu.menuButtons);

                //Display Meny Radio Button Controls
                //displayRadioButtonControlsInMenu(curControl.menuRadioButtonControls);



                //Display Active Forms Controls
                displayActiveMenuControls(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts);

                curGameDrawComponents._spriteBatch.End();
            }
        }
예제 #6
0
        //public GameInformationMenu()
        //{
        //    _isNull = true;
        //    _isEnabled = false;

        //    HeaderText = "";
        //    Description = "";

        //    menuVector = new Vector2();

        //    //dataCardType = GalacticConquest.Model.DataCardType.
        //}



        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            curGameDrawComponents._spriteBatch.Draw(this.imageToDisplay, this.menuVector, Color.White);


            //Display Menu Header
            Vector2 textVector = new Vector2(this.menuVector.X + 10, this.menuVector.Y + 10);

            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, this.HeaderText, textVector, Color.Black);



            //Vector2 firstPlanetVector = new Vector2(LeftGPMenu.vectorPos.X + 10, LeftGPMenu.vectorPos.Y + 50);

            //Display Image


            //curInfoMenu.
            Model.XYStringToInt curTopLeft  = new Model.XYStringToInt(this.imgDTTopLeftXY);
            DataCards.Planet    curDataCard = (DataCards.Planet) this.tag;
            curGameDrawComponents._spriteBatch.Draw(Texture2D.FromFile(curGameDrawComponents._graphicsDevice, Model.DataUtilities._PlanetImagePath + curDataCard.Name + ".bmp"), new Vector2(curTopLeft.X, curTopLeft.Y), Color.White);

            //ScrollPanel
            scrlPnlDescriptionText.scrlPnlText = this.Description;
            scrlPnlDescriptionText.Draw(curGameDrawComponents);


            //Display Menu Buttons
            displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, this.menuButtons);
        }
예제 #7
0
 //Draw Methods
 public void Draw(GameDrawClassComponents curGameDrawComponents)
 {
     if (!this._isNull)
     {
         curGameDrawComponents._spriteBatch.Draw(this.menuImageToDisplay, this.menuVector, Color.White);
     }
 }
예제 #8
0
 //Draw Methods
 public void Draw(GameDrawClassComponents curGameDrawComponents)
 {
     if (!this._isNull)
     {
         curGameDrawComponents._spriteBatch.Draw(this.menuImageToDisplay, this.menuVector, Color.White);
     }
 }
예제 #9
0
        //Draw Commands

        public void Draw(GameDrawClassComponents curGameDrawClassComponents)
        {
            if (!_isNull)
            {
                Texture2D t = new Texture2D(curGameDrawClassComponents._graphicsDevice, 1, 1);
                t.SetData(new[] { backColor });


                curGameDrawClassComponents._spriteBatch.Draw(t, panelRect, backColor);


                //Draw Border
                curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Top, borderSize, panelRect.Height), borderColor);   // Left
                curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Right, panelRect.Top, borderSize, panelRect.Height), borderColor);  // Right
                curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Top, panelRect.Width, borderSize), borderColor);    // Top
                curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Bottom, panelRect.Width, borderSize), borderColor); // Bottom



                DrawDataCardIcons(curGameDrawClassComponents);


                displayButtonsInMenu(curGameDrawClassComponents);
            }
        }
예제 #10
0
 //Draw Methods
 public void Draw(GameDrawClassComponents curGameDrawComponents)
 {
     if (!this._isNull)
     {
         curGameDrawComponents._spriteBatch.Draw(this.menuImageToDisplay, this.menuVector, Color.White);
         displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, menuButtons);
     }
 }
예제 #11
0
 //Draw Methods
 public void Draw(GameDrawClassComponents curGameDrawComponents)
 {
     if (!this._isNull)
     {
         curGameDrawComponents._spriteBatch.Draw(this.menuImageToDisplay, this.menuVector, Color.White);
         displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, menuButtons);
     }
 }
        public void Draw(GameDrawClassComponents curGameDrawClassComponents)
        {
            if (dropDownCollapsed)
            {
                DrawObj.DrawHelper.DrawRectangle(curGameDrawClassComponents, backColor, dropDownBoxRect, borderColor, borderSize);

                Vector2 arrowVector = new Vector2(dropDownBoxRect.X + dropDownBoxRect.Width, dropDownBoxRect.Y);
                dropDownBoxArrow.VectorPosition = arrowVector;

                dropDownBoxArrow.Draw(curGameDrawClassComponents);

                Color textColor = Color.Black;

                Vector2 textVector = new Vector2(dropDownBoxRect.X, dropDownBoxRect.Y);

                curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, textOptions[selectedIndex], textVector, textColor);

                //curGameDrawClassComponents._spriteBatch.Draw(dropDownBoxArrow.spriteTexture, Model.Utilities.getRectFromTexture2D(dropDownBoxArrow), Color.White);

            }
            else
            {
                string strTextOpts = "";
                int itemsToShow = maxItemsToShow;
                if (textOptions.Count < maxItemsToShow)
                    itemsToShow = textOptions.Count;

                for (int i = 0; i < itemsToShow; i++)
                {
                    if (i != itemsToShow - 1)
                        strTextOpts += textOptions[i] + "\n";
                    else
                        strTextOpts += textOptions[i];
                }

                //strTextOpts = textOptions[selectedIndex] + "\n" + strTextOpts;

                float textHeight = Model.Utilities.getTextHeight(strTextOpts, curGameDrawClassComponents._staticFonts);

                Rectangle expandedDropDownBoxRect = dropDownBoxRect;
                expandedDropDownBoxRect.Height = (int)textHeight;

                DrawObj.DrawHelper.DrawRectangle(curGameDrawClassComponents, backColor, expandedDropDownBoxRect, borderColor, borderSize);

                Vector2 arrowVector = new Vector2(dropDownBoxRect.X + dropDownBoxRect.Width, dropDownBoxRect.Y);
                dropDownBoxArrow.VectorPosition = arrowVector;

                dropDownBoxArrow.Draw(curGameDrawClassComponents);

                Color textColor = Color.Black;

                Vector2 textVector = new Vector2(dropDownBoxRect.X, dropDownBoxRect.Y);

                curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, strTextOpts, textVector, textColor);

            }
        }
예제 #13
0
 public void displayButtonsInMenu(GameDrawClassComponents curGameDrawClassComponents)
 {
     foreach (Controls.FancyButtonControl curButton in menuButtons)
     {
         if (!curButton._isNull)
         {
             curButton.Draw(curGameDrawClassComponents._spriteBatch, curGameDrawClassComponents._staticFonts);
         }
     }
 }
 public void displayButtonsInMenu(GameDrawClassComponents curGameDrawClassComponents)
 {
     foreach (Controls.FancyButtonControl curButton in menuButtons)
     {
         if (!curButton._isNull)
         {
             curButton.Draw(curGameDrawClassComponents._spriteBatch, curGameDrawClassComponents._staticFonts);
         }
     }
 }
예제 #15
0
        public static void DrawRectangle(GameDrawClassComponents curGameDrawClassComponents, Color backColor, Rectangle panelRect, Color borderColor, int borderSize)
        {
            Texture2D t = new Texture2D(curGameDrawClassComponents._graphicsDevice, 1, 1);
            t.SetData(new[] { backColor });

            curGameDrawClassComponents._spriteBatch.Draw(t, panelRect, backColor);

            //Draw Border
            curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Top, borderSize, panelRect.Height), borderColor); // Left
            curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Right, panelRect.Top, borderSize, panelRect.Height), borderColor); // Right
            curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Top, panelRect.Width, borderSize), borderColor); // Top
            curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Bottom, panelRect.Width, borderSize), borderColor); // Bottom
        }
예제 #16
0
        public void updateTopBarData(GameDrawClassComponents curGameDrawComponents, GameEngine.Player curPlayer, GameEngine.GalacticDayManager curGalacticDayMang)
        {
            int activeGameDayToShow = curGalacticDayMang.CurrentGalacticDay;
            //X:103 Y:10
            Vector2 curGameDayVector = new Vector2(103, 4);

            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, activeGameDayToShow.ToString(), curGameDayVector, Color.Black);

            int rawMaterialsToShow = curPlayer.curGameResourceMang.invRawMaterials;

            Vector2 curRMsVect = new Vector2(400, 4);

            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, rawMaterialsToShow.ToString(), curRMsVect, Color.Black);
        }
예제 #17
0
        public void updateTopBarData(GameDrawClassComponents curGameDrawComponents, GameEngine.Player curPlayer, GameEngine.GalacticDayManager curGalacticDayMang)
        {
            int activeGameDayToShow = curGalacticDayMang.CurrentGalacticDay;
            //X:103 Y:10
            Vector2 curGameDayVector = new Vector2(103, 4);

            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, activeGameDayToShow.ToString(), curGameDayVector, Color.Black);


            int rawMaterialsToShow = curPlayer.curGameResourceMang.invRawMaterials;

            Vector2 curRMsVect = new Vector2(400, 4);

            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, rawMaterialsToShow.ToString(), curRMsVect, Color.Black);
        }
예제 #18
0
        public void DrawDataCardIcons(GameDrawClassComponents curGameDrawClassComponents)
        {
            Vector2   originalStartingVector = new Vector2(panelRect.X + paddingForDataCards, panelRect.Y + paddingForDataCards);
            Vector2   startingVector         = new Vector2(panelRect.X + paddingForDataCards, panelRect.Y + paddingForDataCards);
            Rectangle curRect = new Rectangle();

            int counter = 1;

            foreach (Controls.DataCardIconControl curDataCard in dataCards)
            {
                curRect = curDataCard.rectControl;

                curRect.X = (int)startingVector.X;
                curRect.Y = (int)startingVector.Y;



                curGameDrawClassComponents._spriteBatch.Draw(curDataCard.imgControl, curRect, Color.White);

                Vector2 curVector = startingVector;
                curVector.Y += curDataCard.imgControl.Height + paddingForDataCards;

                /////////////////////
                //Make text drop-down based on image width//
                string displayText = Model.Utilities.parseText(curDataCard.strControlText, curRect.Width, curGameDrawClassComponents._staticFonts);

                curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, displayText, curVector, Color.White);

                ////////////////////////////
                //Loop back around with updated x coords :D
                startingVector.X += curDataCard.imgControl.Width + paddingForDataCards;

                if (counter == 5)
                {
                    //Reset counter
                    counter = 0;

                    //Move Y
                    startingVector.Y += curDataCard.imgControl.Height + 100;
                    //Reset X
                    startingVector.X = originalStartingVector.X;
                }



                counter++;
            }
        }
예제 #19
0
        public static void DrawRectangle(GameDrawClassComponents curGameDrawClassComponents, Color backColor, Rectangle panelRect, Color borderColor, int borderSize)
        {
            Texture2D t = new Texture2D(curGameDrawClassComponents._graphicsDevice, 1, 1);

            t.SetData(new[] { backColor });


            curGameDrawClassComponents._spriteBatch.Draw(t, panelRect, backColor);


            //Draw Border
            curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Top, borderSize, panelRect.Height), borderColor);   // Left
            curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Right, panelRect.Top, borderSize, panelRect.Height), borderColor);  // Right
            curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Top, panelRect.Width, borderSize), borderColor);    // Top
            curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Bottom, panelRect.Width, borderSize), borderColor); // Bottom
        }
예제 #20
0
        public void DrawDataCardIcons(GameDrawClassComponents curGameDrawClassComponents)
        {
            Vector2 originalStartingVector = new Vector2(panelRect.X+paddingForDataCards, panelRect.Y+paddingForDataCards);
            Vector2 startingVector = new Vector2(panelRect.X+paddingForDataCards, panelRect.Y+paddingForDataCards);
            Rectangle curRect = new Rectangle();

            int counter = 1;

            foreach (Controls.DataCardIconControl curDataCard in dataCards)
            {
                curRect = curDataCard.rectControl;

                curRect.X = (int)startingVector.X;
                curRect.Y = (int)startingVector.Y;

                curGameDrawClassComponents._spriteBatch.Draw(curDataCard.imgControl, curRect, Color.White);

                Vector2 curVector = startingVector;
                curVector.Y += curDataCard.imgControl.Height + paddingForDataCards;

                /////////////////////
                //Make text drop-down based on image width//
                string displayText = Model.Utilities.parseText(curDataCard.strControlText,curRect.Width,curGameDrawClassComponents._staticFonts);

                curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, displayText, curVector, Color.White);

                ////////////////////////////
                //Loop back around with updated x coords :D
                startingVector.X += curDataCard.imgControl.Width + paddingForDataCards;

                if(counter == 5)
                {
                    //Reset counter
                    counter = 0;

                    //Move Y
                    startingVector.Y += curDataCard.imgControl.Height + 100;
                    //Reset X
                    startingVector.X = originalStartingVector.X;
                }

                counter++;
            }
        }
예제 #21
0
        //Draw Commands
        public void Draw(GameDrawClassComponents curGameDrawClassComponents)
        {
            if (!_isNull)
            {
                Texture2D t = new Texture2D(curGameDrawClassComponents._graphicsDevice, 1, 1);
                t.SetData(new[] { backColor });

                curGameDrawClassComponents._spriteBatch.Draw(t, panelRect, backColor);

                //Draw Border
                curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Top, borderSize, panelRect.Height), borderColor); // Left
                curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Right, panelRect.Top, borderSize, panelRect.Height), borderColor); // Right
                curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Top, panelRect.Width, borderSize), borderColor); // Top
                curGameDrawClassComponents._spriteBatch.Draw(t, new Rectangle(panelRect.Left, panelRect.Bottom, panelRect.Width, borderSize), borderColor); // Bottom

                DrawDataCardIcons(curGameDrawClassComponents);

                displayButtonsInMenu(curGameDrawClassComponents);

            }
        }
예제 #22
0
        //Draw Commands
        public void Draw(GameDrawClassComponents curGameDrawClassComponents)
        {
            if (!_isNull)
            {
                menuBackground.Draw(curGameDrawClassComponents);


                //Display build time and cost.

                /////Implement later. This is temp gap solution?!?
                if (!curGameDrawClassComponents._staticDataCards._isNull)
                {
                    Vector2 vectManuTime = new Vector2(110, 250);
                    Vector2 vectManuCost = new Vector2(110, 300);

                    string strFacilityTypeName = facilityTypeDropDown.textOptions[facilityTypeDropDown.selectedIndex];

                    DataCards.Facility facilCheck = curGameDrawClassComponents._staticDataCards.getFacilityByName(strFacilityTypeName);

                    string strManuTimeDisplay = "Construction Day(s): " + facilCheck.baseManufactureCost.BaseConstructionTime.ToString();

                    string strManuCostDisplay = "Construction Cost: " + facilCheck.baseManufactureCost.ResourceCost.ToString();

                    curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, strManuTimeDisplay, vectManuTime, Color.Black);

                    curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, strManuCostDisplay, vectManuCost, Color.Black);
                }


                displayButtonsInMenu(curGameDrawClassComponents);



                destinationDropDown.Draw(curGameDrawClassComponents);

                facilityTypeDropDown.Draw(curGameDrawClassComponents);
            }
        }
        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            curGameDrawComponents._spriteBatch.Draw(this.menuImageToDisplay, this.menuVector, Color.White);


            //Display Menu Header
            Vector2 textVector = new Vector2(this.menuVector.X + 10, this.menuVector.Y + 10);

            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, this.HeaderText, textVector, Color.Black);



            DataCards.Planet curDataCard = (DataCards.Planet) this.tag;

            Vector2   planetImgVector = new Vector2(menuVector.X + 10, menuVector.Y + 65);
            Texture2D planetImg       = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, Model.DataUtilities._PlanetImagePath + curDataCard.Name + ".bmp");

            curGameDrawComponents._spriteBatch.Draw(planetImg, planetImgVector, Color.White);


            Vector2 groundSlotsDisplay = new Vector2(planetImgVector.X, planetImgVector.Y + planetImg.Height + 10);
            string  textToDisplay      = "Owner:\n" + curDataCard.Owner.Name;

            textToDisplay += "\n\nGround Slots:\n" + curDataCard.GroundSpaces.Facilities.Count.ToString() + "\\" + curDataCard.GroundSpaces.AllSpaces.ToString();
            textToDisplay += "\n\nFleets In Orbit:\n" + curDataCard.Orbit.StarshipFleetsInOrbit.Count.ToString();
            textToDisplay += "\n\nResources Per Day:\n" + curDataCard.RawMaterialsPerDay.ToString();
            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, textToDisplay, groundSlotsDisplay, Color.Black);

            //Display Menu Buttons
            displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, this.menuButtons);



            //Display Tab Control
            tabControl.Draw(curGameDrawComponents);
        }
예제 #24
0
        //public GameInformationMenu()
        //{
        //    _isNull = true;
        //    _isEnabled = false;
        //    HeaderText = "";
        //    Description = "";
        //    menuVector = new Vector2();
        //    //dataCardType = GalacticConquest.Model.DataCardType.
        //}
        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            curGameDrawComponents._spriteBatch.Draw(this.imageToDisplay, this.menuVector, Color.White);

            //Display Menu Header
            Vector2 textVector = new Vector2(this.menuVector.X + 10, this.menuVector.Y + 10);
            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, this.HeaderText, textVector, Color.Black);

            //Vector2 firstPlanetVector = new Vector2(LeftGPMenu.vectorPos.X + 10, LeftGPMenu.vectorPos.Y + 50);

            //Display Image

            //curInfoMenu.
            Model.XYStringToInt curTopLeft = new Model.XYStringToInt(this.imgDTTopLeftXY);
            DataCards.Planet curDataCard = (DataCards.Planet)this.tag;
            curGameDrawComponents._spriteBatch.Draw(Texture2D.FromFile(curGameDrawComponents._graphicsDevice, Model.DataUtilities._PlanetImagePath + curDataCard.Name + ".bmp"), new Vector2(curTopLeft.X, curTopLeft.Y), Color.White);

            //ScrollPanel
            scrlPnlDescriptionText.scrlPnlText = this.Description;
            scrlPnlDescriptionText.Draw(curGameDrawComponents);

            //Display Menu Buttons
            displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, this.menuButtons);
        }
예제 #25
0
        //////////////////////
        //Draw Methods
        public void displayGameScreen(GameDrawClassComponents curGameDrawComponents)
        {
            ///////////////////////////////////////////////////////////////////////////////////////////////////////
            //Start the Sprite Batch drawing// All draw methods rely on this Begin process.
            curGameDrawComponents._spriteBatch.Begin();

            //Draw Galactic Map
            MainMapControl.Draw(curGameDrawComponents);

            TopBarControl.Draw(curGameDrawComponents);
            TopBarControl.updateTopBarData(curGameDrawComponents, Player1, curGalacticDayMang);

            RightBarControl.Draw(curGameDrawComponents);

            updateGalaxyPlanetForms(curGameDrawComponents);

            displayInfoMenu(curGameDrawComponents);

            displayPlanetCommandMenu(curGameDrawComponents);

            displayConstructionMenu(curGameDrawComponents);

            curGameDrawComponents._spriteBatch.End();
            //End the Sprite Batch drawing// All draw methods rely on the Begin process and this End cleanup.
            ///////////////////////////////////////////////////////////////////////////////////////////////////////
        }
예제 #26
0
        //Draw Methods
        //public void drawStartMenu(SpriteBatch spriteBatch, Model.StaticFonts curStaticFonts)
        public void drawStartMenu(GameDrawClassComponents curGameDrawComponents)
        {
            checkMenuStates();

            if (_startMenu._isVisible)
            {
                curGameDrawComponents._spriteBatch.Begin();

                //Display Background Image
                //spriteBatch.Draw(_startMenu.backgroundTexture, _startMenu.backgroundVector, Color.White);

                //Display Header
                //Vector2 textVector = new Vector2(curControl.vectorPos.X + 10, curControl.vectorPos.Y + 10);
                curGameDrawComponents._spriteBatch.DrawString(_startMenu.headerFont, _startMenu.strHeaderText, _startMenu.headerVector, Color.Black);

                //Display Menu Buttons
                displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, _startMenu.menuButtons);

                //Display Meny Radio Button Controls
                //displayRadioButtonControlsInMenu(curControl.menuRadioButtonControls);

                //Display Active Forms Controls
                displayActiveMenuControls(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts);

                curGameDrawComponents._spriteBatch.End();
            }
        }
        //private void RedrawScroller()
        //{
        //    int sizeX = size.X;
        //    int sizeY = size.Y;
        //    switch (axis)
        //    {
        //        case Axis.Horizontal:
        //            sizeX = (int)(size.X / System.Math.Min(max, size.X / 20));
        //            sizeY -= 2;
        //            break;
        //        case Axis.Vertical:
        //            sizeY = (int)(size.Y / System.Math.Min(max, size.Y / 20));
        //            sizeX -= 2;
        //            break;
        //    }
        //    scrollerTex = new Texture2D(BaseGame.Device, sizeX, sizeY, 1, Control.resourceUsage, SurfaceFormat.Color);
        //    Color[] pixel = new Color[sizeX * sizeY];
        //    for (int y = 0; y < sizeY; y++)
        //    {
        //        for (int x = 0; x < sizeX; x++)
        //        {
        //            pixel[x + y * sizeX] = new Color(new Vector4(0.7f, 0.7f, 0.7f, 1f));
        //            float cX = pixel[x + y * sizeX].ToVector3().X;
        //            float cY = pixel[x + y * sizeX].ToVector3().X;
        //            float cZ = pixel[x + y * sizeX].ToVector3().X;
        //            if (x < 2 || y < 2)
        //            {
        //                cX *= 1.15f;
        //                cY *= 1.15f;
        //                cZ *= 1.15f;
        //            }
        //            else if (x > sizeX - 3 || y > sizeY - 3)
        //            {
        //                cX *= .75f;
        //                cY *= .75f;
        //                cZ *= .75f;
        //            }
        //            pixel[x + y * sizeX] = new Color(new Vector4(cX, cY, cZ, 1f));
        //        }
        //    }
        //    scrollerTex.SetData<Color>(pixel);
        //}
        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            //Texture2D visibleBuff = new Texture2D(curGameDrawComponents._graphicsDevice, rectControl.Width, (int)Model.Utilities.getTextHeight(scrlPnlText,curGameDrawComponents._staticFonts));

            //GraphicsDevice mgd = curGameDrawComponents._graphicsDevice;
            //mgd.Viewport.Height = rectControl.Height;

            //ScrollPanel
            curGameDrawComponents._spriteBatch.Draw(this.scrollPanelImg, this.rectControl, Color.White);

            //visibleBuff.
            //Effect scrlPnlFX = curGameDrawComponents._Content.Load<Effect>("scrollPanelFX");

            //spr
            //scrlPnlFX.Parameters["fShieldFacing"].SetValue(shieldFacing);
            //scrlPnlFX.Parameters["fShieldSize"].SetValue(shieldSize);
            //scrlPnlFX.Parameters["fShieldInnerRadius"].SetValue(shieldInnerRadius);

            //Display Description
            Vector2 descVector = new Vector2(this.rectControl.X + 10, this.rectControl.Y + 10);
            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, Model.Utilities.parseTextWidthHeight(this.scrlPnlText, this.rectControl.Width - 60, this.rectControl.Height - 20, curGameDrawComponents._staticFonts), descVector, Color.Black);
        }
예제 #28
0
        //Draw Methods

        public void Draw(GameDrawClassComponents curGameDrawClassComponents, List <DataCards.Planet> planetList)
        {
            curGameDrawClassComponents._spriteBatch.Draw(this.imgControl, this.vectorPos, Color.White);


            //Display Menu Header
            Vector2 textVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 10);

            curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, this.strControlHeader, textVector, Color.Black);



            Vector2 firstPlanetVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 50);

            int i = 0;

            //Display Planets
            foreach (GameEngine.PlayerInvObjs.InvUnit curInvUnit in this.menuInvUnits)
            {
                string planetImagePath = "";

                if (curInvUnit.transitObj._inTransit)
                {
                    planetImagePath = Model.DataUtilities._ShipsImagePath + "Hyper.jpg";
                }
                else
                {
                    if (System.IO.File.Exists(Model.DataUtilities._ShipsImagePath + curInvUnit.iuShip.Name + ".jpg"))
                    {
                        planetImagePath = Model.DataUtilities._ShipsImagePath + curInvUnit.iuShip.Name + ".jpg";
                    }
                    else
                    {
                        planetImagePath = Model.DataUtilities._ShipsImagePath + "UnknownShipImage.jpg";
                    }
                }


                Texture2D curPlanetImg = Texture2D.FromFile(curGameDrawClassComponents._graphicsDevice, planetImagePath);
                //Display Planet Image
                curGameDrawClassComponents._spriteBatch.Draw(curPlanetImg, firstPlanetVector, Color.White);

                Vector2 planetHeaderTextVector = new Vector2();
                planetHeaderTextVector.X = firstPlanetVector.X + 70;
                planetHeaderTextVector.Y = firstPlanetVector.Y;
                //Displat Planet Header text
                curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, curInvUnit.iuShip.HeaderText, planetHeaderTextVector, Color.Black);


                Vector2 ddlVector = new Vector2();
                ddlVector.X = firstPlanetVector.X + 170;
                ddlVector.Y = firstPlanetVector.Y;

                Controls.FancyDropDownBoxControl myfancyDDL = menuDropDownBoxControls[i];
                //myfancyDDL._isEnabled = true;

                //myfancyDDL.dropDownBoxRect = new Rectangle((int)ddlVector.X, (int)ddlVector.Y, 125, 50);

                //myfancyDDL.backColor = Color.Red;
                //myfancyDDL.borderColor = Color.White;
                //myfancyDDL.borderSize = 2;
                //myfancyDDL.dropDownBoxArrow = new DrawObj.Sprite("mdDDLSprite", ddlVector, curGameDrawClassComponents._staticTextureImages._dropDownArrowTexture);
                //myfancyDDL.dropDownCollapsed = true;
                //myfancyDDL.selectedIndex = 0;


                //menuDropDownBoxControls.Add(myfancyDDL);

                List <string> strLstPlanets = new List <string>();

                foreach (DataCards.Planet curPlanet in planetList)
                {
                    strLstPlanets.Add(curPlanet.Name);
                }

                //myfancyDDL.textOptions = strLstPlanets;



                myfancyDDL.Draw(curGameDrawClassComponents);


                //Displat Planet Header text
                //curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, curInvUnit.iuShip.HeaderText, planetHeaderTextVector, Color.Black);


                i++;

                firstPlanetVector.Y += curPlanetImg.Height + 60;
            }


            //Display Menu Buttons
            displayButtonsInMenu(curGameDrawClassComponents._spriteBatch, curGameDrawClassComponents._staticFonts, this.menuButtons);
        }
예제 #29
0
        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            curGameDrawComponents._spriteBatch.Draw(this.menuImageToDisplay, this.menuVector, Color.White);

            //Display Menu Header
            Vector2 textVector = new Vector2(this.menuVector.X + 10, this.menuVector.Y + 10);
            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, this.HeaderText, textVector, Color.Black);

            DataCards.Planet curDataCard = (DataCards.Planet)this.tag;

            Vector2 planetImgVector = new Vector2(menuVector.X + 10, menuVector.Y + 65);
            Texture2D planetImg = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, Model.DataUtilities._PlanetImagePath + curDataCard.Name + ".bmp");

            curGameDrawComponents._spriteBatch.Draw(planetImg, planetImgVector, Color.White);

            Vector2 groundSlotsDisplay = new Vector2(planetImgVector.X, planetImgVector.Y + planetImg.Height + 10);
            string textToDisplay = "Owner:\n" + curDataCard.Owner.Name;
            textToDisplay += "\n\nGround Slots:\n" + curDataCard.GroundSpaces.Facilities.Count.ToString() + "\\" + curDataCard.GroundSpaces.AllSpaces.ToString();
            textToDisplay += "\n\nFleets In Orbit:\n" + curDataCard.Orbit.StarshipFleetsInOrbit.Count.ToString();
            textToDisplay += "\n\nResources Per Day:\n" + curDataCard.RawMaterialsPerDay.ToString();
            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, textToDisplay, groundSlotsDisplay, Color.Black);

            //Display Menu Buttons
            displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, this.menuButtons);

            //Display Tab Control
            tabControl.Draw(curGameDrawComponents);
        }
예제 #30
0
        public void displayInfoMenu(GameDrawClassComponents curGameDrawComponents)
        {
            Controls.GameInformationMenu curInfoMenu = this.InfoMenu;

            if (!curInfoMenu._isNull)
            {
                curInfoMenu.Draw(curGameDrawComponents);
            }
        }
        //Draw Methods

        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            curGameDrawComponents._spriteBatch.Draw(this.imgControl, this.vectorPos, Color.White);


            //Display Menu Header
            Vector2 textVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 10);

            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, this.strControlHeader, textVector, Color.Black);



            Vector2 firstPlanetVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 50);

            //Display Planets
            foreach (DataCards.Planet curPlanet in this.menuPlanetControls)
            {
                string planetImagePath = Model.DataUtilities._PlanetImagePath + curPlanet.Name + "50x50.bmp";

                Texture2D curPlanetImg = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, planetImagePath);
                //Display Planet Image
                curGameDrawComponents._spriteBatch.Draw(curPlanetImg, firstPlanetVector, Color.White);

                Vector2 planetHeaderTextVector = new Vector2();
                planetHeaderTextVector.X = firstPlanetVector.X + 70;
                planetHeaderTextVector.Y = firstPlanetVector.Y;
                //Displat Planet Header text
                curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, curPlanet.HeaderText, planetHeaderTextVector, Color.Black);

                //Display Planet Buttons
                string infoBtnImagePath = Model.DataUtilities._ButtonsImagePath + "30x30InfoButton.bmp";

                Texture2D curInfoBtnImg = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, infoBtnImagePath);

                planetHeaderTextVector.X += 275;

                curGameDrawComponents._spriteBatch.Draw(curInfoBtnImg, planetHeaderTextVector, Color.White);

                string commandBtnImagePath = Model.DataUtilities._ButtonsImagePath + "30x30CommandButton.bmp";

                Texture2D curCommandBtnImg = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, commandBtnImagePath);

                planetHeaderTextVector.X += 50;


                curGameDrawComponents._spriteBatch.Draw(curCommandBtnImg, planetHeaderTextVector, Color.White);


                string orbitBtnImagePath = Model.DataUtilities._ButtonsImagePath + "26x28ShipsButton.bmp";

                Texture2D curOrbitBtnImg = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, orbitBtnImagePath);

                planetHeaderTextVector.X += 50;


                curGameDrawComponents._spriteBatch.Draw(curOrbitBtnImg, planetHeaderTextVector, Color.White);


                firstPlanetVector.Y += 60;
            }


            //Display Menu Buttons
            displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, this.menuButtons);
        }
예제 #32
0
        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawClassComponents, List<DataCards.Planet> planetList)
        {
            curGameDrawClassComponents._spriteBatch.Draw(this.imgControl, this.vectorPos, Color.White);

            //Display Menu Header
            Vector2 textVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 10);
            curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, this.strControlHeader, textVector, Color.Black);

            Vector2 firstPlanetVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 50);

            int i = 0;

            //Display Planets
            foreach (GameEngine.PlayerInvObjs.InvUnit curInvUnit in this.menuInvUnits)
            {
                string planetImagePath = "";

                if (curInvUnit.transitObj._inTransit)
                {
                    planetImagePath = Model.DataUtilities._ShipsImagePath + "Hyper.jpg";
                }
                else
                {
                    if(System.IO.File.Exists(Model.DataUtilities._ShipsImagePath + curInvUnit.iuShip.Name + ".jpg"))
                        planetImagePath = Model.DataUtilities._ShipsImagePath + curInvUnit.iuShip.Name + ".jpg";
                    else
                        planetImagePath = Model.DataUtilities._ShipsImagePath + "UnknownShipImage.jpg";
                }

                Texture2D curPlanetImg = Texture2D.FromFile(curGameDrawClassComponents._graphicsDevice, planetImagePath);
                //Display Planet Image
                curGameDrawClassComponents._spriteBatch.Draw(curPlanetImg, firstPlanetVector, Color.White);

                Vector2 planetHeaderTextVector = new Vector2();
                planetHeaderTextVector.X = firstPlanetVector.X + 70;
                planetHeaderTextVector.Y = firstPlanetVector.Y;
                //Displat Planet Header text
                curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, curInvUnit.iuShip.HeaderText, planetHeaderTextVector, Color.Black);

                Vector2 ddlVector = new Vector2();
                ddlVector.X = firstPlanetVector.X + 170;
                ddlVector.Y = firstPlanetVector.Y;

                Controls.FancyDropDownBoxControl myfancyDDL = menuDropDownBoxControls[i];
                //myfancyDDL._isEnabled = true;

                //myfancyDDL.dropDownBoxRect = new Rectangle((int)ddlVector.X, (int)ddlVector.Y, 125, 50);

                //myfancyDDL.backColor = Color.Red;
                //myfancyDDL.borderColor = Color.White;
                //myfancyDDL.borderSize = 2;
                //myfancyDDL.dropDownBoxArrow = new DrawObj.Sprite("mdDDLSprite", ddlVector, curGameDrawClassComponents._staticTextureImages._dropDownArrowTexture);
                //myfancyDDL.dropDownCollapsed = true;
                //myfancyDDL.selectedIndex = 0;

                //menuDropDownBoxControls.Add(myfancyDDL);

                List<string> strLstPlanets = new List<string>();

                foreach (DataCards.Planet curPlanet in planetList)
                {
                    strLstPlanets.Add(curPlanet.Name);
                }

                //myfancyDDL.textOptions = strLstPlanets;

                myfancyDDL.Draw(curGameDrawClassComponents);

                //Displat Planet Header text
                //curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, curInvUnit.iuShip.HeaderText, planetHeaderTextVector, Color.Black);

                i++;

                firstPlanetVector.Y += curPlanetImg.Height + 60;
            }

            //Display Menu Buttons
            displayButtonsInMenu(curGameDrawClassComponents._spriteBatch, curGameDrawClassComponents._staticFonts, this.menuButtons);
        }
예제 #33
0
 public void displayConstructionMenu(GameDrawClassComponents curGameDrawComponents)
 {
     curGameDrawComponents._staticDataCards = staticDataCards;
     ConstructionMenu.Draw(curGameDrawComponents);
 }
예제 #34
0
        public void displayPlanetCommandMenu(GameDrawClassComponents curGameDrawComponents)
        {
            Controls.PlanetCommandControl curPlanetCommandMenu = this.PlanetCommandMenu;

            if (!curPlanetCommandMenu._isNull)
            {
                curPlanetCommandMenu.Draw(curGameDrawComponents);

            }
        }
예제 #35
0
 //Draw Commands
 public void Draw(GameDrawClassComponents curGameDrawClassComponents)
 {
     curGameDrawClassComponents._spriteBatch.Draw(spriteTexture, Model.Utilities.getRectFromTexture2D(spriteTexture,VectorPosition), Color.White);
 }
        public void Draw(GameDrawClassComponents curGameDrawClassComponents)
        {
            if (dropDownCollapsed)
            {
                DrawObj.DrawHelper.DrawRectangle(curGameDrawClassComponents, backColor, dropDownBoxRect, borderColor, borderSize);

                Vector2 arrowVector = new Vector2(dropDownBoxRect.X + dropDownBoxRect.Width, dropDownBoxRect.Y);
                dropDownBoxArrow.VectorPosition = arrowVector;

                dropDownBoxArrow.Draw(curGameDrawClassComponents);

                Color textColor = Color.Black;

                Vector2 textVector = new Vector2(dropDownBoxRect.X, dropDownBoxRect.Y);

                curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, textOptions[selectedIndex], textVector, textColor);

                //curGameDrawClassComponents._spriteBatch.Draw(dropDownBoxArrow.spriteTexture, Model.Utilities.getRectFromTexture2D(dropDownBoxArrow), Color.White);
            }
            else
            {
                string strTextOpts = "";
                int    itemsToShow = maxItemsToShow;
                if (textOptions.Count < maxItemsToShow)
                {
                    itemsToShow = textOptions.Count;
                }



                for (int i = 0; i < itemsToShow; i++)
                {
                    if (i != itemsToShow - 1)
                    {
                        strTextOpts += textOptions[i] + "\n";
                    }
                    else
                    {
                        strTextOpts += textOptions[i];
                    }
                }


                //strTextOpts = textOptions[selectedIndex] + "\n" + strTextOpts;

                float textHeight = Model.Utilities.getTextHeight(strTextOpts, curGameDrawClassComponents._staticFonts);


                Rectangle expandedDropDownBoxRect = dropDownBoxRect;
                expandedDropDownBoxRect.Height = (int)textHeight;

                DrawObj.DrawHelper.DrawRectangle(curGameDrawClassComponents, backColor, expandedDropDownBoxRect, borderColor, borderSize);

                Vector2 arrowVector = new Vector2(dropDownBoxRect.X + dropDownBoxRect.Width, dropDownBoxRect.Y);
                dropDownBoxArrow.VectorPosition = arrowVector;

                dropDownBoxArrow.Draw(curGameDrawClassComponents);

                Color textColor = Color.Black;

                Vector2 textVector = new Vector2(dropDownBoxRect.X, dropDownBoxRect.Y);

                curGameDrawClassComponents._spriteBatch.DrawString(curGameDrawClassComponents._staticFonts._courierNew, strTextOpts, textVector, textColor);
            }
        }
예제 #37
0
        public void updateGalaxyPlanetForms(GameDrawClassComponents curGameDrawComponents)
        {
            Controls.PlanetsInGalaxyMenu LeftGPMenu = this.LeftPlanetMenu;

            if (!LeftGPMenu._isNull)
            {
                LeftGPMenu.Draw(curGameDrawComponents);
            }

            Controls.PlanetOrbitControl LeftOrbitMenu = this.LeftPlanetOrbitMenu;

            if (!LeftOrbitMenu._isNull)
            {

                LeftOrbitMenu.Draw(curGameDrawComponents, curGameUniverse.getAllPlanetsList());
            }
        }
예제 #38
0
        //Draw Methods
        public void Draw(GameDrawClassComponents curGameDrawComponents)
        {
            curGameDrawComponents._spriteBatch.Draw(this.imgControl, this.vectorPos, Color.White);

            //Display Menu Header
            Vector2 textVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 10);
            curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, this.strControlHeader, textVector, Color.Black);

            Vector2 firstPlanetVector = new Vector2(this.vectorPos.X + 10, this.vectorPos.Y + 50);

            //Display Planets
            foreach (DataCards.Planet curPlanet in this.menuPlanetControls)
            {
                string planetImagePath = Model.DataUtilities._PlanetImagePath + curPlanet.Name + "50x50.bmp";

                Texture2D curPlanetImg = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, planetImagePath);
                //Display Planet Image
                curGameDrawComponents._spriteBatch.Draw(curPlanetImg, firstPlanetVector, Color.White);

                Vector2 planetHeaderTextVector = new Vector2();
                planetHeaderTextVector.X = firstPlanetVector.X + 70;
                planetHeaderTextVector.Y = firstPlanetVector.Y;
                //Displat Planet Header text
                curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, curPlanet.HeaderText, planetHeaderTextVector, Color.Black);

                //Display Planet Buttons
                string infoBtnImagePath = Model.DataUtilities._ButtonsImagePath + "30x30InfoButton.bmp";

                Texture2D curInfoBtnImg = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, infoBtnImagePath);

                planetHeaderTextVector.X += 275;

                curGameDrawComponents._spriteBatch.Draw(curInfoBtnImg, planetHeaderTextVector, Color.White);

                string commandBtnImagePath = Model.DataUtilities._ButtonsImagePath + "30x30CommandButton.bmp";

                Texture2D curCommandBtnImg = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, commandBtnImagePath);

                planetHeaderTextVector.X += 50;

                curGameDrawComponents._spriteBatch.Draw(curCommandBtnImg, planetHeaderTextVector, Color.White);

                string orbitBtnImagePath = Model.DataUtilities._ButtonsImagePath + "26x28ShipsButton.bmp";

                Texture2D curOrbitBtnImg = Texture2D.FromFile(curGameDrawComponents._graphicsDevice, orbitBtnImagePath);

                planetHeaderTextVector.X += 50;

                curGameDrawComponents._spriteBatch.Draw(curOrbitBtnImg, planetHeaderTextVector, Color.White);

                firstPlanetVector.Y += 60;
            }

            //Display Menu Buttons
            displayButtonsInMenu(curGameDrawComponents._spriteBatch, curGameDrawComponents._staticFonts, this.menuButtons);
        }
예제 #39
0
 //Draw Commands
 public void Draw(GameDrawClassComponents curGameDrawClassComponents)
 {
     curGameDrawClassComponents._spriteBatch.Draw(spriteTexture, Model.Utilities.getRectFromTexture2D(spriteTexture, VectorPosition), Color.White);
 }