public override void LoadContent(ContentManager Content, InputManager inputManager) { base.LoadContent(Content, inputManager); if (font == null) { font = this.content.Load <SpriteFont>("Font1"); } imageNumber = 0; fileManager = new FileManager(); animation = new List <Animation>(); FAnimation = new FadeAnimation(); images = new List <Texture2D>(); fileManager.LoadContent("Load/Splash.cme", ""); for (int i = 0; i < fileManager.Attributes.Count; i++) { for (int j = 0; j < fileManager.Attributes[i].Count; j++) { switch (fileManager.Attributes[i][j]) { case "Image": images.Add(this.content.Load <Texture2D>(fileManager.Contents[i][j])); animation.Add(new FadeAnimation()); break; } } } for (int i = 0; i < animation.Count; i++) { animation[i].ScaleY = (ScreenManager.Instance.Dimensions.Y / images[i].Height); animation[i].ScaleX = (ScreenManager.Instance.Dimensions.X / images[i].Width); animation[i].LoadContent(content, images[i], "", new Vector2((images[i].Width / 2) * animation[i].ScaleX - (images[i].Width / 2), (images[i].Height / 2) * animation[i].ScaleY - (images[i].Height / 2))); animation[i].IsActive = true; } }
public void Initialize() { currentScreen = new SplashScreen(); fade = new FadeAnimation(); inputManager = new InputManager(); }
public void LoadContent(ContentManager content, string id) { this.content = new ContentManager(content.ServiceProvider, "Content"); menuItems = new List <string>(); menuImages = new List <Texture2D>(); animation = new List <Animation>(); animationTypes = new List <string>(); fAnimation = new FadeAnimation(); ssAnimation = new SpriteSheetAnimation(); linkType = new List <string>(); linkID = new List <string>(); position = Vector2.Zero; itemNumber = 0; fileManager = new FileManager(); fileManager.LoadContent("Load/Menus.cme", id); for (int i = 0; i < fileManager.Attributes.Count; i++) { for (int j = 0; j < fileManager.Attributes[i].Count; j++) { switch (fileManager.Attributes[i][j]) { case "Font": font = this.content.Load <SpriteFont>(fileManager.Contents[i][j]); break; case "Item": menuItems.Add(fileManager.Contents[i][j]); break; case "Image": menuImages.Add(this.content.Load <Texture2D>(fileManager.Contents[i][j])); break; case "Axis": axis = int.Parse(fileManager.Contents[i][j]); break; case "Position": string[] temp = fileManager.Contents[i][j].Split(' '); position = new Vector2(float.Parse(temp[0]), float.Parse(temp[1])); break; case "Source": temp = fileManager.Contents[i][j].Split(' '); source = new Rectangle(int.Parse(temp[0]), int.Parse(temp[1]), int.Parse(temp[2]), int.Parse(temp[3])); break; case "Animation": animationTypes.Add(fileManager.Contents[i][j]); break; case "Align": align = fileManager.Contents[i][j]; break; case "LinkType": linkType.Add(fileManager.Contents[i][j]); break; case "LinkID": linkID.Add(fileManager.Contents[i][j]); break; } } } SetMenuItems(); SetAnimations(); }