public SimpleIndicator(Vector2 position, IndicatorData data) { name = data.Name; key = data.Key; digits = new Digit[data.DigitCount]; backgroundTexture = GameResources.Content.Load<Texture2D>(data.BackgroundTexturePath); var alphabet = GameResources.Content.Load<Texture2D>(data.AlphabetTexturePath); this.basePosition = position; for (int i = 0; i < digits.Length; i++) { digits[i] = new Digit(initialPosition + basePosition, alphabet); initialPosition.X += alphabet.Width; } }
// private bool isBinary; //private GaugeData.Gauges gaugeType; //private Texture2D backgroundTexture; public Gauge(Vector2 position, IndicatorData data) { name = data.Name; key = data.Key; digits = new AnimatedDigit[data.DigitCount]; this.isBinary = data.IsBinary; backgroundTexture = GameResources.Content.Load<Texture2D>(data.BackgroundTexturePath); var digitSprites = GameResources.Content.Load<SpriteSheet>("Sprites/UI/HUD/Digit/Sprites"); this.basePosition = position; for (int i = 0; i < digits.Length; i++) { digits[i] = new AnimatedDigit(); digits[i].Restore(initialPosition + basePosition, digitSprites, null); digits[i].CyphersTexture = GameResources.Content.Load<Texture2D>(data.AlphabetTexturePath); initialPosition.X += digitSprites.SourceRectangle(0).Width; } }
public Indicator(Vector2 position, IndicatorData data) { backgroundTexture = Resources.Content.Load<Texture2D>("Sprites/UI/HUD/Gauge/gauge2"); this.basePosition = position; isBinary = data.IsBinary; }