//this makes it so we don't have to specify false for isRelative every.single.time. public static TweenConfig floatProp(this TweenConfig config, string propName, float propValue) { return(config.floatProp(propName, propValue, false)); }
public void CallGameOver() { player.RemoveFromContainer(); TweenConfig tw = new TweenConfig(); tw.floatProp("alpha", 0); tw.onComplete(theTween => { Game.instance.GoToPage(PageType.MenuPage); }); Go.to(this, 2f, tw); }
void loadTiles() { foreach (PlatformData platform in levelData.getPlatformData()) { FSprite plat = new FSprite(platform.image); plat.height = 16; plat.width = 16; tileSize = plat.width; Tiles[(int)platform.x, (int)platform.y] = 1; // make them overlap a little to avoid those ungly lines in the rendering. plat.SetPosition(new Vector2((platform.x * plat.width), (-platform.y * plat.height))); AddChild(plat); } playerBullets = new List<Bullet>(); hazards = new List<Hazard>(); particleContainer = new FContainer(); AddChild(particleContainer); enemyContainer = new FContainer(); AddChild(enemyContainer); particles = new FParticleSystem(50); particleContainer.AddChild(particles); projectileContainer = new FContainer(); AddChild(projectileContainer); entityContainer = new FContainer(); AddChild(entityContainer); frontContainer = new FContainer(); AddChild(frontContainer); this.alpha = 0; TweenConfig tw = new TweenConfig(); tw.floatProp("alpha", 1); Go.to(this, 10f, tw); stats = new FLabel("font", "Jump Packs: 0; reload times: 0"); CurrentPage.GetHUD().AddChild(stats); stats.scale = 0.9f; stats.SetPosition(new Vector2(Futile.screen.halfWidth, Futile.screen.height * 0.9f)); }
public void To(float targetAmount, float duration, TweenConfig tc) { Go.killAllTweensWithTarget(this); tc.floatProp("amount", targetAmount); Go.to(this, duration, tc); }