Exemplo n.º 1
0
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            Sprite bg          = new Sprite("Background", Global.Backgrounds[Global.CurrentBackgroundIndex], Vector2.Zero, Color.White);
            Sprite title       = new Sprite("title", content.Load <Texture2D>("Screen Images/Game Type"), new Vector2(103, 237), Color.White);
            Sprite tapButton   = new Sprite("tap", content.Load <Texture2D>("Screen Images/tapSelect"), new Vector2(259, 573), Color.White);
            Sprite or          = new Sprite("or", content.Load <Texture2D>("Screen Images/Or"), new Vector2(456, 1116), Color.White);
            Sprite swipeButton = new Sprite("swipe", content.Load <Texture2D>("Screen Images/swipeSelect"), new Vector2(259, 1298), Color.White);


            SpriteCollection.Add(bg);
            SpriteCollection.Add(title);
            SpriteCollection.Add(tapButton);
            SpriteCollection.Add(or);
            SpriteCollection.Add(swipeButton);

#if WINDOWS
            tapButton.MouseClick   += tapButton_MouseClick;
            swipeButton.MouseClick += swipeButton_MouseClick;
#else
            TouchManager touch = TouchManager.Instance;
            touch.GestureOccured += touch_GestureOccured;
#endif

            clickSound = content.Load <SoundEffect>("Sounds/Effects/RD click Sound");
        }
Exemplo n.º 2
0
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            gamePad = new GamePadMapper(PlayerIndex.One);

            //GameSprite background = new GameSprite(Content.Load<Texture2D>("Background\\Waiting"), Vector2.Zero, Color.White);
            //background.Scale = Global.Scale;



            inputFont = new FadingFont(Content.Load <SpriteFont>("Fonts\\Outage"), new Vector2(840, 600), 0.1f, 1.0f, 0.01f, 1.0f, "Waiting", Color.White, false);
            inputFont.SetCenterAsOrigin();
            inputFont.EnableShadow = false;


            backBtn          = new Button(Content.Load <Texture2D>("Buttons//Back"), new Vector2(0, 0), Color.White, new Rectangle(0, 149, 159, 169), new Rectangle(0, 0, 159, 149));
            backBtn.Origin   = new Vector2(backBtn.Texture.Width / 2, 169);
            backBtn.Position = new Vector2(177, 907 + backBtn.SourceRectangle.Value.Height / 2);


            // _sprites.Add(background);
            _sprites.Add(inputFont);
            _sprites.Add(backBtn);

            if (!Global.UsingKeyboard)
            {
                backBtn.IsPressed = true;
                WebServiceConnection.Client.LeaveGame(WebServiceConnection.GameName);
            }
        }
Exemplo n.º 3
0
 public static void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     playlist.Add("Amazing Plan", Content.Load <Song>("Music\\AmazingPlan"));
     playlist.Add("Fig Leaf Rag", Content.Load <Song>("Music\\FigLeafRag"));
     playlist.Add("Dark Hallway", Content.Load <Song>("Music\\DarkHallway"));
     playlist.Add("Clay", Content.Load <Song>("Music\\madeofclay"));
 }
Exemplo n.º 4
0
 public void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     runningAnimation = new Animation(Content.Load <Texture2D>("Content/Sprites/running"), 0.3f, true);
     idleAnimation    = new Animation(Content.Load <Texture2D>("Content/Sprites/idle"), 0.5f, true);
     swordSlash       = new Animation(Content.Load <Texture2D>("Content/Sprites/swordslash"), 0.05f, false);
     font             = Content.Load <SpriteFont>("Content/Fonts/baseFont");
 }
Exemplo n.º 5
0
        public void Initialise(Microsoft.Xna.Framework.Content.ContentManager Content, Game1 game, GraphicsDeviceManager graphics)
        {
            this.Game            = game;
            this.Graphics        = graphics;
            MenuItemText         = Content.Load <SpriteFont>("Menu_Text");
            TitleText            = Content.Load <SpriteFont>("TitleText");
            TextBoxNotSelected   = 0.4f;
            TextBoxSelected      = 0.5f;
            OptionSelected       = 0;
            MenuItems            = 1;
            BackGround           = Content.Load <Texture2D>("Light_Blue_Opaque");
            TextBox              = Content.Load <Texture2D>("TextBox");
            BackGroundSource     = new Rectangle(0, 0, BackGround.Width, BackGround.Height);
            BackGroundDest       = new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            SelectionRate        = 200f;
            selectionElapsedTime = 0f;


            Title = new StringBuilder();
            Title.Append("Battle Ships");
            Option1 = new StringBuilder();
            Option1.Append("Return to Game");
            Option2 = new StringBuilder();
            Option2.Append("Exit");

            WaterBackground = new Texture2D[22];
            for (int num = 1; num < WaterBackground.Length; num++)
            {
                WaterBackground[num] = Content.Load <Texture2D>("ocean" + num.ToString());
            }
            curBackground = 1;

            BackGroundFrameRate   = 100f;
            BackGroundElapsedTime = 0f;
        }
Exemplo n.º 6
0
 public void SetSpriteTextures(Microsoft.Xna.Framework.Content.ContentManager content)
 {
     platform  = content.Load <Texture2D>("Platform");
     character = content.Load <Texture2D>("Character");
     flag      = content.Load <Texture2D>("Flag");
     boulder   = content.Load <Texture2D>("Boulder");
 }
Exemplo n.º 7
0
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            gamePad = new GamePadMapper(PlayerIndex.One);

            titleDropInFont           = new DropInFont(Content.Load <SpriteFont>("Fonts\\JingJingTitle"), new Vector2(_viewPort.Width / 2, _viewPort.Height * 0.1f), new Vector2(_viewPort.Width / 2, _viewPort.Height * 0.1f), dropSpeed, "Game Mode", Color.CornflowerBlue);
            titleDropInFont.IsVisible = true;
            titleDropInFont.SetCenterAsOrigin();
            titleDropInFont.EnableShadow   = false;
            titleDropInFont.TintColor      = Color.Black;
            titleDropInFont.ShadowPosition = new Vector2(titleDropInFont.Position.X - 4, titleDropInFont.Position.Y + 4);
            titleDropInFont.ShadowColor    = Color.Gray;

            onePlayerBtn = new Button(Content.Load <Texture2D>("temp 1 player button"), new Vector2(0, 0), Color.White);
            onePlayerBtn.SetCenterAsOrigin();
            onePlayerBtn.Position = new Vector2(_viewPort.Width / 2, titleDropInFont.Position.Y + onePlayerBtn.Origin.Y * 2.5f);

            twoPlayersBtn = new Button(Content.Load <Texture2D>("temp 2 players button"), new Vector2(0, 0), Color.White);
            twoPlayersBtn.SetCenterAsOrigin();
            twoPlayersBtn.Position = new Vector2(_viewPort.Width / 2, onePlayerBtn.Position.Y + twoPlayersBtn.Origin.Y * 4);

            backBtn = new Button(Content.Load <Texture2D>("temp back button"), new Vector2(10, 10), Color.CornflowerBlue);
            backBtn.SetCenterAsOrigin();
            backBtn.Position = backBtn.Origin;

            _sprites.Add(titleDropInFont);
            _sprites.Add(onePlayerBtn);
            _sprites.Add(twoPlayersBtn);
            _sprites.Add(backBtn);
        }
Exemplo n.º 8
0
 public virtual void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     Roulifont = Content.Load <SpriteFont>("Rouli");
     bar       = Content.Load <Texture2D>("white_fullscreen");
     win       = Content.Load <SoundEffect>("music/win");
     lose      = Content.Load <SoundEffect>("music/lose");
 }
Exemplo n.º 9
0
        protected override void LoadContent(DrawState state, Microsoft.Xna.Framework.Content.ContentManager manager)
        {
            SpriteFont font = manager.Load <SpriteFont>("Arial");

            this.stats.Font = font;
            this.text.Font  = font;

            //load the particle systems
            this.fireParticleSystem.ParticleSystemData  = manager.Load <ParticleSystemData>("Particles/Fire");
            this.smokeParticleSystem.ParticleSystemData = manager.Load <ParticleSystemData>("Particles/Smoke");
            this.burstParticleSystem.ParticleSystemData = manager.Load <ParticleSystemData>("Particles/Burst");

            //set the trigger for the burst effect
            ParticleSystemTrigger trigger = this.burstParticleSystem.GetTriggerByName("burst");

            for (int i = 0; i < this.burstSources.Length; i++)
            {
                this.burstSources[i].SetBurstTrigger(trigger);
            }


            //this will only have effect in DEBUG pc builds
            ParticleSystemHotLoader.Monitor(this.UpdateManager, this.smokeParticleSystem);
            ParticleSystemHotLoader.Monitor(this.UpdateManager, this.fireParticleSystem);
            ParticleSystemHotLoader.Monitor(this.UpdateManager, this.burstParticleSystem);
        }
Exemplo n.º 10
0
 public void LoadTextures(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     //Content.Load<Texture2D>("Name")
     Background     = Content.Load <Texture2D>("GameResources/BackGrounds/Background");
     shipTex        = Content.Load <Texture2D>("GameResources/Ships/ship");
     bulletTexSheet = Content.Load <Texture2D>("GameResources/Bullets/BulletSheet");
 }
Exemplo n.º 11
0
 public void Initialise(Map map, Microsoft.Xna.Framework.Content.ContentManager Content, float gunAngle, Vector2 gunPosition,
                        float destruction, float destructionRange, float range)
 {
     explosionScale        = .2f;
     fireScale             = .1f;
     contact               = false;
     Exuasted              = false;
     explosionCount        = 0;
     fireCount             = 0;
     this.range            = range;
     this.map              = map;
     this.range            = range;
     this.gunAngle         = gunAngle;
     this.gunPosition      = gunPosition;
     bulletPosition        = gunPosition;
     this.destruction      = destruction;
     this.destructionRange = destructionRange;
     bulletSpeed           = 5f;
     bullet      = Content.Load <Texture2D>("ball");
     WaterSplash = Content.Load <SoundEffect>("WaterSplash");
     Explosion   = Content.Load <SoundEffect>("Bomb+1");
     //Load Explosion Sprites
     explosion = new Texture2D[12];
     for (int num = 0; num < explosion.Length; num++)
     {
         explosion[num] = Content.Load <Texture2D>("Explosion_" + num.ToString());
     }
     landingPosition = new Vector2();
     CalculateLanding();
 }
Exemplo n.º 12
0
 public override void LoadRes(Microsoft.Xna.Framework.Content.ContentManager cm)
 {
     // Define the resource used as background
     background = new StaticSprite(cm.Load <Texture2D>("test/floor"));
     // Defines the Tex2D that is used to check for walls
     wallDef = cm.Load <Texture2D>("test/Test Room Red");
 }
Exemplo n.º 13
0
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            gamePad = new GamePadMapper(PlayerIndex.One);

            GameSprite background = new GameSprite(Content.Load <Texture2D>("Background\\Error"), Vector2.Zero, Color.White);

            background.Scale = Global.Scale;


            //errorDropInFont = new DropInFont(Content.Load<SpriteFont>("Fonts\\JingJingTitle"), new Vector2(400, 50), new Vector2(400, 50), dropSpeed, "Error", Color.CornflowerBlue);
            //errorDropInFont.IsVisible = true;
            //errorDropInFont.SetCenterAsOrigin();
            //errorDropInFont.EnableShadow = false;
            //errorDropInFont.TintColor = Color.Black;
            //errorDropInFont.ShadowPosition = new Vector2(errorDropInFont.Position.X - 4, errorDropInFont.Position.Y + 4);
            //errorDropInFont.ShadowColor = Color.Gray;

            //errorInfoFadingFont = new FadingFont(Content.Load<SpriteFont>("Fonts\\SpriteFont1"), new Vector2(_viewPort.Width / 2, _viewPort.Height / 2 - 50), 0.1f, 1.0f, 0.01f, 1.0f, errorInfo, Color.White, false);
            //errorInfoFadingFont.SetCenterAsOrigin();
            //errorInfoFadingFont.EnableShadow = false;

            backButton          = new Button(Content.Load <Texture2D>("Buttons//Back"), new Vector2(0, 0), Color.White, new Rectangle(0, 149, 159, 169), new Rectangle(0, 0, 159, 149));
            backButton.Origin   = new Vector2(backButton.Texture.Width / 2, 169);
            backButton.Position = new Vector2(177, 907 + backButton.SourceRectangle.Value.Height / 2);

            //_sprites.Add(errorDropInFont);
            //_sprites.Add(errorInfoFadingFont);
            _sprites.Add(background);
            _sprites.Add(backButton);

            if (!Global.UsingKeyboard)
            {
                backButton.IsPressed = true;
            }
        }
Exemplo n.º 14
0
 public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content, string assetName)
 {
     base.LoadContent(content, assetName);
     heart2   = content.Load <Texture2D>("heartv2");
     heart1   = content.Load <Texture2D>("heartv1");
     Position = new Microsoft.Xna.Framework.Vector2(0, 0);
 }
Exemplo n.º 15
0
 /// <summary>
 /// Loads all of the entity textures.
 /// </summary>
 /// <param name="Content"></param>
 public void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     AddEntityTexture("Cat Girl", Content.Load <Texture2D>("Character Cat Girl"));
     AddEntityTexture("Tree", Content.Load <Texture2D>("Tree Tall"));
     AddEntityTexture("Princess", Content.Load <Texture2D>("Character Princess Girl"));
     AddEntityTexture("Bug", Content.Load <Texture2D>("Enemy Bug"));
 }
Exemplo n.º 16
0
 public static void LoadHelpers(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     fntWhiteFont           = Content.Load <SpriteFont>("Fonts/arialCustom10-5");
     fntWhiteFont.Spacing   = -7;
     _fntShadowFont         = Content.Load <SpriteFont>("Fonts/arialCustom10-5S");
     _fntShadowFont.Spacing = -7;
 }
Exemplo n.º 17
0
        public static void LoadTextures(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            List <string> filenames = Directory.EnumerateFiles("Content/TileSets").Select(Path.GetFileName).ToList <string>();

            foreach (string tileSetName in filenames)
            {
                string tileSetPath = "Content/TileSets/" + tileSetName;

                List <TextureData> currentTileSet = new List <TextureData>();
                XmlReader          tileReader     = XmlReader.Create(tileSetPath);
                while (tileReader.Read())
                {
                    //for each tile in the tileset file, add its file location to the tileset list.
                    if ((tileReader.NodeType == XmlNodeType.Element) && (tileReader.Name == "image"))
                    {
                        string      textureName = tileReader.GetAttribute("source");
                        TextureData newTexture  = new TextureData(content.Load <Texture2D>(textureName), textureName);
                        currentTileSet.Add(newTexture);
                    }
                    tileReader.Read();
                }

                TileSets.Add(tileSetPath, currentTileSet);
            }

            speechBubble = content.Load <Texture2D>(@"UI/Speech3");
        }
 public MonoGameDrawer(string textureName, string fontName, Microsoft.Xna.Framework.Graphics.SpriteBatch sprite_batch,
                       Microsoft.Xna.Framework.Content.ContentManager content_manager)
 {
     this.sprite_batch    = sprite_batch;
     this.content_manager = content_manager;
     this.texture         = content_manager.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(textureName);
     this.font            = content_manager.Load <Microsoft.Xna.Framework.Graphics.SpriteFont>(fontName);
 }
Exemplo n.º 19
0
 public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     base.LoadContent(Content);
     background  = new Sprite(Content.Load <Texture2D>("keyboardgame/background")); // On appelle le constructeur de Sprite avec un argument texture2D
     gordon_up   = new Sprite(Content.Load <Texture2D>("keyboardgame/gordon_up"));
     gordon_down = new Sprite(Content.Load <Texture2D>("keyboardgame/gordon_down"));
     arial       = Content.Load <SpriteFont>("keyboardgame/arial");
 }
Exemplo n.º 20
0
 public static void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     background    = new Sprite(Content.Load <Texture2D>("transition_screen/background"));
     life          = new Sprite(Content.Load <Texture2D>("transition_screen/life"));
     life_broken   = new Sprite(Content.Load <Texture2D>("transition_screen/life_broken"));
     bande         = new Sprite(Content.Load <Texture2D>("transition_screen/bande_vague"));
     bande_reverse = new Sprite(Content.Load <Texture2D>("transition_screen/bande_vague_reverse"));
 }
Exemplo n.º 21
0
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            Day    = Content.Load <Texture2D>(DayFile);
            Night  = Content.Load <Texture2D>(NightFile);
            Sunset = Content.Load <Texture2D>(SunsetFile);

            base.Load(Content);
        }
Exemplo n.º 22
0
 public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     base.LoadContent(Content);
     background      = new Sprite(Content.Load <Texture2D>("dabgame/background")); // On appelle le constructeur de Sprite avec un argument texture2D
     gordon_chocolat = new Sprite(Content.Load <Texture2D>("dabgame/gordon-chocolat"));
     gordon_bd       = Content.Load <Texture2D>("dabgame/gordon-bd");
     gordon_bg       = Content.Load <Texture2D>("dabgame/gordon-bg");
     hm = Content.Load <SoundEffect>("dabgame/hm");
 }
Exemplo n.º 23
0
        /// <summary>
        /// Add a Texture2D to the ContentManager storage of 2D textures.
        /// </summary>
        /// <param name="name">The name/key for later acces of the texture.</param>
        /// <param name="path">The path to the pipelined image file.</param>
        public static void AddTexture(string name, string path)
        {
            if (textures.ContainsKey(name))
            {
                return;
            }

            textures.Add(name, _content.Load <Texture2D>(path));
        }
Exemplo n.º 24
0
        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager contentLoader, Manifracture.ComponentManifest manifest)
        {
            IrradianceMap      = contentLoader.Load <Texture2D>((string)(manifest.Properties[ManifestKeys.IRRADIANCEMAP]));
            SpecPrefilter      = contentLoader.Load <Texture2D>((string)(manifest.Properties[ManifestKeys.SPECPREFILTER]));
            NumSpecLevels      = (int)(manifest.Properties[ManifestKeys.NUMSPECLEVELS]);
            SpecExponentFactor = (float)(manifest.Properties[ManifestKeys.SPECEXPONENTFACTOR]);
            AmbientLight       = (Vector3)(manifest.Properties[ManifestKeys.AMBIENTLIGHT]);

            Owner.ActorInitialized += ActorInitializedHandler;
        }
Exemplo n.º 25
0
 static void CheckButton4(MouseState state, Microsoft.Xna.Framework.Content.ContentManager Content, MouseState previousState)
 {
     if (state.X >= TextButton4X && state.X <= TextButton4X + 280 && state.Y > TextButton4Y && state.Y <= TextButton4Y + 150)
     {
         if (TextButton4 != Content.Load <Texture2D>("Images/TextButton4") && TextButton4 != Content.Load <Texture2D>("Images/TextButton5"))
         {
             if (state.LeftButton == ButtonState.Released && previousState.LeftButton == ButtonState.Pressed)
             {
                 CheckStory(4, Content);
             }
             else if (state.LeftButton == ButtonState.Pressed)
             {
                 TextButton4 = Content.Load <Texture2D>("Images/TextButton3");
             }
             else
             {
                 TextButton4 = Content.Load <Texture2D>("Images/TextButton2");
             }
         }
         else if (TextButton4 == Content.Load <Texture2D>("Images/TextButton5") && state.LeftButton == ButtonState.Released)
         {
             TextButton4 = Content.Load <Texture2D>("Images/TextButton4");
         }
         else if (TextButton4 == Content.Load <Texture2D>("Images/TextButton4") && state.LeftButton == ButtonState.Pressed)
         {
             TextButton4 = Content.Load <Texture2D>("Images/TextButton5");
         }
     }
     else if (TextButton4 != Content.Load <Texture2D>("Images/TextButton4") && TextButton4 != Content.Load <Texture2D>("Images/TextButton5"))
     {
         TextButton4 = Content.Load <Texture2D>("Images/TextButton");
     }
 }
Exemplo n.º 26
0
 static void ClearButtons(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     TextButton1Text = "";
     TextButton2Text = "";
     TextButton3Text = "";
     TextButton4Text = "";
     TextButton1     = Content.Load <Texture2D>("Images/TextButton4");
     TextButton2     = Content.Load <Texture2D>("Images/TextButton4");
     TextButton3     = Content.Load <Texture2D>("Images/TextButton4");
     TextButton4     = Content.Load <Texture2D>("Images/TextButton4");
 }
Exemplo n.º 27
0
        public void newEntity(IEntity createdEntity, int x, int y)
        {
            // Add the new entity to the SceneManagers entity list
            //mEntities.Add(createdEntity);

            mSceneGraph.Add(createdEntity);
            // Apply the entities texture
            mEntities.ForEach(IEntity => IEntity.aTexture = Content.Load <Texture2D>(IEntity.aTexturename));
            // Set the entities initial position
            createdEntity.setPos(x, y);
            createdEntity.DefaultPos = new Vector2(x, y);
        }
Exemplo n.º 28
0
        } = 4000;                                                  // Limit of time in ms, will decrease over time

        public static void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            foreach (MiniGame minigame in minigames)
            {
                minigame.LoadContent(Content);
            }
            TransitionScreen.LoadContent(Content);
            r        = new Random();
            gameover = Content.Load <SoundEffect>("music/gameover");
            next     = Content.Load <SoundEffect>("music/next");
            Transition();
        }
Exemplo n.º 29
0
        public static void LoadFrom_Content(Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            Content.RootDirectory = @"Content";

            font_MgGenFont = Content.Load <SpriteFont>("MgGenFont");
            texture_QuertyKeyBoardSmall = Content.Load <Texture2D>("QuertyKeyBoardSmall");

            SpriteFontList.Add(font_MgGenFont);
            Texture2DList.Add(texture_QuertyKeyBoardSmall);


            Content.RootDirectory = @"Content";
        }
Exemplo n.º 30
0
        public Player(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            IsJumping = false;

            walkSprite        = new AnimationSprite(content.Load <Texture2D>("WalkSheet"), new Rectangle(0, 0, 150, 150), 7, 0.4f);
            walkSprite.IsLoop = true;

            jumpUpSprite        = new AnimationSprite(content.Load <Texture2D>("JumpUpSheet"), new Rectangle(0, 0, 150, 150), 7, 0.5f);
            jumpUpSprite.IsLoop = false;

            jumpDownSprite        = new AnimationSprite(content.Load <Texture2D>("JumpDownSheet"), new Rectangle(0, 0, 150, 150), 5, 0.4f);
            jumpDownSprite.IsLoop = false;
        }
Exemplo n.º 31
0
        public bool LoadFont(ContentManager content)
        {
            try
            {
                _font = content.Load<SpriteFont>(_fileName);
                _ready = true;
            }
            catch
            {
                return false;
            }

            return true;
        }
 public bool Load(ContentManager content)
 {
     if (_ready)
         return true;
     try
     {
         _texture = content.Load<Texture2D>(_fileName);
         _ready = true;
     }
     catch (System.Exception ex)
     {
         Systems.ConsoleWindow.WriteLine("Warning: {0}", ex.Message);
         return false;
     }
     return true;
 }
Exemplo n.º 33
0
 private void LoadImageData(string contentName, ContentManager nativeContent)
 {
     NativeTexture = nativeContent.Load<Texture2D>(contentName);
     pixelSize = new Size(NativeTexture.Width, NativeTexture.Height);
 }
Exemplo n.º 34
0
        /// <summary>
        /// Loads the content.
        /// </summary>
        /// <param name="xnaContent">Content of the xna.</param>
        /// <param name="graphicsManager">The graphics manager.</param>
        public void LoadContent(XnaContentManager xnaContent, IBallerburgGraphicsManager graphicsManager)
        {
            if (null != this.content)
              {
            return;
              }

              content = xnaContent;
              content.RootDirectory = "Content";

              MenuFont = this.content.Load<SpriteFont>("menufont");
              DebugColorTexture = this.content.Load<Texture2D>("solidred");
              BackgroundTexture = this.content.Load<Texture2D>("Pic2");
              MenuTexture = this.content.Load<Texture2D>("Pic4");
              GameFont = this.content.Load<SpriteFont>("gamefont");
              SkyBox = this.content.Load<SkyBox>(@"Skybox\SkyBox");
              GradientTexture = this.content.Load<Texture2D>("Pic3");
              MousePointerTexture = this.content.Load<Texture2D>(@"Arrow3");
              Castle1 = this.content.Load<Castle>(@"Castles\Castle1");
              Castle1.Initialize(graphicsManager.GraphicsDevice);
              Castle2 = this.content.Load<Castle>(@"Castles\Castle2");
              Castle2.Initialize(graphicsManager.GraphicsDevice);
              Castle3 = this.content.Load<Castle>(@"Castles\Castle3");
              Castle3.Initialize(graphicsManager.GraphicsDevice);
              Castle4 = this.content.Load<Castle>(@"Castles\Castle4");
              Castle4.Initialize(graphicsManager.GraphicsDevice);
              Castle5 = this.content.Load<Castle>(@"Castles\Castle5");
              Castle5.Initialize(graphicsManager.GraphicsDevice);
              Castle6 = this.content.Load<Castle>(@"Castles\Castle6");
              Castle6.Initialize(graphicsManager.GraphicsDevice);
              Castle7 = this.content.Load<Castle>(@"Castles\Castle7");
              Castle7.Initialize(graphicsManager.GraphicsDevice);
              Castle8 = this.content.Load<Castle>(@"Castles\Castle8");
              Castle8.Initialize(graphicsManager.GraphicsDevice);
              ExplosionFrame01 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame01");
              ExplosionFrame02 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame02");
              ExplosionFrame03 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame03");
              ExplosionFrame04 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame04");
              ExplosionFrame05 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame05");
              ExplosionFrame06 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame06");
              ExplosionFrame07 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame07");
              ExplosionFrame08 = this.content.Load<Texture2D>(@"Explosion\Explosion_Frame08");
              CannonTexture = this.content.Load<Texture2D>("Tex8");
              KugelMesh = this.content.Load<Model>("SphereNew");
              BlankTexture = this.content.Load<Texture2D>("blank");
              WhiteTexture = this.content.Load<Texture2D>("WhiteRect");
              TerrainTexture = this.content.Load<Texture2D>("Tex1");
              CursorTexture = this.content.Load<Texture2D>(@"GUI\cursor");
              CannonBallTexture = this.content.Load<Texture2D>(@"SphereFinal");

              BackgroundMusicTracks = new Dictionary<string, Song>();
              BackgroundMusicTracks.Add("Darkstar", content.Load<Song>(@"Audio\Music1"));
              BackgroundMusicTracks.Add("HighTension", content.Load<Song>(@"Audio\Music2"));
              BackgroundMusicTracks.Add("Tentacle", content.Load<Song>(@"Audio\Music3"));
              BackgroundMusicTracks.Add("DeathRow", content.Load<Song>(@"Audio\Music4"));
              BackgroundMusicTracks.Add("Boomerang", content.Load<Song>(@"Audio\Music5"));
        }