public IntroScene(Module App) : base(App) { timeout = new FadingHelper(); Music = "20_MUS 20_HSC.ogg"; Position = (app.Engine.GameResolution - new Vector2(320, 200)) / 2; Size = new Vector2(320, 200); app.RenderMouse = false; CaptureAllMouseClicks = true; ConfigFile intro = new ConfigFile(); intro.Open("intro.txt"); pages = new IntroPage[intro["intro"].GetInt("pages")]; for (int i = 0; i < pages.Length; i++) { pages[i].Map = intro["page" + i].GetInt("map"); pages[i].Time = intro["page" + i].GetFloat("time"); pages[i].Scrolling = intro["page" + i].GetFloat("scrolling"); DataID <MapData> mapData = app.ResourceManager.GetData("classicmap@mat_" + pages[i].Map.ToString("D3") + ".raw??" + pages[i].Map); pages[i].MapData = mapData.Object; } animations = new IntroAnimation[intro["intro"].GetInt("animations")]; for (int i = 0; i < animations.Length; i++) { animations[i].Position = intro["ani" + i].GetVector2("pos"); animations[i].Start = intro["ani" + i].GetFloat("start"); animations[i].Time = intro["ani" + i].GetFloat("time"); animations[i].File = intro["ani" + i].GetString("file"); } view = new MapView(null, app); view.Enabled = false; view.Position = new Vector2(16, 0); view.Size = new Vector2(288, 160); Windows += view; image = new Image(app); image.Position = new Vector2(0, 0); image.Background = null; image.Layer += 20; Windows += image; PreloadAnimations(); }
protected override void AfterDeserialization() { if (!IsDead) { ani = new Burntime.Platform.Graphics.SpriteAnimation(2); ani.Speed = 10; } else { ani = new Burntime.Platform.Graphics.SpriteAnimation(5); ani.Endless = false; } aniDelay = new FadingHelper(20); base.AfterDeserialization(); if (body.Object != null && body.Object.Animation != null) { body.Object.Animation.Progressive = false; } }