private void CreateStrokeSpriteFont(Drawables.Image image, SpriteFont spriteFont, string text, Vector2?scale = null, Color?textStrokeColor = null, Color?textColor = null) { var textStroke = StrokeEffect.CreateStrokeSpriteFont(spriteFont, text, textColor == null ? Color.Black : textColor.Value, scale ?? Vector2.One, strokeSize, textStrokeColor == null ? strokeColor : textStrokeColor.Value, GraphicsDevice, strokeType); // Dispose if the previous texture is not pixel if (image.texture != imgPixel) { image.texture.Dispose(); } image.texture = textStroke; }
private void CreateStroke(Drawables.Image image, Texture2D texture, Color?imageStrokeColor = null) { var imageStroke = StrokeEffect.CreateStroke(texture, strokeSize, imageStrokeColor == null ? strokeColor : imageStrokeColor.Value, GraphicsDevice, strokeType); // Dispose if the previous texture is not pixel if (image.texture != imgPixel) { image.texture.Dispose(); } image.texture = imageStroke; }