Esempio n. 1
0
 private void GenerateWidget(Equestribatch sb)
 {
     sb.Draw(_windowTexture.Texture, new Rectangle((int)0, (int)0, WIDGET_WIDTH, WIDGET_HEIGHT), Border_Color);
     sb.Draw(_windowTexture.Texture, new Rectangle((int)1, (int)1, WIDGET_WIDTH - 2, WIDGET_HEIGHT - 2), Mid_Color);
     sb.Draw(_achievementTexture.Texture, new Rectangle((int)4, (int)4, 96, 96), AchievementSourceRect, Color.White);
     sb.DrawString(_displayFont, _displayFont.WrapText(_achievement.ToString(), WIDGET_WIDTH - 94), new Vector2(100, 4), Color.Magenta);
 }
Esempio n. 2
0
 public override void Draw(Equestribatch sb)
 {
     sb.Begin();
     sb.Draw(_windowTarget.Texture, new Rectangle((int)Position.X, (int)Position.Y, WIDGET_WIDTH, WIDGET_HEIGHT), Color.White);
     sb.End();
     base.Draw(sb);
 }
 public override void Draw(Equestribatch sb)
 {
     sb.Begin();
     sb.Draw(_windowTarget.Texture, new Rectangle((int)Position.X, (int)Position.Y, WIDGET_WIDTH, WIDGET_HEIGHT), Color.White);
     sb.End();
     base.Draw(sb);
 }
Esempio n. 4
0
        public override void Draw(Equestribatch sb)
        {
            sb.Begin();

            sb.Draw(_popText.Texture, Position, _popText[STAR_NAME], Color.Yellow,
                    _starRotation, _popText[STAR_NAME].Center, 1, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 0.0f);

            Color textColor;

            switch (_type)
            {
            case PopType.HealthPop:
                textColor = Color.Green;
                break;

            case PopType.PDamagePop:
                textColor = Color.Red;
                break;

            case PopType.EDamagePop:
                textColor = Color.White;
                break;

            default:
                textColor = Color.Violet;
                break;
            }

            sb.Draw(_number.Texture, Position, null, textColor,
                    0.0f, new Vector2(_number.Width / 2, _number.Height / 2), 1, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 0.0f);

            sb.End();

            //base.Draw(sb);
        }
        public override void Draw(Equestribatch sb)
        {
            sb.Begin();

            sb.Draw(_popText.Texture, Position, _popText[STAR_NAME], Color.Yellow,
                _starRotation, _popText[STAR_NAME].Center, 1, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 0.0f);

            Color textColor;

            switch (_type)
            {
                case PopType.HealthPop:
                    textColor = Color.Green;
                    break;
                case PopType.PDamagePop:
                    textColor = Color.Red;
                    break;
                case PopType.EDamagePop:
                    textColor = Color.White;
                    break;
                default:
                    textColor = Color.Violet;
                    break;
            }

            sb.Draw(_number.Texture, Position, null,textColor,
             0.0f, new Vector2(_number.Width / 2, _number.Height / 2), 1, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 0.0f);

            sb.End();

            //base.Draw(sb);
        }
        public override void Draw(Equestribatch sb)
        {
            if (!entryComplete)
            {
                _displayColor = Color.Multiply(Color.White, timer / ENTRYTIME);
            }
            if (delayComplete && !exitComplete)
            {
                _displayColor = Color.Multiply(Color.White, 1 - (timer / EXITTIME));
            }
            sb.Begin();

            if (entryComplete && !displayComplete)
            {
                sb.DrawString(_fontDisplay, (goldRecieved >= 0 ? "+" : "") + goldRecieved,
                              Vector2.Lerp(_displayPos, _displayPos - new Vector2(0, 128), timer / DISPLAYTIME),
                              Color.Multiply(goldRecieved >= 0 ? Color.Yellow : Color.Red, 1 - (timer / DISPLAYTIME)));
            }

            //sb.DrawString(_fontDisplay, "" + goldDisplayed, _displayPos + Vector2.One, );
            sb.DrawString(_fontDisplay, "" + goldDisplayed, _displayPos, _displayColor);
            sb.Draw(_bits.Texture, _displayPos - new Vector2(38, -8), _displayColor);

            sb.End();

            base.Draw(sb);
        }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            base.LoadContent();

            spriteBatch = new Equestribatch(GraphicsDevice);

            _stateManager.AddScreenLoad(_Screen);
        }
 public TargetObject(string name,GraphicsDevice device, int width, int height)
     : base(name)
 {
     _width = width;
     _height = height;
     _texture = new RenderTarget2D(device, width, height);
     devRef = device;
     _ready = true;
     targetBatch = new Equestribatch(device);
 }
 public TargetObject(string name, GraphicsDevice device, int width, int height)
     : base(name)
 {
     _width      = width;
     _height     = height;
     _texture    = new RenderTarget2D(device, width, height);
     devRef      = device;
     _ready      = true;
     targetBatch = new Equestribatch(device);
 }
 private void DrawNameBox(Equestribatch sb)
 {
     int width = (int)_messageBoxFont.Measure(name).X;
     sb.Draw(_nameBoxWindowTexture.Texture, Vector2.Zero,
         new Rectangle(0, 0, 25, _nameBoxWindowTexture.Height),
         EngineGlobals.Settings.SkinColor);
     sb.Draw(_nameBoxWindowTexture.Texture,
         new Rectangle(25, 0, width, _nameBoxWindowTexture.Height),
         new Rectangle(26, 0, 1, _nameBoxWindowTexture.Height),
         EngineGlobals.Settings.SkinColor);
     sb.Draw(_nameBoxWindowTexture.Texture, new Vector2(25 + width, 0),
         new Rectangle(_nameBoxWindowTexture.Width - 25, 0, 25, _nameBoxWindowTexture.Height),
         EngineGlobals.Settings.SkinColor);
     sb.DrawString(_messageBoxFont, name, new Vector2(26, 13), Color.Black);
     sb.DrawString(_messageBoxFont, name, new Vector2(25, 12), Color.White);
 }
Esempio n. 11
0
        public static void GenerateTextureObjectFromPopText(out TextureObject output, int num, Color?color = null)
        {
            TextureAtlas atlas = EngineGlobals.AssetManager.GetTexture("{pop_text}") as TextureAtlas;

            string temp = "" + num;
            int    width = 0, height = 0;

            for (int i = 0; i < temp.Length; i++)
            {
                var rect = atlas["num_" + temp[i]];
                width += rect.Width;
                if (rect.Height > height)
                {
                    height = rect.Height;
                }
            }

            RenderTarget2D _textTarget = new RenderTarget2D(Device_Ref, width, height);

            Device_Ref.SetRenderTarget(_textTarget);
            Device_Ref.Clear(color == null ? Color.Black : color.Value);

            Equestribatch batch        = new Equestribatch(Device_Ref);

            batch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
            int lastWidth = 0;

            for (int i = 0; i < temp.Length; i++)
            {
                batch.Draw(atlas.Texture, new Vector2(lastWidth, 0), atlas["num_" + temp[i]], Color.White);
                lastWidth += atlas["num_" + temp[i]].Width;
            }

            batch.End();

            Device_Ref.SetRenderTarget(null);

            output = EngineGlobals.AssetManager.CreateTextureObjectFromTarget("{" + temp + "}", _textTarget);

            _textTarget.Dispose();
        }
        public override void Draw(Equestribatch sb)
        {
            if (!entryComplete)
                _displayColor = Color.Multiply(Color.White, timer / ENTRYTIME);
            if (delayComplete && !exitComplete)
                _displayColor = Color.Multiply(Color.White, 1 - (timer / EXITTIME));
            sb.Begin();

            if(entryComplete && !displayComplete)
                sb.DrawString(_fontDisplay,(goldRecieved >= 0 ? "+" : "") + goldRecieved,
                    Vector2.Lerp(_displayPos,_displayPos - new Vector2(0,128),timer / DISPLAYTIME),
                    Color.Multiply(goldRecieved >= 0 ? Color.Yellow : Color.Red,1 - (timer/DISPLAYTIME)));

            //sb.DrawString(_fontDisplay, "" + goldDisplayed, _displayPos + Vector2.One, );
            sb.DrawString(_fontDisplay, "" + goldDisplayed, _displayPos, _displayColor);
            sb.Draw(_bits.Texture, _displayPos - new Vector2(38, -8), _displayColor);

            sb.End();

            base.Draw(sb);
        }
Esempio n. 13
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            base.LoadContent();
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new Equestribatch(GraphicsDevice);

            //scene.Messages.AddMessageBox(new MessageBox("/name[Trixie]Where the f**k is my money Fluttershy?", scene));
            //scene.Messages.AddMessageBox(new MessageBox("/name[Fluttershy]O-oh!/d[2]/d[] Uhm...I-i'll go get it.../move[(1000|260),0,(0.7|0.7),1,1,5]", scene));
            //scene.Messages.AddMessageBox(new MessageBox("/name[Trixie]/move[(1000|260),0,(0.7|0.7),1,1,5]/d[2]/d[]Bitch better have my f*****g money :v", scene));

            // TODO: use this.Content to load your game content here
            //EquestriEngine.Objects.DrawableSkeleton skeleton = new EquestriEngine.Objects.DrawableSkeleton("chicken", "skeleton","Default");

#if !DEBUG
            var logo = new EquestriEngine.Objects.Graphics.TextureObject("{logo}", @"Graphics\UI\logo");
            _stateManager.AddScreen(new EquestriEngine.SystemScreens.LogoScreen(logo, _Screen));
#else
            _stateManager.AddScreenLoad(_Screen);
#endif
            //EquestriEngine.Systems.StateManager.AddScreen(new EquestriEngine.SystemScreens.GameplayScreen(_stateManager));
        }
        public static void GenerateTextureObjectFromPopText(out TextureObject output,int num, Color? color = null)
        {
            TextureAtlas atlas = EquestriEngine.AssetManager.GetTexture("{pop_text}") as TextureAtlas;

            string temp = "" + num;
            int width = 0, height = 0;

            for (int i = 0; i < temp.Length; i++)
            {
                var rect = atlas["num_" + temp[i]];
                width += rect.Width;
                if (rect.Height > height)
                    height = rect.Height;
            }

            RenderTarget2D _textTarget = new RenderTarget2D(Device_Ref,width,height);
            Device_Ref.SetRenderTarget(_textTarget);
            Device_Ref.Clear(color == null ? Color.Black : color.Value);

            Equestribatch batch = new Equestribatch(Device_Ref);
            batch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
            int lastWidth = 0;
            for (int i = 0; i < temp.Length; i++)
            {
                batch.Draw(atlas.Texture, new Vector2(lastWidth, 0), atlas["num_" + temp[i]], Color.White);
                lastWidth += atlas["num_" + temp[i]].Width;
            }

            batch.End();

            Device_Ref.SetRenderTarget(null);

            output = EquestriEngine.AssetManager.CreateTextureObjectFromTarget("{"+temp+"}", _textTarget);

            _textTarget.Dispose();
        }
 private void DrawNameBox(Equestribatch sb)
 {
     int width = (int)_messageBoxFont.Measure(name).X;
     sb.Draw(_nameBoxWindowTexture.Texture, Vector2.Zero,
         new Rectangle(0, 0, 25, _nameBoxWindowTexture.Height),
         EquestriEngine.Settings.SkinColor);
     sb.Draw(_nameBoxWindowTexture.Texture,
         new Rectangle(25, 0, width, _nameBoxWindowTexture.Height),
         new Rectangle(26, 0, 1, _nameBoxWindowTexture.Height),
         EquestriEngine.Settings.SkinColor);
     sb.Draw(_nameBoxWindowTexture.Texture, new Vector2(25 + width, 0),
         new Rectangle(_nameBoxWindowTexture.Width - 25, 0, 25, _nameBoxWindowTexture.Height),
         EquestriEngine.Settings.SkinColor);
     sb.DrawString(_messageBoxFont, name, new Vector2(26,13), Color.Black);
     sb.DrawString(_messageBoxFont, name, new Vector2(25,12), Color.White);
 }
 static DrawableSprite()
 {
     _eqBatch = EngineGlobals.GameReference.SpriteBatch;
 }
 static DrawableSprite()
 {
     _eqBatch = EngineGlobals.GameReference.SpriteBatch;
 }
 private void GenerateWidget(Equestribatch sb)
 {
     sb.Draw(_windowTexture.Texture, new Rectangle((int)0, (int)0, WIDGET_WIDTH, WIDGET_HEIGHT), Border_Color);
     sb.Draw(_windowTexture.Texture, new Rectangle((int)1, (int)1, WIDGET_WIDTH - 2, WIDGET_HEIGHT - 2), Mid_Color);
     sb.Draw(_achievementTexture.Texture, new Rectangle((int)4, (int)4, 96, 96), AchievementSourceRect, Color.White);
     sb.DrawString(_displayFont, _displayFont.WrapText(_achievement.ToString(),WIDGET_WIDTH - 94), new Vector2(100, 4), Color.Magenta);
 }
Esempio n. 19
0
 public virtual void Draw(Equestribatch sb)
 {
 }
 private void RenderText(Equestribatch sb)
 {
     sb.DrawString(_font, _entries, new Vector2(5, 5), /*Color.Multiply(Color.White, showAmount)*/ Color.Black);
     sb.DrawString(_font, _entries, new Vector2(4, 4), /*Color.Multiply(Color.White, showAmount)*/ Color.White);
 }
 protected override void LoadContent()
 {
     _spriteBatch = new Equestribatch(GraphicsDevice);
     base.LoadContent();
 }
 private void RenderText(Equestribatch sb)
 {
     sb.DrawString(_font, _entries, new Vector2(5, 5), /*Color.Multiply(Color.White, showAmount)*/ Color.Black);
     sb.DrawString(_font, _entries, new Vector2(4, 4), /*Color.Multiply(Color.White, showAmount)*/ Color.White);
 }
Esempio n. 23
0
 protected override void LoadContent()
 {
     _spriteBatch = new Equestribatch(GraphicsDevice);
     base.LoadContent();
 }
 public override void Draw(Equestribatch sb)
 {
 }
 public override void Draw(Equestribatch sb)
 {
 }
Esempio n. 26
0
 public virtual void Draw(Equestribatch sb)
 {
 }