private IEnumerable <IHasModelMatrix> getImplementors() { foreach (var sprite in ObjectTests.GetImplementors(_mocks, _mocks.GameState())) { yield return(sprite); } var resolver = ObjectTests.GetResolver(); resolver.Build(); yield return(new AGSSprite(resolver, _mocks.MaskLoader().Object)); }
private IArea getArea() { var resolver = ObjectTests.GetResolver(); resolver.Build(); var area = new AGSArea("Area", resolver) { Mask = new AGSMask(new bool[][] { }, null) }; AGSScalingArea.Create(area, 1f, 1f); area.AddComponent <IWalkBehindArea>(); return(area); }
public async Task TestTweenSaturation() { var resolver = ObjectTests.GetResolver(); resolver.Build(); AGSSprite sprite = new AGSSprite(resolver, null); sprite.Tint = Color.FromHsla(100, 1f, 0.5f, 100); //Lightness must be different than 1 for saturation to change await sprite.TweenTintSaturation(0f, 1f, Ease.QuadIn).Task; Assert.IsTrue(Math.Abs(sprite.Tint.GetSaturation()) < 0.0001f); await sprite.TweenTintSaturation(1f, 1f).Task; Assert.IsTrue(Math.Abs(1f - sprite.Tint.GetSaturation()) < 0.0001f); }
public async Task TestTweenHue() { var resolver = ObjectTests.GetResolver(); resolver.Build(); AGSSprite sprite = new AGSSprite(resolver, null); sprite.Tint = Color.FromHsla(0, 1f, 0.75f, 100); //Lightness must be different than 1 for hue to change await sprite.TweenTintHue(359, 1f).Task; Assert.AreEqual(359, sprite.Tint.GetHue()); await sprite.TweenTintHue(0, 1f, Ease.QuadIn).Task; Assert.AreEqual(0, sprite.Tint.GetHue()); }
private IEnumerable <IHasModelMatrix> getImplementors() { foreach (var sprite in ObjectTests.GetImplementors(_mocks, _mocks.GameState())) { //todo: Fix scaling for labels if (sprite is AGSLabel || sprite is AGSButton) { continue; } yield return(sprite); } var resolver = ObjectTests.GetResolver(); resolver.Build(); yield return(new AGSSprite(resolver, _mocks.MaskLoader().Object)); }