Exemplo n.º 1
0
 public void Initialize()
 {
     currentScreen = new SplashScreen();
     inputManager  = new InputManager();
     animation     = new Animation();
     fade          = new FadeAnimation();
 }
Exemplo n.º 2
0
        public override void LoadContent(ContentManager Content, InputManager inputManager)
        {
            base.LoadContent(Content, inputManager);
            if (font == null)
            {
                font = this.content.Load <SpriteFont>("Font1");
            }

            fileManager = new FileManager();
            animations  = new List <Animation>();
            fade        = new FadeAnimation();
            images      = new List <Texture2D>();

            fileManager.LoadContent("Load/Splash.cme", attributes, contents);

            for (int i = 0; i < attributes.Count; i++)
            {
                for (int j = 0; j < attributes[i].Count; j++)
                {
                    switch (attributes[i][j])
                    {
                    case "Image":
                        images.Add(this.content.Load <Texture2D>(contents[i][j]));
                        animations.Add(new Animation());
                        break;
                    }
                }
            }

            for (int i = 0; i < animations.Count; i++)
            {
                animations[i].LoadContent(content, images[i], "", Vector2.Zero);
                animations[i].IsActive = true;
            }
        }
Exemplo n.º 3
0
        public override void Update(GameTime gameTime)
        {
            inputManager.Update();
            if (imageNumber >= animations.Count || inputManager.KeyPressed(Keys.Escape))
            {
                ScreenManager.Instance.AddScreen(new TitleScreen(), inputManager);
            }
            else
            {
                Animation anim = animations[imageNumber];
                fade.Update(gameTime, ref anim);
                animations[imageNumber] = anim;

                Console.WriteLine(imageNumber + " " + animations.Count);
                if (animations[imageNumber].Alpha == 0.0f)
                {
                    imageNumber++;
                    fade = new FadeAnimation();
                }
            }
        }
Exemplo n.º 4
0
        public void LoadContent(ContentManager content, string id)
        {
            this.content   = new ContentManager(content.ServiceProvider, "Content");
            menuItems      = new List <string>();
            animationTypes = new List <string>();
            menuImages     = new List <Texture2D>();
            animation      = new List <Animation>();
            fileManager    = new FileManager();
            attributes     = new List <List <string> >();
            contents       = new List <List <string> >();
            linkType       = new List <string>();
            linkID         = new List <string>();
            fadeAnimation  = new FadeAnimation();
            ssAnimation    = new SpriteSheetAnimation();
            itemNumber     = 0;
            align          = "";
            fileManager.LoadContent("Load/Menus.cme", attributes, contents, id);


            for (int i = 0; i < attributes.Count; i++)
            {
                for (int j = 0; j < attributes[i].Count; j++)
                {
                    switch (attributes[i][j])
                    {
                    case "Font":
                        font = this.content.Load <SpriteFont>(contents[i][j]);
                        break;

                    case "Item":
                        menuItems.Add(contents[i][j]);
                        break;

                    case "Image":
                        menuImages.Add(this.content.Load <Texture2D>(contents[i][j]));
                        break;

                    case "Axis":
                        axis = int.Parse(contents[i][j]);
                        break;

                    case "Position":
                        string[] temp = contents[i][j].Split(' ');
                        position = new Vector2(float.Parse(temp[0]), float.Parse(temp[1]));
                        break;

                    case "Source":
                        string[] tempSource = contents[i][j].Split(' ');
                        source = new Rectangle(int.Parse(tempSource[0]), int.Parse(tempSource[1]), int.Parse(tempSource[2]), int.Parse(tempSource[3]));
                        break;

                    case "Animation":
                        animationTypes.Add(contents[i][j]);
                        break;

                    case "Align":
                        align = contents[i][j];
                        break;

                    case "LinkType":
                        linkType.Add(contents[i][j]);
                        break;

                    case "LinkID":
                        linkID.Add(contents[i][j]);
                        break;
                    }
                }
            }

            SetMenuItems();
            SetAnimations();
        }