public LogoEntity(Action endFunction) { Position.X = OGE.HUDCamera.Width / 2.0f; Position.Y = OGE.HUDCamera.Height / 2.0f; currentSpeed = 0.03f; currentValue = 0; status = AnnouncerStatus.Appearing; this.endFunction = endFunction; logoBackgroundImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Intro\LogoBack")); logoBackgroundImage.CenterOrigin(); logoBackgroundImage.TintColor = Color.White * currentValue; oImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Intro\OLogo")); oImage.CenterOrigin(); oImage.TintColor = Color.White * currentValue; omidosImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Intro\OmidosLogo")); omidosImage.CenterOrigin(); omidosImage.TintColor = Color.White * currentValue; waitingAlarm = new Alarm(2f, TweenType.OneShot, Disappear); AddTween(waitingAlarm); CurrentImages.Add(logoBackgroundImage); CurrentImages.Add(oImage); CurrentImages.Add(omidosImage); }
public AnnouncerEntity(AnnouncerEnded endFunction, float height) { this.endFunction = endFunction; this.maxHeight = height; this.EscapeHandler = null; this.status = AnnouncerStatus.Appearing; this.speed = 10; this.borderImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\WindowGraphics\Border")); this.bodyImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\WindowGraphics\Body")); this.borderImage.ScaleX = OGE.HUDCamera.Width / this.borderImage.Width; this.bodyImage.ScaleX = OGE.HUDCamera.Width / this.bodyImage.Width; }
public override void Update(GameTime gameTime) { base.Update(gameTime); switch (status) { case AnnouncerStatus.Appearing: currentValue += currentSpeed; logoBackgroundImage.TintColor = Color.White * currentValue; oImage.TintColor = Color.White * currentValue; omidosImage.TintColor = Color.White * currentValue; if(currentValue >= 1) { currentValue = 1; status = AnnouncerStatus.Steady; waitingAlarm.Start(); } break; case AnnouncerStatus.Disappearing: currentValue -= currentSpeed; logoBackgroundImage.TintColor = Color.White * currentValue; oImage.TintColor = Color.White * currentValue; omidosImage.TintColor = Color.White * currentValue; if (currentValue <= 0) { currentValue = 0; if (endFunction != null) { endFunction(); } } break; } }
private void Disappear() { status = AnnouncerStatus.Disappearing; }
public override void Update(GameTime gameTime) { base.Update(gameTime); switch (status) { case AnnouncerStatus.Appearing: height += speed; if (Input.CheckKeyboardButton(Keys.Escape) == GameButtonState.Pressed) { height = maxHeight; } if (height >= maxHeight) { height = maxHeight; status = AnnouncerStatus.Steady; } break; case AnnouncerStatus.Steady: if (Input.CheckKeyboardButton(Keys.Escape) == GameButtonState.Pressed) { if (EscapeHandler != null) { EscapeHandler(); } } break; case AnnouncerStatus.Disappearing: height -= speed; if (height <= 0) { height = 0; if (endFunction != null) { endFunction(); } OGE.CurrentWorld.RemoveOverLayer(this); } break; } bodyImage.ScaleY = height; }
public void FinishAnnouncer() { status = AnnouncerStatus.Disappearing; }