コード例 #1
0
 /// <summary>
 /// Constructs a box to display whatever text is needed.
 /// </summary>
 /// <param name="position">Top left of the box's position.</param>
 /// <param name="initalString">String to be displayed.</param>
 public TextBox(Rectangle position, string initalString = "")
 {
     this.position = position;
     textBuffer = initalString;
     holder = InterfaceTextureHolder.Holder;
     font = holder.Fonts[(int)ConstantHolder.Fonts.defaultFont];
     backgroundSprite = holder.GUISprites[(int)ConstantHolder.GUIMemberImages.ExperienceBar].copySprite();//TBI:An actual textbox background.
     maxVerticalLines = (int)(position.Height/ font.MeasureString("The quick brown fox jumps over the lazy dog 0123456789!@#$%^&*{}[]()\"'\\").Y) + 4;
     textLines = new string[maxVerticalLines];
     for (int i = 0; i < maxVerticalLines; i++)
     {
         textLines[i] = "\n";
     }
 }
コード例 #2
0
        /// <summary>
        /// Creates a GUI element to show information about the selected Person and their abilities.
        /// </summary>
        /// <param name="CharacterLifeRect">Game screen area to draw the portrait, life and energy bars, any AbilityEffect icons, and level information</param>
        /// <param name="abilityAreaRect">Area to display the ability buttons, as well as the experience bar if the selected person is a hero.</param>
        public CharacterBox(Rectangle CharacterLifeRect, Rectangle abilityAreaRect)
        {
            Options = new TextButton[4];
        
            HealthBox = CharacterLifeRect;
            ExpBarBox = abilityAreaRect;
            Rectangle buttonRect = new Rectangle(ExpBarBox.X + 10, ExpBarBox.Y + 10, (ExpBarBox.Width - 25) / 4, ExpBarBox.Height - 50);
            interfaceHolder = InterfaceTextureHolder.Holder;
            combatHolder = CombatTextureHolder.Holder;

            Options[0] = new TextButton(buttonRect, interfaceHolder.ButtonSprites[(int)ConstantHolder.ButtonBackgrounds.Exit].copySprite(),
                buttonZero, interfaceHolder.Fonts[(int)ConstantHolder.Fonts.defaultFont], 
                "Yo, dawg.");
            
            buttonRect.X += (ExpBarBox.Width - 25) / 4 + 5;

            Options[1] = new TextButton(buttonRect, interfaceHolder.ButtonSprites[(int)ConstantHolder.ButtonBackgrounds.Exit].copySprite(),
                buttonOne, interfaceHolder.Fonts[(int)ConstantHolder.Fonts.defaultFont], "Sup, son.");
            
            buttonRect.X += (ExpBarBox.Width - 25) / 4 + 5;
            Options[2] = new TextButton(buttonRect, interfaceHolder.ButtonSprites[(int)ConstantHolder.ButtonBackgrounds.Exit].copySprite(),
                buttonTwo, interfaceHolder.Fonts[(int)ConstantHolder.Fonts.defaultFont], "I heard you liek mudkips");
            
            buttonRect.X += (ExpBarBox.Width - 25) / 4 + 5;
            Options[3] = new TextButton(buttonRect, interfaceHolder.ButtonSprites[(int)ConstantHolder.ButtonBackgrounds.Exit].copySprite(),
                buttonThree, interfaceHolder.Fonts[(int)ConstantHolder.Fonts.defaultFont], "Bro do you even lift?");


            healthPanelBackground = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.PortraitBackground].copySprite();
            abilityPanelBackground = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.AbilityBackground].copySprite();
            mouseoverBackground = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.MouseOverBackground].copySprite();
            healthPanelFrame = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.PortraitFrame].copySprite();
            abilityPanelFrame = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.AbilityFrame].copySprite();
            mouseOverFrame = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.MouseOverFrame].copySprite();
            healthBar = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.HealthBar].copySprite();
            healthBarM = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.HealthBar].copySprite();
            energyBar = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.EnergyBar].copySprite();
            energyBarM = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.EnergyBar].copySprite();
            experienceBar = interfaceHolder.GUISprites[(int)ConstantHolder.GUIMemberImages.ExperienceBar].copySprite();
        }
コード例 #3
0
 /// <summary>
 /// Gets the TextureHolder, and sets up the list of views.
 /// </summary>
 private GUIManager()
 {
     buttons = new List<Button>();
     textureHolder = InterfaceTextureHolder.Holder;
 }
コード例 #4
0
 /// <summary>
 /// LoadContent will be called once per game and is the place to load
 /// all of your content.
 /// </summary>
 protected override void LoadContent()
 {
     // Create a new SpriteBatch, which can be used to draw textures.
     spriteBatch = new SpriteBatch(GraphicsDevice);
     ConstantHolder.textureLoader = TextureListXML.loadTextureXMLs("Content\\XMLs\\Textures\\Textures.xml");
     ActorHolder = ActorTextureHolder.makeHolder(GraphicsDevice);
     CombatHolder = CombatTextureHolder.makeHolder(GraphicsDevice);
     EnviroHolder = EnvironmentTextureHolder.makeHolder(GraphicsDevice);
     InterfaceHolder = InterfaceTextureHolder.makeHolder(Content, GraphicsDevice);
     currentLevelGrid = Level.loadLevelXML("Content\\XMLs\\level.xml").LevelGrid;
     GUIMan = GUIManager.MakeManager();
     changeState(GameState.Gameplay_Combat);
     //currentLevelGrid = thing.SimpleLevelGrid;
     IsMouseVisible = true;
     changeState(GameState.Gameplay_Combat);
     //HexagonWidth = hex.Width;
     // TODO: use this.Content to load your game content here
 }
コード例 #5
0
                            numFonts = 1;       //Number of fonts the game will use.

        /// <summary>
        /// Sets up the InterfaceTextureHolder with all the necessary Sprites.
        /// This should be called in the main game class's LoadContent function.
        /// </summary>
        /// <param name="manager">Main game class's ContentManager.</param>
        /// <returns>The holder created by this class.</returns>
        public static InterfaceTextureHolder makeHolder(ContentManager manager, GraphicsDevice graphics)
        {
            return(ITHolder = new InterfaceTextureHolder(manager, graphics));
        }
コード例 #6
0
            numFonts = 1;                       //Number of fonts the game will use.

        /// <summary>
        /// Sets up the InterfaceTextureHolder with all the necessary Sprites.
        /// This should be called in the main game class's LoadContent function.
        /// </summary>
        /// <param name="manager">Main game class's ContentManager.</param>
        /// <returns>The holder created by this class.</returns>
        public static InterfaceTextureHolder makeHolder(ContentManager manager, GraphicsDevice graphics)
        {
            return ITHolder = new InterfaceTextureHolder(manager, graphics);
        }