public StaticTextAsTexture(SpriteFont font, Texture2D txGradient, string sText, StaticTextAsTexture.TextType enType, Color cLineCol, float fLineAlpha, float fScale, int iOverrideFontSpacing = -100)
 {
     this.sText = sText;
     this.txGradientTexture = txGradient;
     this.enOutlineType = enType;
     this.cLineColor = cLineCol;
     this.fLineAlpha = fLineAlpha;
     this.iOverrideFontSpacing = iOverrideFontSpacing;
     this.fTextScale = fScale;
     this.fAADiscardThreshold = 0.6f;
     this.Setup(enType, font, sText, this.txGradientTexture);
     if (RenderMaster.LocalizedTextures.bAddToList)
     {
         Program.game.xRenderMaster.lxRemakeOnAdapterReset.Add(this);
     }
 }
Exemple #2
0
 public void StylizeTexts(int iSpot)
 {
     string sScore = this.iScore.ToString();
     sScore = sScore.PadLeft(9, '0');
     string sFloor = this.iFloorProgress.ToString();
     sFloor = sFloor.PadLeft(2, '0');
     sFloor = "F" + sFloor;
     if (iSpot == 0)
     {
         this.txName = new StaticTextAsTexture(FontManager.GetFont(FontManager.FontType.Bold10), Program.game.Content.Load<Texture2D>("Fonts/gradients/goldie"), this.sCharacterName, StaticTextAsTexture.TextType.Outlined, Color.Black, 1f, 1f, 1);
         this.txFloor = new StaticTextAsTexture(FontManager.GetFont(FontManager.FontType.Bold7Spacing1), Program.game.Content.Load<Texture2D>("Fonts/gradients/greenie"), sFloor, StaticTextAsTexture.TextType.Outlined, Color.Black, 0.7f, 1f, 2);
         this.txScore = new StaticTextAsTexture(FontManager.GetFont(FontManager.FontType.Bold10), Program.game.Content.Load<Texture2D>("Fonts/gradients/goldie"), sScore, StaticTextAsTexture.TextType.Outlined, Color.Black, 1f, 1f, 3);
         return;
     }
     this.txName = new StaticTextAsTexture(FontManager.GetFont(FontManager.FontType.Bold10), Program.game.Content.Load<Texture2D>("Fonts/gradients/silvie"), this.sCharacterName, StaticTextAsTexture.TextType.Outlined, Color.Black, 1f, 1f, 1);
     this.txFloor = new StaticTextAsTexture(FontManager.GetFont(FontManager.FontType.Bold7Spacing1), Program.game.Content.Load<Texture2D>("Fonts/gradients/greenie"), sFloor, StaticTextAsTexture.TextType.Outlined, Color.Black, 0.7f, 1f, 2);
     this.txScore = new StaticTextAsTexture(FontManager.GetFont(FontManager.FontType.Bold10), Program.game.Content.Load<Texture2D>("Fonts/gradients/goldie"), sScore, StaticTextAsTexture.TextType.Outlined, Color.Black, 1f, 1f, 3);
 }
 public StaticTextAsTexture(SpriteFont font, Texture2D txGradient, string sText, StaticTextAsTexture.TextType enType, Color cLineCol, float fLineAlpha)
     : this(font, txGradient, sText, enType, cLineCol, fLineAlpha, 1f, -100)
 {
 }
 public void Setup(StaticTextAsTexture.TextType enType, SpriteFont font, string sSourceString, Texture2D txGradient)
 {
     float arg_06_0 = font.Spacing;
     if (this.iOverrideFontSpacing > -100)
     {
         font.Spacing = (float)this.iOverrideFontSpacing;
     }
     Vector2 v2Dimensions = font.MeasureString(sSourceString) * this.fTextScale;
     if (this.iOverrideFontSpacing > -100)
     {
         font.Spacing = (float)FontManager.GetOriginalSpacing(font);
     }
     this.bFinalRendered = false;
     if (this.rt2dFinal != null)
     {
         this.rt2dFinal.Dispose();
     }
     this.rt2dA = new RenderTarget2D(Program.game.GraphicsDevice, (int)v2Dimensions.X, (int)v2Dimensions.Y, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8);
     this.rt2dB = new RenderTarget2D(Program.game.GraphicsDevice, (int)v2Dimensions.X, (int)v2Dimensions.Y, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8);
     int iAdd = 0;
     if (enType == StaticTextAsTexture.TextType.Shaded)
     {
         iAdd = 1;
     }
     else if (enType == StaticTextAsTexture.TextType.Outlined)
     {
         iAdd = 2;
     }
     this.rt2dC = new RenderTarget2D(Program.game.GraphicsDevice, (int)v2Dimensions.X + iAdd, (int)v2Dimensions.Y + iAdd, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8);
     this.rt2dFinal = new RenderTarget2D(Program.game.GraphicsDevice, (int)v2Dimensions.X + iAdd, (int)v2Dimensions.Y + iAdd, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8);
     this.font = font;
     this.enOutlineType = enType;
     this.sSourceString = sSourceString;
     Program.game.xRenderMaster.AddToPrerenderQueue(this);
 }