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); }
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); }
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 void Draw() { _eqBatch.Draw(_texture.Texture,new Rectangle( (int)_position.X, (int)_position.Y,(int)(_texture.Width * _scale),(int)(_texture.Height * _scale)), _source,_color,_rotation,_origin,_flipped ? SpriteEffects.FlipHorizontally : 0,_depth); }
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); }
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); }
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); }
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); }