public Counter(CounterDefinition definition, SpriteInfo spriteInfo) : base(spriteInfo) { _definition = definition; Value = 0; }
public DirectionalAnimatedSprite(DirectionalAnimatedSpriteDefinition definition, SpriteInfo spriteInfo) : base(spriteInfo) { _definition = definition; _anims = new AnimatedSprite[16]; for (int i = 0; i < 16; i++) if (_definition[(Direction)i] != null) _anims[i] = new AnimatedSprite(_definition[(Direction)i], SpriteInfo); }
public StaticSprite(StaticSpriteDefinition definition, SpriteInfo spriteInfo) : base(spriteInfo) { _definition = definition; }
public void Draw(SpriteBatch spriteBatch, PointFP position, SpriteInfo spriteData) { Vector2 p = new Vector2(position.X.Floor, position.Y.Floor); spriteBatch.Draw(_texture, p, _source, spriteData.BlendColor * spriteData.Opacity, spriteData.Rotation, Origin, spriteData.Scale, spriteData.Effects, 0); }
internal PointFP CalculateSize(List<int> digitList, SpriteInfo spriteInfo) { FPInt width = 0; FPInt height = 0; foreach (int digitIndex in digitList) { width += (FPInt)(_digitFrames[digitIndex].Width * spriteInfo.Scale); height = (FPInt)FPMath.Max(height, (FPInt)(_digitFrames[digitIndex].Height * spriteInfo.Scale)); } if (digitList.Count > 1) width += DigitSpacing * (digitList.Count - 1); return new PointFP(width, height); }
public void Draw(SpriteBatch spriteBatch, PointFP position, SpriteInfo spriteData, List<int> digitIndexList) { FPInt width = -DigitSpacing; FPInt height = 0; foreach (int digitIndex in digitIndexList) { width += (FPInt)(_digitFrames[digitIndex].Width * spriteData.Scale) + DigitSpacing; height = FPMath.Max(height, (FPInt)(_digitFrames[digitIndex].Height * spriteData.Scale)); } FPInt x = position.X - width / 2; FPInt y = position.Y - height / 2; foreach (int digitIndex in digitIndexList) { _digitFrames[digitIndex].Draw(spriteBatch, new PointFP(x, y), spriteData); x += (FPInt)(_digitFrames[digitIndex].Width * spriteData.Scale) + DigitSpacing; } }
public AnimatedSprite(AnimatedSpriteDefinition definition, SpriteInfo spriteInfo, AnimationInfo animInfo) : base(spriteInfo) { _definition = definition; }
public AnimatedSprite(AnimatedSpriteDefinition definition, SpriteInfo spriteInfo) : base(spriteInfo) { _definition = definition; _animData = new AnimationInfo(); }
public Sprite(SpriteInfo spriteInfo) { _spriteInfo = spriteInfo; }
public Sprite() { _spriteInfo = new SpriteInfo(); _spriteInfo.Opacity = 1; }
public void Draw(SpriteBatch spriteBatch, PointFP position, AnimationInfo animData, SpriteInfo spriteData) { _frames[animData.CurrentFrameIndex].Frame.Draw(spriteBatch, position, spriteData); }