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(_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 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);
 }
Ejemplo n.º 4
0
        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);
        }
        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 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);
 }
Ejemplo n.º 7
0
 public virtual void Draw(Equestribatch sb)
 {
 }
 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);
 }
 public override void Draw(Equestribatch sb)
 {
 }
 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);
 }
 static DrawableSprite()
 {
     _eqBatch = EngineGlobals.GameReference.SpriteBatch;
 }