Beispiel #1
0
 public void Initialize()
 {
     //currentSceen is starting screen when program run
     currentScreen = new GamePlayScreen();
     fade          = new FadeAnimation();
     inputManager  = new InputManager();
 }
Beispiel #2
0
 public void Initialize()
 {
     //currentScreen = new GamePlayScreen();
     currentScreen = new TitleScreen();
     fade          = new FadeAnimation();
     inputManager  = new InputManager();
 }
Beispiel #3
0
        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>();
            // filename for the splashscreen images
            fileManager.LoadContent("Load/Splash.txt", "");

            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 < fileManager.Attributes.Count; i++)
            {
                // loading in image and dimensions
                animation[i].LoadContent(content, images[i], "",
                                         new Vector2(ScreenManager.Instance.Dimensions.X / 2 - images[i].Width / 2,
                                                     ScreenManager.Instance.Dimensions.Y / 2 - images[i].Height / 2));
                animation[i].Scale    = 1.0f;
                animation[i].IsActive = true;
            }
        }
 public void Initialize()
 {
     currentScreen = new SplashScreen();
     fade          = new FadeAnimation();
 }
Beispiel #5
0
        public void LoadContent(ContentManager content, string id)
        {
            this.content   = new ContentManager(content.ServiceProvider, "Content");
            menuItems      = new List <string>();
            animationTypes = new List <string>();
            linkType       = new List <string>();
            linkID         = new List <string>();
            menuImages     = new List <Texture2D>();
            animation      = new List <Animation>();
            itemNumber     = 0;
            fAnimation     = new FadeAnimation();
            ssAnimation    = new SpriteSheetAnimation();

            position = Vector2.Zero;

            fileManager = new FileManager();
            // loading in the filename for Menu.txt
            fileManager.LoadContent("Load/Menu.txt", id);
            // switch case for the menu types and values
            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();
        }