Ejemplo n.º 1
1
        public void Init(ContentManager content, Vector2 position, string normalTextureName, string hoverTextureName)
        {
            m_Normal = content.Load<Texture2D>(normalTextureName);
            m_Hover = content.Load<Texture2D>(hoverTextureName);

            m_ButtonRec = new Rectangle((int)position.X, (int)position.Y, m_Normal.Width, m_Normal.Height);
        }
Ejemplo n.º 2
0
        public Player(ContentManager content)
        {
            mapManager = new MapManager(content);
            _map = mapManager.CreateMap(Global.LEVEL);
            towerButtons = Data.loadTowerButton(content);
            waveManager = Data.loadWave(Global.LEVEL);
            SetUpPanel(content);
            coin_tex = content.Load<Texture2D>(@"Sprite\Image\coin");
            coin = new NormalSprite(coin_tex, 0, 0, coin_tex.Width, coin_tex.Height);

            speed_1_tex = content.Load<Texture2D>(@"Sprite\Image\Menu\button_x1");
            NormalSprite speed_1 = new NormalSprite(speed_1_tex, 685, 5, speed_1_tex.Width / 2, speed_1_tex.Height);
            increaseSpeed_1 = new Checkbox(speed_1, 2, Global.NEW_GAME_SPEED == 1 ? true : false);
            speedButtonList.Add(increaseSpeed_1);

            skip_tex = content.Load<Texture2D>(@"Sprite\Image\Menu\button_skip");
            NormalSprite speed_2 = new NormalSprite(skip_tex, 720, 5, skip_tex.Width / 2, skip_tex.Height);
            increaseSpeed_2 = new Checkbox(speed_2, 2, Global.NEW_GAME_SPEED == 2 ? true : false);
            speedButtonList.Add(increaseSpeed_2);

            speed_3_tex = content.Load<Texture2D>(@"Sprite\Image\Menu\button_x3");
            NormalSprite speed_3 = new NormalSprite(speed_3_tex, 755, 5, speed_3_tex.Width / 2, speed_3_tex.Height);
            increaseSpeed_3 = new Checkbox(speed_3, 2, Global.NEW_GAME_SPEED == 3 ? true : false);
            speedButtonList.Add(increaseSpeed_3);

            _content = content;
        }
Ejemplo n.º 3
0
            public TileMap3D(GraphicsDevice graphicsDevice, ContentManager contentManager, int width, int height)
            {
                this.GraphicsDevice = graphicsDevice;
                Wall = contentManager.Load<Model>("Models/TileMap3D/Wall");
                FloorTile = contentManager.Load<Model>("Models/TileMap3D/FloorTile");
                Dirt = contentManager.Load<Model>("Models/TileMap3D/Dirt");
                Cleaner = contentManager.Load<Model>("Models/TileMap3D/Cleaner");

                ((BasicEffect)Wall.Meshes[0].Effects[0]).EnableDefaultLighting();
                ((BasicEffect)FloorTile.Meshes[0].Effects[0]).EnableDefaultLighting();
                ((BasicEffect)Dirt.Meshes[0].Effects[0]).EnableDefaultLighting();
                ((BasicEffect)Cleaner.Meshes[0].Effects[0]).EnableDefaultLighting();
                foreach (BasicEffect effect in Cleaner.Meshes[0].Effects)
                    effect.Tag = effect.DiffuseColor;
                foreach (BasicEffect effect in FloorTile.Meshes[0].Effects)
                    effect.Tag = effect.DiffuseColor;

                dss.DepthBufferEnable = true;
                dss.DepthBufferFunction = CompareFunction.LessEqual;
                dss.DepthBufferWriteEnable = true;
                rs.CullMode = CullMode.CullCounterClockwiseFace;
                ss.AddressU = TextureAddressMode.Wrap;
                ss.AddressV = TextureAddressMode.Wrap;
                ss.Filter = TextureFilter.Anisotropic;

                Camera = new Camera(graphicsDevice.Viewport.AspectRatio, graphicsDevice);
            }
Ejemplo n.º 4
0
 public void LoadContent(ContentManager Content)
 {
     verdana12 = Content.Load<SpriteFont>(FontFolder + "Verdana");
     sourceCodePro = Content.Load<SpriteFont>(FontFolder + "SourceCodeProLight");
     lucidaSansTypewriter = Content.Load<SpriteFont>(FontFolder + "LucidaSansTypewriter");
     wingDings = Content.Load<SpriteFont>(FontFolder + "Wingdings");
 }
Ejemplo n.º 5
0
 public void LoadContent(ContentManager content)
 {
     GUITexture = content.Load<Texture2D>(assetName);
     GUIRect = new Rectangle(0, 0, GUITexture.Width, GUITexture.Height);
     MusiqueMain = content.Load<Song>(@"Sons\Musiques\MusiqueTest");
     MusiqueMenu = content.Load<Song>(@"Sons\Musiques\Musique_Menu_Test");
 }
Ejemplo n.º 6
0
        public Slider(ContentManager content, Vector2 position, Vector2 sizeInPx, float value, Color color, SliderType type)
        {
            //Save the properties of the slider
            _position = position;
            _sizeInPx = sizeInPx;
            _value = value;
            _color = color;
            _type = type;

            //Load some basic content
            content.Load<Texture2D>("UIElements/sliderMiddle");
            content.Load<Texture2D>("UIElements/sliderEnd");
            content.Load<Texture2D>("UIElements/sliderMarker");

            //Set the zero zone and max zone values
            if (type == SliderType.HorizontalSlider)
            {
                _zeroZoneMax = Vector2.Multiply(sizeInPx, new Vector2(0.1f, 1.0f)) + position;
                _maxZoneMin = Vector2.Multiply(sizeInPx, new Vector2(0.9f, 1.0f)) + position;
            }
            else if (type == SliderType.VerticalSlider)
            {
                _zeroZoneMax = Vector2.Multiply(sizeInPx, new Vector2(1.0f, 0.1f)) + position;
                _maxZoneMin = Vector2.Multiply(sizeInPx, new Vector2(1.0f, 0.9f)) + position;
            }

            //Initialize all of the necessary boundries
            _bounds = new Rectangle((int)position.X, (int)position.Y, (int)sizeInPx.X, (int)sizeInPx.Y);
            _zeroZoneBounds = new Rectangle((int)position.X, (int)position.Y, (int)(sizeInPx.X * 0.1f), (int)sizeInPx.Y);
            _normalZoneBounds = new Rectangle((int)(position.X + sizeInPx.X * 0.1f), (int)position.Y, (int)(sizeInPx.X * 0.8f), (int)sizeInPx.Y);
            _maxZoneBounds = new Rectangle((int)(position.X + sizeInPx.X * 0.9f), (int)position.Y, (int)(sizeInPx.X * 0.1f), (int)sizeInPx.Y);
            _markerZoneBounds = new Rectangle((int)(_normalZoneBounds.Width * _value + position.X), (int)position.Y, _sliderMarker.Width, (int)sizeInPx.Y);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Load your graphics content.
        /// </summary>
        public void Load(GraphicsDevice device, ContentManager content)
        {
            GraphicsDevice = device;

            spriteBatch = new SpriteBatch(GraphicsDevice);

            bloomExtractEffect = content.Load<Effect>("BloomExtract");
            bloomCombineEffect = content.Load<Effect>("BloomCombine");
            gaussianBlurEffect = content.Load<Effect>("GaussianBlur");


            // Look up the resolution and format of our main backbuffer.
            PresentationParameters pp = GraphicsDevice.PresentationParameters;

            int width = pp.BackBufferWidth;
            int height = pp.BackBufferHeight;

            SurfaceFormat format = pp.BackBufferFormat;

            // Create a texture for reading back the backbuffer contents.
            resolveTarget = new ResolveTexture2D(GraphicsDevice, width, height, 1, format);

            // Create two rendertargets for the bloom processing. These are half the
            // size of the backbuffer, in order to minimize fillrate costs. Reducing
            // the resolution in this way doesn't hurt quality, because we are going
            // to be blurring the bloom images in any case.
            width /= 4;
            height /= 4;

            renderTarget1 = new RenderTarget2D(GraphicsDevice, width, height, 1, format);
            renderTarget2 = new RenderTarget2D(GraphicsDevice, width, height, 1, format);
        }
Ejemplo n.º 8
0
 public static void Load(ContentManager Content)
 {
     ShadowEffectList.Add(Content.Load<Effect>(@"Shaders\distort"));
     ShadowEffectList.Add(Content.Load<Effect>(@"Shaders\fade"));
     ShadowEffectList.Add(Content.Load<Effect>(@"Shaders\reduction"));
     ShadowEffectList.Add(Content.Load<Effect>(@"Shaders\resolve"));
 }
Ejemplo n.º 9
0
        public override bool InitOne(Microsoft.Xna.Framework.Content.ContentManager content, int id)
        {
            XmlDocument _doc = new XmlDocument();

            _doc.Load(_xmlInfo);
            XmlNode _label = _doc.SelectSingleNode("//Label[@id = '" + id.ToString() + "']");

            _prototype[id] = new Label();

            _prototype[id]._nsprite = 1;
            _prototype[id]._sprite  = new GameSprite[_prototype[id]._nsprite];
            Texture2D _tempTexture = content.Load <Texture2D>(_label.SelectSingleNode("BackGround").InnerText);

            _prototype[id]._sprite[0] = new GameSprite(_tempTexture, 0, 0);

            ((Label)_prototype[id]).Sf         = content.Load <SpriteFont>(_label.SelectSingleNode("Font").InnerText);
            ((Label)_prototype[id]).StringInfo = _label.SelectSingleNode("StringInfo").InnerText;
            _prototype[id].X       = int.Parse(_label.SelectSingleNode("X").InnerText);
            _prototype[id].Y       = int.Parse(_label.SelectSingleNode("Y").InnerText);
            _prototype[id].OffSetX = _prototype[id].X;
            _prototype[id].OffSetY = _prototype[id].Y;
            ((Label)_prototype[id]).DrawOffSetX = int.Parse(_label.SelectSingleNode("DrawOffSetX").InnerText);
            ((Label)_prototype[id]).DrawOffSetY = int.Parse(_label.SelectSingleNode("DrawOffSetY").InnerText);

            float _red   = float.Parse(_label.SelectSingleNode("Color").SelectSingleNode("R").InnerText);
            float _green = float.Parse(_label.SelectSingleNode("Color").SelectSingleNode("G").InnerText);
            float _blue  = float.Parse(_label.SelectSingleNode("Color").SelectSingleNode("B").InnerText);

            ((Label)_prototype[id]).StringColor = new Color(_red, _green, _blue);

            return(true);
        }
Ejemplo n.º 10
0
 public void LoadContent(ContentManager content)
 {
     this.images = new Texture2D[] {content.Load<Texture2D>(ImageName1), content.Load<Texture2D>(ImageName2)};
     current = images[0];
     this.Width = images[0].Width;
     this.Height = images[0].Height;
 }
Ejemplo n.º 11
0
 public static void LoadContent(ContentManager content)
 {
     BoardBackground = content.Load<Texture2D>("BoardBack");
     Circle = content.Load<Texture2D>("circle");
     Cross = content.Load<Texture2D>("cross");
     Cursor = content.Load<Texture2D>("glove");
 }
Ejemplo n.º 12
0
 public ObstacleFactory(ContentManager Content)
 {
     rand = new Random();
     branch = Content.Load<Texture2D>("Lumberjack Bustle/BranchObstacle");
     root = Content.Load<Texture2D>("Lumberjack Bustle/FloorObstacle");
     smash = Content.Load<Texture2D>("Lumberjack Bustle/ChopObstacle");
 }
Ejemplo n.º 13
0
partial         void CarregaFontes(ContentManager Content)
        {
            this.fonte = Content.Load<SpriteFont>(CAMINHO_FONTE+"FontePrincipal");
            this.fonte10 = Content.Load<SpriteFont>(CAMINHO_FONTE + "Fonte10");
            this.fonte8 = Content.Load<SpriteFont>(CAMINHO_FONTE + "FOnte8");
            this.fonteMenuUnidade = Content.Load<SpriteFont>(CAMINHO_FONTE + "FonteMenuUnidade");
        }
 public override void Load(ContentManager Content)
 {
     HUDTexture = Content.Load<Texture2D>("sprites/hud");
     PrincessHUD = Content.Load<Texture2D>("sprites/hud_sweetcheeks");
     BossBar = Content.Load<Texture2D>("sprites/boss_healthbar");
     BossHealth = Content.Load<Texture2D>("sprites/boss_health");
 }
Ejemplo n.º 15
0
 public void load(ContentManager content)
 {
     texture = content.Load<Texture2D>("Sprites//Laser");
     textureOverlay = content.Load<Texture2D>("Sprites//Laser2");
     test = content.Load<Texture2D>("Sprites//Pixel");
     textureGlow = content.Load<Texture2D>("Sprites//Glow");
 }
Ejemplo n.º 16
0
        public static void inicializar(ContentManager content)
        {
            jogador.textura = content.Load<Texture2D>("Kirby");
            inimigo.textura = content.Load<Texture2D>("ms5");

            background = content.Load<Texture2D>("Fundo");
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Creates a new instance of a LavaFighter enemy ship
        /// </summary>
        /// <param name="content">A ContentManager to load resources with</param>
        /// <param name="position">The position of the Dart ship in the game world</param>
        public LavaFighter(uint id, ContentManager content, Vector2 position)
            : base(id)
        {
            this.position = position;
            this.Score = 18;

            spritesheet = content.Load<Texture2D>("Spritesheets/newshe.shp.000000");
            bulletFired = content.Load<SoundEffect>("SFX/gamalaser");

            spriteBounds[(int)LavaFighterSteeringState.Left].X = 76;
            spriteBounds[(int)LavaFighterSteeringState.Left].Y = 197;
            spriteBounds[(int)LavaFighterSteeringState.Left].Width = 20;
            spriteBounds[(int)LavaFighterSteeringState.Left].Height = 28;

            spriteBounds[(int)LavaFighterSteeringState.Straight].X = 51;
            spriteBounds[(int)LavaFighterSteeringState.Straight].Y = 197;
            spriteBounds[(int)LavaFighterSteeringState.Straight].Width = 20;
            spriteBounds[(int)LavaFighterSteeringState.Straight].Height = 28;

            spriteBounds[(int)LavaFighterSteeringState.Right].X = 28;
            spriteBounds[(int)LavaFighterSteeringState.Right].Y = 197;
            spriteBounds[(int)LavaFighterSteeringState.Right].Width = 20;
            spriteBounds[(int)LavaFighterSteeringState.Right].Height = 28;

            steeringState = LavaFighterSteeringState.Straight;
        }
Ejemplo n.º 18
0
 public void LoadContent(ContentManager Content)
 {
     wallLeft   = Content.Load<Texture2D> ("../../Textures/Walls/Wall_left.png");
     wallRight  = Content.Load<Texture2D> ("../../Textures/Walls/Wall_right.png");
     wallTop    = Content.Load<Texture2D> ("../../Textures/Walls/Wall_top.png");
     wallBottom = Content.Load<Texture2D> ("../../Textures/Walls/Wall_bottom.png");
 }
 public static void LoadContent(ContentManager cm)
 {
     Arial = cm.Load<SpriteFont>(@"fonts\Arial");
     Tahoma = cm.Load<SpriteFont>(@"fonts\Tahoma");
     Calibri = cm.Load<SpriteFont>(@"fonts\Calibri");
     Verdana = cm.Load<SpriteFont>(@"fonts\Verdana");
 }
Ejemplo n.º 20
0
            public static void Load(Microsoft.Xna.Framework.Content.ContentManager p_loader)
            {
                JKContentManager.Particles._jump_particle      = p_loader.Load <Texture2D>("particles/jump_particle");
                JKContentManager.Particles.JumpParticleSprites = JKContentManager.Util.SpriteChopUtilGrid(JKContentManager.Particles._jump_particle, new Point(JKContentManager.Particles._jump_particle.Width / JKContentManager.Particles._jump_particle.Height, 1), new Vector2(0.5f, 1f));
                Texture2D texture2D = p_loader.Load <Texture2D>("particles/jump_particle_water");

                JKContentManager.Particles.JumpParticleSpritesWater = JKContentManager.Util.SpriteChopUtilGrid(texture2D, new Point(texture2D.Width / texture2D.Height, 1), new Vector2(0.5f, 1f));
                Texture2D texture2D2 = p_loader.Load <Texture2D>("particles/water_splash");

                JKContentManager.Particles.WaterSplashSprites = JKContentManager.Util.SpriteChopUtilGrid(texture2D2, new Point(texture2D2.Width / texture2D2.Height, 1), new Vector2(0.5f, 0.5f));
                JKContentManager.Particles.SnowSettings       = XmlSerializerHelper.Deserialize <SnowParticleEntity.SnowSettings>("Content/mods/particles/snow_settings.xml");
                JKContentManager.Particles._snow_particle     = p_loader.Load <Texture2D>("particles/snow_jump_particle");
                Rectangle rectangle = new Rectangle(0, 0, 144, 108);

                for (int i = 0; i < JKContentManager.Particles._snow_particle.Height / rectangle.Height; i++)
                {
                    rectangle.Y = rectangle.Height * i;
                    JKContentManager.Particles.SnowSprites.Add(i, JKContentManager.Util.SpriteChopUtilGrid(JKContentManager.Particles._snow_particle, new Point(4, 3), new Vector2(0.5f, 1f), rectangle));
                }
                WeatherManager.WeatherEffect weatherEffect = XmlSerializerHelper.Deserialize <WeatherManager.WeatherEffect>(p_loader.RootDirectory + "/mods/particles/weather.xml");
                foreach (WeatherManager.Weather weather in weatherEffect.weathers)
                {
                    JKContentManager.Particles.WeatherSprites.Add(weather.name, JKExtensions.UltraContent.LoadContentArr <Texture2D>(p_loader, "particles/" + weather.name));
                }
                WeatherManager.Load(weatherEffect);
            }
Ejemplo n.º 21
0
 public void LoadLevelSelection(string fileAddress,ContentManager content)
 {
     levelData.Clear();
     BFFileReader reader = new BFFileReader(fileAddress);
     reader.Open();
     string line = null;
     while((line = reader.ReadLine())!= null)
     {
         LevelData levelInfo;
         string[] param = line.Split(' ');
         levelInfo.name = param[0];
         levelInfo.texture = content.Load<Texture2D>(param[1]);
         levelData.AddLast(levelInfo);
     }
     reader.Close();
     data = levelData.First;
     //load the left and right arrow textures
     leftArrowTex = content.Load<Texture2D>("Left");
     rightArrowTex = content.Load<Texture2D>("Right");
     Texture2D exit = content.Load<Texture2D>("Exit");
     Texture2D start = content.Load<Texture2D>("Resume");
     font = content.Load<SpriteFont>("Font");
     selection = new Menu(4, new Rectangle(parent.ScreenWidth/2 -(exit.Width/2),parent.ScreenHeight/2+15,exit.Width,exit.Height),start,exit);
     time = InputDelay;
 }
Ejemplo n.º 22
0
 public Textures(ContentManager content)
 {
     this.smokeTexture = content.Load<Texture2D> ("smoke.png");
     this.fireTexture = content.Load<Texture2D> ("fire.png");
     this.splitterTexture = content.Load<Texture2D> ("splitter.png");
     this.shockwaveTexture = content.Load<Texture2D> ("shockwave.png");
 }
Ejemplo n.º 23
0
        public EndGame(ContentManager content)
        {
            _video = content.Load<Video>(@"Movies\EndGame");
            _endGameFont = content.Load<SpriteFont>(@"Fonts\MenuFont");

            _videoPlayer = new VideoPlayer();
        }
Ejemplo n.º 24
0
 public Jet(ContentManager content,Vector2 position)
 {
     this.texture = content.Load<Texture2D>("Sprites/jet");
     this.position = position;
     this.velocity = new Vector2(-12,0);
     jet = content.Load<SoundEffect>("Sounds/Jet fly by").CreateInstance();
 }
Ejemplo n.º 25
0
        public override void LoadContent()
        {
            content = new ContentManager(ScreenManager.Game.Services, "Content");

            optionsBackground = content.Load<Texture2D>("GUI/MenuBackground");

            //Buttons are 300 x 75
            Texture2D selectText = content.Load<Texture2D>("GUI/SelectButton");
            Texture2D cancelText = content.Load<Texture2D>("GUI/CancelButton");

            int menuX = (ScreenManager.GraphicsDevice.Viewport.Width / 2) - (optionsBackground.Width / 2);
            int menuY = (ScreenManager.GraphicsDevice.Viewport.Height / 2) - (optionsBackground.Height / 2);

            optionsRect = new Rectangle(menuX, menuY, optionsBackground.Width, optionsBackground.Height);

            Rectangle selectRect = new Rectangle(menuX, menuY + optionsBackground.Height, selectText.Width, selectText.Height);
            Rectangle cancelRect = new Rectangle(menuX + (optionsBackground.Width - cancelText.Width), menuY + optionsBackground.Height, selectText.Width, selectText.Height);

            selectButton = new GameLibrary.UI.Button(selectText, selectRect);
            cancelButton = new GameLibrary.UI.Button(cancelText, cancelRect);

            Vector2 position = new Vector2(menuX + ((optionsBackground.Width / 2)), menuY + ScreenManager.ScaleYPosition(50));

            Texture2D dummyTexture = new Texture2D(ScreenManager.GraphicsDevice, 1, 1);
            dummyTexture.SetData(new Color[] { Color.White });

            SpriteFont font = content.Load<SpriteFont>("Font");

            molesUpDown = new GameLibrary.UI.NumericUpDown(dummyTexture, position, GameLibrary.UI.Label.CENTER, 100.0f,font, 1m, 1m, 6m, 1m);

            position.Y += ScreenManager.ScaleYPosition(50);

            timerUpDown = new GameLibrary.UI.NumericUpDown(dummyTexture, position, GameLibrary.UI.Label.CENTER, 100.0f, font, 0.25m, 0.25m, 10.00m, 0.25m);

            position.Y += ScreenManager.ScaleYPosition(50);

            repetitionUpDown = new GameLibrary.UI.NumericUpDown(dummyTexture, position, GameLibrary.UI.Label.CENTER, 100.0f, font, 1m, 1m, 1000m, 1m);

            position.Y += ScreenManager.ScaleYPosition(75);

            List<String> hands = new List<String> { "Right", "Left" };

            handList = new GameLibrary.UI.List(hands, 175, 2, 25, position, dummyTexture, font, Color.Black, Color.White);

            position = new Vector2(menuX + ((optionsBackground.Width / 2)) - ScreenManager.ScaleXPosition(300), menuY + ScreenManager.ScaleYPosition(50));

            moleLabel = new GameLibrary.UI.Label("Number of Moles:", position, GameLibrary.UI.Label.LEFT, 200.0f, font);

            position.Y += ScreenManager.ScaleYPosition(50);

            timerLabel = new GameLibrary.UI.Label("Mole Up Time:", position, GameLibrary.UI.Label.LEFT, 200.0f, font);

            position.Y += ScreenManager.ScaleYPosition(50);

            repetitionLabel = new GameLibrary.UI.Label("Number of Reps:", position, GameLibrary.UI.Label.LEFT, 200.0f, font);

            position.Y += ScreenManager.ScaleYPosition(85);

            handLabel = new GameLibrary.UI.Label("Hand Used:", position, GameLibrary.UI.Label.LEFT, 200.0f, font);
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 
        /// </summary>
        public override void LoadContent()
        {
            content = new ContentManager(ScreenManager.Game.Services, "Content");

            menuBackground = content.Load<Texture2D>("GUI/MenuBackground");

            //Buttons are 300 x 75
            Texture2D exitText = content.Load<Texture2D>("GUI/ExitButton");
            Texture2D patientText = content.Load<Texture2D>("GUI/PatientButton");
            Texture2D optionsText = content.Load<Texture2D>("GUI/OptionsButton");

            int menuX = (ScreenManager.GraphicsDevice.Viewport.Width / 2) - (menuBackground.Width / 2);
            int menuY = (ScreenManager.GraphicsDevice.Viewport.Height / 2) - (menuBackground.Height / 2);

            menuRect = new Rectangle(menuX, menuY, menuBackground.Width, menuBackground.Height);

            int buttonSpace = 75;
            int buttonX = menuX + (menuBackground.Width / 2) - 150;
            int buttonY = menuY + buttonSpace;

            Rectangle patientRect = new Rectangle(buttonX, buttonY, patientText.Width, patientText.Height);
            Rectangle optionsRect = new Rectangle(buttonX, patientRect.Y + buttonSpace + patientText.Height, optionsText.Width, optionsText.Height);
            Rectangle exitRect = new Rectangle(buttonX, optionsRect.Y + buttonSpace + exitText.Height, exitText.Width, exitText.Height);

            exitButton = new GameLibrary.UI.Button(exitText, exitRect);
            patientButton = new GameLibrary.UI.Button(patientText, patientRect);
            optionsButton = new GameLibrary.UI.Button(optionsText, optionsRect);
        }
Ejemplo n.º 27
0
 public TileMap2D(ContentManager content)
 {
     WallTex = content.Load<Texture2D>("Textures/TileMap2D/WallTex");
     FloorTex = content.Load<Texture2D>("Textures/TileMap2D/FloorTex");
     DirtTex = content.Load<Texture2D>("Textures/TileMap2D/DirtTex");
     CleanerTex = content.Load<Texture2D>("Textures/TileMap2D/CleanerTex");
 }
Ejemplo n.º 28
0
 public static void LoadContent(ContentManager aContent)
 {
     s_Music = new SoundEffect[] {
         aContent.Load<SoundEffect>("music/Tea Party Theme A"),
         aContent.Load<SoundEffect>("music/Tea Party Theme B")
     };
 }
Ejemplo n.º 29
0
 public static void LoadContent(ContentManager Content)
 {
     menuLayer1 = Content.Load<SoundEffect>("audio/music/menu1").CreateInstance();
     menuLayer2 = Content.Load<SoundEffect>("audio/music/menu2").CreateInstance();
     // PLACEHOLDER
     battleMusic = Content.Load<SoundEffect>("audio/music/Drum_Loop").CreateInstance();
 }
Ejemplo n.º 30
0
 public override void Initialize(ContentManager content, WaveManager manager)
 {
     infiniteAmmoModeOn = true;
     infiniteFoodModeOn = true;
     isTutorialWave = true;
     waveSize = wavesize;
     spawnTimings = new List<double>(waveSize);
     enemiesToSpawn = new List<Enemy>(waveSize);
     lootList = new List<Loot>(waveSize);
     enemiesToSpawn.Insert(0, new Enemy1());
     spawnTimings.Insert(0, baseTime + 0 * interval);
     enemiesToSpawn.Insert(1, new Enemy1());
     spawnTimings.Insert(1, 2 * interval);
     enemiesToSpawn.Insert(2, new Enemy1());
     spawnTimings.Insert(2, 3.5 * interval);
     enemiesToSpawn.Insert(3, new Enemy1());
     spawnTimings.Insert(3, 5 * interval);
     enemiesToSpawn.Insert(waveSize - 1, new HeadShotTest());
     spawnTimings.Insert(waveSize - 1, baseTime + 6.5 * interval);
     lootList.Add(new SniperAmmoLoot(2, content));
     lootList.Add(new SniperAmmoLoot(2, content));
     //lootList.Add(new FoodLoot(1, content));
     lootList.Add(new MachineGunAmmoLoot(5, content));
     lootList.Add(new SniperAmmoLoot(2, content));
     lootList.Add(new MachineGunAmmoLoot(5, content));
     openingTextFilename = "Content//Text//TutorialWave1Open.txt";
     layout = new FoxholeLayout();
     helpTexture = content.Load<Texture2D>("Graphics\\Tutorial1Help");
     helpTextureController = content.Load<Texture2D>("Graphics\\Tutorial1HelpController");
     base.Initialize(content, manager);
 }
Ejemplo n.º 31
0
 public void LoadContent(ContentManager Content)
 {
     block1 = Content.Load<Texture2D>("block1");
     block2 = Content.Load<Texture2D>("block2");
     block1position = new Rectangle(0, 200, 100, 50);
     block2position = new Rectangle(300, 150, 20, 60);
 }
Ejemplo n.º 32
0
 public void LoadContent(ContentManager content)
 {
     AsteroidTexture1 = content.Load<Texture2D>(@"Sprites\Asteroids\Asteroid-1");
     AsteroidTexture2 = content.Load<Texture2D>(@"Sprites\Asteroids\Asteroid-2");
     AsteroidTexture3 = content.Load<Texture2D>(@"Sprites\Asteroids\Asteroid-3");
     AsteroidTexture4 = content.Load<Texture2D>(@"Sprites\Asteroids\Asteroid-4");
 }
Ejemplo n.º 33
0
        public static void Init(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            var WormIdle = content.Load <Texture2D>("Sprites\\widle");

            Animations[0] = new Animation.Animation("Idle", new SpriteImage(WormIdle, 1), false);

            var WormWalk = content.Load <Texture2D>("Sprites\\wwalk");

            Animations[1] = new Animation.Animation("Walk", new SpriteImage(WormWalk, 14), true);
        }
Ejemplo n.º 34
0
        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content, Microsoft.Xna.Framework.Graphics.SpriteBatch sprBatch)
        {
            m_sprBatch = sprBatch;

            Background = Content.Load <Texture2D>("GameState/Graphics/Credits/creditScreen");
            Cursor     = Content.Load <Texture2D>("FallDown/Textures/cursor");
            Arrow      = Content.Load <Texture2D>("FallDown/Textures/arrow");
            ListFont   = Content.Load <SpriteFont>("FallDown/Textures/ScoreFont");

            ArrowPosition = new Vector2(0, 480 - 50);

            base.LoadContent(Content, sprBatch);
        }
Ejemplo n.º 35
0
            public static SpriteFont SmartLoadFonts(Microsoft.Xna.Framework.Content.ContentManager p_loader, string fileName, int i)
            {
                string dir = "mods/font/";

                if (File.Exists(p_loader.RootDirectory + "/" + dir + fileName + ".xnb") && fileName != null)
                {
                    return(p_loader.Load <SpriteFont>(dir + fileName));
                }
                else
                {
                    return(p_loader.Load <SpriteFont>(fontsList[i]));
                }
            }
Ejemplo n.º 36
0
        protected override void LoadContent()
        {
            // Load content belonging to the screen manager.
            Microsoft.Xna.Framework.Content.ContentManager content = Game.Content;

            m_spriteBatch = new SpriteBatch(GraphicsDevice);
            m_font        = content.Load <SpriteFont>("Fonts\\Menu");
            blankTexture  = content.Load <Texture2D>("Interface\\blank");

            // Tell each of the screens to load their content.
            foreach (GameScreen screen in screens)
            {
                screen.LoadContent();
            }
        }
Ejemplo n.º 37
0
 public void loadContent(Microsoft.Xna.Framework.Content.ContentManager content)
 {
     try
     {
         menuFont          = content.Load <SpriteFont>("Fonts/Menu");
         menuItemFont      = content.Load <SpriteFont>("Fonts/MenuItem");
         testTexture       = content.Load <Texture2D>("Images/testImage");
         playerSpritesheet = content.Load <Texture2D>("Images/link");
     } catch (Exception e)
     {
         Console.WriteLine("Error: Could not load resource! Message from framework:\n" + e.Message + "\n" + e.StackTrace);
         Console.WriteLine("Terminating.");
         Game.quitGame();
     }
 }
Ejemplo n.º 38
0
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager cm)
        {
            tx_Hedef = cm.Load <Texture2D>(c_adi);
            int temp = Y / 10;

            Rec = new Microsoft.Xna.Framework.Rectangle(X, Y, tx_Hedef.Width + temp, tx_Hedef.Height + temp);
        }
Ejemplo n.º 39
0
    public void LoadContent(Microsoft.Xna.Framework.Content.ContentManager cManager)
    {
        font = cManager.Load <SpriteFont>("text");

        //Creates the main menu so that it displays when the game starts
        currentMenu = CreateMainMenu();
    }
Ejemplo n.º 40
0
        public override void LoadContent()
        {
            if (content == null)
            {
                content = new Microsoft.Xna.Framework.Content.ContentManager(ScreenManager.Game.Services, "Content");
            }

            backgroundTexture = content.Load <Texture2D>("Interface\\Menu");
        }
Ejemplo n.º 41
0
 public void LoadCombo(Microsoft.Xna.Framework.Content.ContentManager c, String name)
 {
     for (int i = 0; i < Combo.Length; i++)
     {
         String s = name.Insert(name.Length, "/");
         s = s.Insert(s.Length, comboName);
         s = s.Insert(s.Length, i.ToString());
         Combo[i].SetTex(c.Load <Texture2D>(s));
     }
 }
Ejemplo n.º 42
0
            public static void Load(Microsoft.Xna.Framework.Content.ContentManager p_loader)
            {
                string directory = "mods/props/textures/raven/";

                JKContentManager.RavenSprites.GoldRing        = Sprite.CreateSprite(p_loader.Load <Texture2D>("mods/props/textures/raven/gold_ring"));
                JKContentManager.RavenSprites.GoldRing.center = new Vector2(0.5f, 1f);
                JKContentManager.RavenSprites.Ruby            = Sprite.CreateSprite(p_loader.Load <Texture2D>("mods/props/textures/raven/ruby"));
                JKContentManager.RavenSprites.Ruby.center     = JKContentManager.RavenSprites.GoldRing.center;
                JKContentManager.RavenSprites.raven_settings  = UltraContent.LoadXmlFiles <RavenSettings>(Game1.instance, directory, ".ravset");
                List <string> list = JKContentManager.RavenSprites.raven_settings.Keys.ToList <string>();

                for (int i = 0; i < list.Count; i++)
                {
                    string        text  = list[i];
                    RavenSettings value = JKContentManager.RavenSprites.raven_settings[text];
                    value.name = text;
                    JKContentManager.RavenSprites.raven_settings[text] = value;
                    JKContentManager.RavenSprites.raven_content.Add(text, new JKContentManager.RavenSprites.RavenContent(p_loader.Load <Texture2D>("mods/props/textures/raven/" + JKContentManager.RavenSprites.raven_settings[text].texture)));
                }
                Sprite[] array = JKContentManager.Util.SpriteChopUtilGrid(p_loader.Load <Texture2D>("mods/props/textures/raven/raven"), new Point(3, 2), new Rectangle(0, 64, 144, 64));
                JKContentManager.RavenSprites.FlyEnding    = new Sprite[3];
                JKContentManager.RavenSprites.FlyEnding[0] = Sprite.CreateSprite(array[0].texture, array[0].source);
                JKContentManager.RavenSprites.FlyEnding[1] = Sprite.CreateSprite(array[1].texture, array[1].source);
                JKContentManager.RavenSprites.FlyEnding[2] = Sprite.CreateSprite(array[2].texture, array[2].source);
                Sprite[] array2 = JKContentManager.RavenSprites.FlyEnding;
                for (int j = 0; j < array2.Length; j++)
                {
                    array2[j].center = new Vector2(0.5f, 1f);
                }
                JKContentManager.RavenSprites.CarryCrown = JKContentManager.Util.SpriteChopUtilGrid(p_loader.Load <Texture2D>("mods/props/textures/raven/raven_crown"), new Point(3, 1));
                Vector2 center = Sprite.MakePixelCenter(new Vector2(0.5f, 1f), new Point(0, -16), JKContentManager.RavenSprites.CarryCrown[0].source.Size);

                array2 = JKContentManager.RavenSprites.CarryCrown;
                for (int j = 0; j < array2.Length; j++)
                {
                    array2[j].center = center;
                }
                JKContentManager.RavenSprites.OwlFlyingGargoyle = JKContentManager.Util.SpriteChopUtilGrid(p_loader.Load <Texture2D>("mods/ending/flying_gargoyle"), new Point(1, 3), new Vector2(0.5f, 0f));
            }
Ejemplo n.º 43
0
 public static void Load(Microsoft.Xna.Framework.Content.ContentManager p_loader)
 {
     JKContentManager.Ending.EndingImageCrown    = Sprite.CreateSprite(p_loader.Load <Texture2D>(SmartEndingLoad(ParseData._mod.Ending.MainBabe, "ending/imagecrown")));
     JKContentManager.Ending.EndingImageShoes    = Sprite.CreateSprite(p_loader.Load <Texture2D>(SmartEndingLoad(ParseData._mod.Ending.MainShoes, "ending/imageshoes")));
     JKContentManager.Ending.EndingImageCrownNBP = Sprite.CreateSprite(p_loader.Load <Texture2D>(SmartEndingLoad(ParseData._mod.Ending.NBPBabe, "nbp_imagecrown")));
     JKContentManager.Ending.EndingImageShoesNBP = Sprite.CreateSprite(p_loader.Load <Texture2D>(SmartEndingLoad(ParseData._mod.Ending.NBPShoes, "nbp_imageshoes")));
     JKContentManager.Ending.OwlEndingImageCrown = Sprite.CreateSprite(p_loader.Load <Texture2D>(SmartEndingLoad(ParseData._mod.Ending.OwlBabe, "owl_imagecrown")));
     JKContentManager.Ending.OwlEndingImageBird  = Sprite.CreateSprite(p_loader.Load <Texture2D>(SmartEndingLoad(ParseData._mod.Ending.OwlBird, "owl_imagebird")));
 }
Ejemplo n.º 44
0
            public static void Load(Microsoft.Xna.Framework.Content.ContentManager p_loader)
            {
                JKContentManager.Props.SilverCoin           = JKContentManager.Props.LoadCustomWorldItem(p_loader, "silver_coin");
                JKContentManager.Props.GiantBootsWorldItem  = JKContentManager.Props.LoadCustomWorldItem(p_loader, "shoes_iron");
                JKContentManager.Props.GnomeHatWorldItem    = JKContentManager.Props.LoadCustomWorldItem(p_loader, "gnome_hat");
                JKContentManager.Props.TunicWorldItem       = JKContentManager.Props.LoadCustomWorldItem(p_loader, "tunic");
                JKContentManager.Props.YellowShoesWorldItem = JKContentManager.Props.LoadCustomWorldItem(p_loader, "yellow_shoes");
                JKContentManager.Props.CapWorldItem         = JKContentManager.Props.LoadCustomWorldItem(p_loader, "cap");
                JKContentManager.Props.ShroomWorldItem      = JKContentManager.Props.LoadCustomWorldItem(p_loader, "shroom");
                JKContentManager.Props.GhostFragmentItem    = JKContentManager.Props.LoadCustomWorldItem(p_loader, "ghost_fragment");
                JKContentManager.Props.BugNoteItem          = JKContentManager.Props.LoadCustomWorldItem(p_loader, "bug_note");
                string str = "mods/props/textures/";

                JKContentManager.Props.PropScreens        = UltraContent.LoadXmlFiles <PropCollection>(Game1.instance, "mods/props", ".xml");
                JKContentManager.Props.NBP_Only_Props     = UltraContent.LoadXmlFiles <PropCollection>(Game1.instance, "mods/props/new babe plus props", ".xml");
                JKContentManager.Props.OWL_Only_Props     = UltraContent.LoadXmlFiles <PropCollection>(Game1.instance, "mods/props/owl props", ".xml");
                JKContentManager.Props.RaymanOverlayProps = UltraContent.LoadXmlFiles <PropCollection>(Game1.instance, "mods/props/hidden wall props", ".xml");
                PropSettings propSettings = XmlSerializerHelper.Deserialize <PropSettings>(p_loader.RootDirectory + "/mods/props/textures/prop_settings.xml");

                PropManager.SetContentData(propSettings);
                foreach (PropSetting propSetting in propSettings.settings)
                {
                    Texture2D p_texture = p_loader.Load <Texture2D>(str + propSetting.name);
                    JKContentManager.Props.PropSprites.Add(propSetting.name, JKContentManager.Util.SpriteChopUtilGrid(p_texture, propSetting.sheet_cells));
                }
                JKContentManager.Props.RaymanScreens = UltraContent.LoadXmlFiles <RaymanCollection>(Game1.instance, "mods/props/hidden_walls", ".xml");
                Dictionary <string, Texture2D> dictionary = JKExtensions.UltraContent.LoadCunt <Texture2D>(Game1.instance.Content, "mods/props/hidden_walls/textures", ".*");

                JKContentManager.Props.RaymanSprites = new Dictionary <string, Sprite>();
                foreach (KeyValuePair <string, Texture2D> keyValuePair in dictionary)
                {
                    JKContentManager.Props.RaymanSprites.Add(keyValuePair.Key, Sprite.CreateSprite(keyValuePair.Value));
                }
                Dictionary <string, RattmanSettings> dictionary2 = UltraContent.LoadXmlFiles <RattmanSettings>(Game1.instance, "mods/props/messages", ".xml");

                JKContentManager.Props.RattmanSettings = new RattmanSettings[dictionary2.Keys.Count];
                int num = 0;

                foreach (string key in dictionary2.Keys)
                {
                    JKContentManager.Props.RattmanSettings[num++] = dictionary2[key];
                }
                JKContentManager.Props.AchievementHitboxes = UltraContent.LoadXmlFiles <AchievementHitbox>(Game1.instance, "props/achievements", ".xml");
                JKContentManager.Props.BabeGhostWorldItem  = JKContentManager.Props.PropSprites["babeghost"][3];
            }
Ejemplo n.º 45
0
 // Token: 0x060000D2 RID: 210 RVA: 0x0000AFDC File Offset: 0x000091DC
 private static void AddSetting(Microsoft.Xna.Framework.Content.ContentManager p_loader, OldManSettings p_setting)
 {
     Sprite[] array  = JKContentManager.Util.SpriteChopUtilGrid(p_loader.Load <Texture2D>("mods/props/textures/old_man/" + p_setting.name), p_setting.sprite_cells);
     Sprite[] array2 = new Sprite[p_setting.random_count];
     for (int i = 0; i < array.Length; i++)
     {
         if (i < array2.Length)
         {
             array2[i] = array[i];
         }
         array[i].center = new Vector2(0.5f, 1f);
     }
     JKContentManager.OldMan._settings.Add(p_setting.name, new JKContentManager.OldMan.OldManData
     {
         name        = p_setting.name,
         settings    = p_setting,
         all_sprites = array,
         random      = array2
     });
 }
Ejemplo n.º 46
0
 public void InitializeSFX(Microsoft.Xna.Framework.Content.ContentManager content)
 {
     Sounds.Jump = new Sound(content.Load <SoundEffect>("Audio/SFX/Jump"));
     Sounds.Coin = new Sound(content.Load <SoundEffect>("Audio/SFX/Coin"));
 }
Ejemplo n.º 47
0
 private void Initialize(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     this.texture = Content.Load <Texture2D>(@"textures\cursors\" + type.ToString());
     sourceRect   = new Rectangle(0, 0, texture.Width, texture.Height);
     center       = Vector2.Zero;
 }
Ejemplo n.º 48
0
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            _keyboard         = new Dictionary <string, Button>();
            Global.onlineCode = "";
            gamePad           = new GamePadMapper(PlayerIndex.One);

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

            background.Scale = Global.Scale;
            _sprites.Add(background);

            codeFont = new FadingFont(Content.Load <SpriteFont>("Fonts\\BigOutage"), new Vector2(_viewPort.Width / 2, _viewPort.Height / 2), 0.1f, 1.0f, 0.01f, 1.0f, string.Format(""), Color.White, false);
            codeFont.EnableShadow = false;
            codeFont.Position     = new Vector2(col1 + colDiff * 5, row1 - 100);
            codeFont.SetCenterAsOrigin();


            buttons[0, 0]  = loadkey(Content, "1", col1, row1, scale);
            buttons[0, 1]  = loadkey(Content, "2", col1 + colDiff, row1, scale);
            buttons[0, 2]  = loadkey(Content, "3", col1 + colDiff * 2, row1, scale);
            buttons[0, 3]  = loadkey(Content, "4", col1 + colDiff * 3, row1, scale);
            buttons[0, 4]  = loadkey(Content, "5", col1 + colDiff * 4, row1, scale);
            buttons[0, 5]  = loadkey(Content, "6", col1 + colDiff * 5, row1, scale);
            buttons[0, 6]  = loadkey(Content, "7", col1 + colDiff * 6, row1, scale);
            buttons[0, 7]  = loadkey(Content, "8", col1 + colDiff * 7, row1, scale);
            buttons[0, 8]  = loadkey(Content, "9", col1 + colDiff * 8, row1, scale);
            buttons[0, 9]  = loadkey(Content, "0", col1 + colDiff * 9, row1, scale);
            buttons[0, 10] = loadkey(Content, "#", col1 + colDiff * 10, row1, scale);

            buttons[1, 0]  = loadkey(Content, "Q", col1, row1 + rowDiff, scale);
            buttons[1, 1]  = loadkey(Content, "W", col1 + colDiff, row1 + rowDiff, scale);
            buttons[1, 2]  = loadkey(Content, "E", col1 + colDiff * 2, row1 + rowDiff, scale);
            buttons[1, 3]  = loadkey(Content, "R", col1 + colDiff * 3, row1 + rowDiff, scale);
            buttons[1, 4]  = loadkey(Content, "T", col1 + colDiff * 4, row1 + rowDiff, scale);
            buttons[1, 5]  = loadkey(Content, "Y", col1 + colDiff * 5, row1 + rowDiff, scale);
            buttons[1, 6]  = loadkey(Content, "U", col1 + colDiff * 6, row1 + rowDiff, scale);
            buttons[1, 7]  = loadkey(Content, "I", col1 + colDiff * 7, row1 + rowDiff, scale);
            buttons[1, 8]  = loadkey(Content, "O", col1 + colDiff * 8, row1 + rowDiff, scale);
            buttons[1, 9]  = loadkey(Content, "P", col1 + colDiff * 9, row1 + rowDiff, scale);
            buttons[1, 10] = loadkey(Content, "*", col1 + colDiff * 10, row1 + rowDiff, scale);


            buttons[2, 0]  = loadkey(Content, "A", col1, row1 + rowDiff * 2, scale);
            buttons[2, 1]  = loadkey(Content, "S", col1 + colDiff, row1 + rowDiff * 2, scale);
            buttons[2, 2]  = loadkey(Content, "D", col1 + colDiff * 2, row1 + rowDiff * 2, scale);
            buttons[2, 3]  = loadkey(Content, "F", col1 + colDiff * 3, row1 + rowDiff * 2, scale);
            buttons[2, 4]  = loadkey(Content, "G", col1 + colDiff * 4, row1 + rowDiff * 2, scale);
            buttons[2, 5]  = loadkey(Content, "H", col1 + colDiff * 5, row1 + rowDiff * 2, scale);
            buttons[2, 6]  = loadkey(Content, "J", col1 + colDiff * 6, row1 + rowDiff * 2, scale);
            buttons[2, 7]  = loadkey(Content, "K", col1 + colDiff * 7, row1 + rowDiff * 2, scale);
            buttons[2, 8]  = loadkey(Content, "L", col1 + colDiff * 8, row1 + rowDiff * 2, scale);
            buttons[2, 9]  = loadkey(Content, ".", col1 + colDiff * 9, row1 + rowDiff * 2, scale);
            buttons[2, 10] = loadkey(Content, "&", col1 + colDiff * 10, row1 + rowDiff * 2, scale);

            buttons[3, 0]  = loadkey(Content, "Z", col1, row1 + rowDiff * 3, scale);
            buttons[3, 1]  = loadkey(Content, "X", col1 + colDiff, row1 + rowDiff * 3, scale);
            buttons[3, 2]  = loadkey(Content, "C", col1 + colDiff * 2, row1 + rowDiff * 3, scale);
            buttons[3, 3]  = loadkey(Content, "V", col1 + colDiff * 3, row1 + rowDiff * 3, scale);
            buttons[3, 4]  = loadkey(Content, "B", col1 + colDiff * 4, row1 + rowDiff * 3, scale);
            buttons[3, 5]  = loadkey(Content, "N", col1 + colDiff * 5, row1 + rowDiff * 3, scale);
            buttons[3, 6]  = loadkey(Content, "M", col1 + colDiff * 6, row1 + rowDiff * 3, scale);
            buttons[3, 7]  = loadkey(Content, "-", col1 + colDiff * 7, row1 + rowDiff * 3, scale);
            buttons[3, 8]  = loadkey(Content, "_", col1 + colDiff * 8, row1 + rowDiff * 3, scale);
            buttons[3, 9]  = loadkey(Content, "!", col1 + colDiff * 9, row1 + rowDiff * 3, scale);
            buttons[3, 10] = loadkey(Content, "?", col1 + colDiff * 10, row1 + rowDiff * 3, scale);


            back          = new TextButton(Content.Load <Texture2D>("Buttons//Blank"), new Vector2(0, 0), Color.White, Content.Load <SpriteFont>("Fonts\\BigOutage"), Color.White, "Back", new Rectangle(0, 117, 404, 137), new Rectangle(0, 0, 404, 117));
            back.Scale   *= scale;
            back.Scale    = new Vector2(back.Scale.X + 0.02f, back.Scale.Y);
            back.Origin   = new Vector2(back.Texture.Width / 2, 137);
            back.Position = new Vector2(col1 + 120, row1 + rowDiff * 4 + back.SourceRectangle.Value.Height / 2);

            space          = new TextButton(Content.Load <Texture2D>("Buttons//Blank"), new Vector2(0, 0), Color.White, Content.Load <SpriteFont>("Fonts\\BigOutage"), Color.White, " ", new Rectangle(0, 117, 404, 137), new Rectangle(0, 0, 404, 117));
            space.Scale   *= scale;
            space.Scale    = new Vector2(space.Scale.X + 0.61f, space.Scale.Y);
            space.Origin   = new Vector2(space.Texture.Width / 2, 137);
            space.Position = new Vector2(col1 + colDiff * 3 + 240, row1 + rowDiff * 4 + space.SourceRectangle.Value.Height / 2);

            done          = new TextButton(Content.Load <Texture2D>("Buttons//Blank"), new Vector2(0, 0), Color.White, Content.Load <SpriteFont>("Fonts\\BigOutage"), Color.White, "Done", new Rectangle(0, 117, 404, 137), new Rectangle(0, 0, 404, 117));
            done.Scale   *= scale;
            done.Scale    = new Vector2(done.Scale.X + 0.02f, done.Scale.Y);
            done.Origin   = new Vector2(done.Texture.Width / 2, 137);
            done.Position = new Vector2(col1 + colDiff * 8 + 120, row1 + rowDiff * 4 + done.SourceRectangle.Value.Height / 2);



            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(codeFont);
            _sprites.Add(back);
            _sprites.Add(space);
            _sprites.Add(done);
            _sprites.Add(backBtn);


            if (!Global.UsingKeyboard)
            {
                //done.IsPressed = true;
                //_keyboard["2"].IsPressed = true;
            }
        }
Ejemplo n.º 49
0
            public static void Load(Microsoft.Xna.Framework.Content.ContentManager p_loader)
            {
                // everything else
                JKContentManager.Audio.WaterSplashEnter = new JKSound(p_loader.Load <SoundEffect>("audio/water_splash_enter"), SoundType.SFX);
                JKContentManager.Audio.WaterSplashExit  = new JKSound(p_loader.Load <SoundEffect>("audio/water_splash_exit"), SoundType.SFX);
                JKContentManager.Audio.Plink            = new JKSound(p_loader.Load <SoundEffect>("audio/plink"), SoundType.SFX);
                JKContentManager.Audio.PressStart       = new JKSound(p_loader.Load <SoundEffect>("audio/press_start"), SoundType.SFX);
                JKContentManager.Audio.NewLocation      = new JKSound(p_loader.Load <SoundEffect>("audio/new_location"), SoundType.SFX);
                JKContentManager.Audio.Talking          = new JKSound(p_loader.Load <SoundEffect>("audio/talking"), SoundType.SFX);
                JKContentManager.Audio.RaymanSFX        = new JKSound(p_loader.Load <SoundEffect>("audio/illusion"), SoundType.SFX);
                JKContentManager.Audio.Player.Load(p_loader);
                JKContentManager.Audio.Menu.Load(p_loader);
                JKContentManager.Audio.Babe.Load(p_loader);

                // music only
                string text = "mods/audio/music/";

                if (File.Exists(Game1.instance.Content.RootDirectory + "/mods/audio/music/menu loop/menu_intro.xnb"))
                {
                    JKContentManager.Audio.Music.TitleScreen = new JKSound(p_loader.Load <SoundEffect>(text + "menu loop/menu_intro"), SoundType.Music);
                }
                else
                {
                    JKContentManager.Audio.Music.TitleScreen = new JKSound(p_loader.Load <SoundEffect>("audio/music/menu loop/menu_intro"), SoundType.Music);
                }
                JKContentManager.Audio.Music.TitleScreen.IsLooped = true;
                JKContentManager.Audio.Music.Opening = new JKSound(p_loader.Load <SoundEffect>("audio/music/opening theme"), SoundType.Music);
                if (File.Exists(Game1.instance.Content.RootDirectory + "/mods/audio/music/ending.xnb"))
                {
                    JKContentManager.Audio.Music.Ending = new JKSound(p_loader.Load <SoundEffect>(text + "ending"), SoundType.Music);
                }
                else
                {
                    JKContentManager.Audio.Music.Ending = new JKSound(p_loader.Load <SoundEffect>("audio/music/ending"), SoundType.Music);
                }
                if (File.Exists(Game1.instance.Content.RootDirectory + "/mods/audio/music/ending2.xnb"))
                {
                    JKContentManager.Audio.Music.Ending2 = new JKSound(p_loader.Load <SoundEffect>(text + "ending2"), SoundType.Music);
                }
                else
                {
                    JKContentManager.Audio.Music.Ending2 = new JKSound(p_loader.Load <SoundEffect>("audio/music/ending2"), SoundType.Music);
                }
                if (File.Exists(Game1.instance.Content.RootDirectory + "/mods/audio/music/ending3.xnb"))
                {
                    JKContentManager.Audio.Music.Ending3 = new JKSound(p_loader.Load <SoundEffect>(text + "ending3"), SoundType.Music);
                }
                else
                {
                    JKContentManager.Audio.Music.Ending3 = new JKSound(p_loader.Load <SoundEffect>("audio/music/ending3"), SoundType.Music);
                }
                JKContentManager.Audio.Music.event_music = new Dictionary <string, JKSound>();
                Dictionary <string, SoundEffect> dictionary = JKExtensions.UltraContent.LoadCunt <SoundEffect>(p_loader, text + "event_music", ".xnb");

                foreach (string key in dictionary.Keys)
                {
                    JKContentManager.Audio.Music.event_music.Add(key, new JKSound(dictionary[key], SoundType.Music));
                }
                Dictionary <string, SoundEffect> dictionary2 = JKExtensions.UltraContent.LoadCunt <SoundEffect>(p_loader, "audio/event_sfx", ".xnb");

                foreach (string key2 in dictionary2.Keys)
                {
                    JKContentManager.Audio.Music.event_music.Add(key2, new JKSound(dictionary2[key2], SoundType.SFX));
                }
                JKContentManager.Audio.Music.JINGLE_SETTINGS = XmlSerializerHelper.Deserialize <JumpKing.MiscSystems.ScreenEvents.JingleEventSettings>("Content/" + text + "event_music/events.xml");

                // ambient
                JKContentManager.Audio.AmbienceSaveValues = XmlSerializerHelper.Deserialize <AmbienceManager.AmbienceSaveValues>(Game1.instance.Content.RootDirectory + "/mods/audio/background/data/values.xml");
                if (JKContentManager.Audio.AmbienceSaveValues.special_info == null)
                {
                    JKContentManager.Audio.AmbienceSaveValues.special_info = new AmbienceManager.AmbienceInfo[0];
                }
                text = "mods/audio/background";
                FileInfo[] filesInFolder = p_loader.GetFilesInFolder(text);
                for (int i = 0; i < filesInFolder.Length; i++)
                {
                    string text2 = filesInFolder[i].Name;
                    if (text2.Contains("."))
                    {
                        text2 = text2.Substring(0, text2.IndexOf('.'));
                    }
                    SoundType p_type          = SoundType.Ambience;
                    float     p_fade_out_time = 0f;
                    float     p_fade_in_time  = 0f;
                    foreach (AmbienceManager.AmbienceInfo ambienceInfo in JKContentManager.Audio.AmbienceSaveValues.special_info)
                    {
                        if (ambienceInfo.name == text2)
                        {
                            p_type          = ambienceInfo.type;
                            p_fade_out_time = ambienceInfo.fade_out_length;
                            p_fade_in_time  = ambienceInfo.fade_in_length;
                        }
                    }
                    LubedSound lubedSound = Program.contentThread.CreateSound(new ManagedSound(text + "/" + text2, p_type));
                    JKContentManager.Audio.AmbienceSound value = new JKContentManager.Audio.AmbienceSound
                    {
                        lube        = lubedSound,
                        volume_fade = new JumpKing.MiscSystems.FadeAmbience(lubedSound, p_fade_out_time, p_fade_in_time)
                    };
                    JKContentManager.Audio.Ambience.Add(text2, value);
                }
            }
Ejemplo n.º 50
0
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            _content = content;
            loadingDropingObjects(content);
            loadingBackgrounds(content);
            loadingSongs(content);



            FallingItem.FallingSpeed = startingSpeed;
            startingDifficultyTime   = new TimeSpan(0, 0, 3);
            elapsedArrowTime         = TimeSpan.Zero;
            difficultyTime           = startingDifficultyTime;

            arrowFadeTime = new TimeSpan(0, 0, 0, 5);

            //SpriteLabel tutorialText = new SpriteLabel("tutorialText", content.Load<SpriteFont>("Fonts/FS14"), "Press the arrows to move!", Vector2.Zero, Color.Black);
            //tutorialText.Scale = new Vector2(3);
            //tutorialText.Position = new Vector2(RenderTarget.Width / 2 - tutorialText.Width / 2, RenderTarget.Height - tutorialText.Height * 2);
            //tutorialText.IsVisible = Global.Tutorial;

            _columns = new Column[fallingLocation.Length];
            for (int i = 0; i < _columns.Length; i++)
            {
                _columns[i] = new Column(fallingLocation[i].X.ToInt(true), RenderTarget.Height);
            }

            _columns[0].NextColumns.Add(_columns[1]);

            //_columns[1].NextColumns.Add(_columns[0]);
            _columns[1].NextColumns.Add(_columns[2]);

            //_columns[2].NextColumns.Add(_columns[1]);
            _columns[2].NextColumns.Add(_columns[3]);

            _columns[3].NextColumns.Add(_columns[2]);


            backGround = new Sprite("backGround", Global.Backgrounds[Global.CurrentBackgroundIndex], Vector2.Zero, Color.White);


            leftHelpButton          = new Sprite("leftButton", content.Load <Texture2D>("Screen Images/Left Arrow"), Vector2.Zero, Color.White);
            leftHelpButton.Scale    = new Vector2(.8f);
            leftHelpButton.Position = new Vector2(0, RenderTarget.Height - leftHelpButton.Height * 3f);
            leftHelpButton.Color    = Color.Lerp(Color.White, Color.Transparent, .3f);

            //leftHelpButton.Effect = SpriteEffects.FlipHorizontally;

            rightHelpButton          = new Sprite("rightButton", content.Load <Texture2D>("Screen Images/Right Arrow"), Vector2.Zero, Color.White);
            rightHelpButton.Scale    = leftHelpButton.Scale;
            rightHelpButton.Position = new Vector2(RenderTarget.Width - rightHelpButton.Width, leftHelpButton.Y);
            rightHelpButton.Color    = Color.Lerp(Color.White, Color.Transparent, .3f);



            _fpsLabel           = new SpriteLabel("SpeedLabel", content.Load <SpriteFont>("Fonts/dnk24"), String.Empty, Vector2.Zero, Color.Black);
            _fpsLabel.Text      = String.Format("Speed: {0}", FallingItem.FallingSpeed);
            _fpsLabel.Scale     = new Vector2(3);
            _fpsLabel.Y         = RenderTarget.Height - _fpsLabel.Height;
            _fpsLabel.IsVisible = false;

            //death
            Texture2D   firstDeathFrame = content.Load <Texture2D>("Characters/Effects/Death/explosion1");
            SpriteSheet deathSprite     = new SpriteSheet("RedPanda", Vector2.Zero, Color.White, firstDeathFrame);

            for (int i = 2; i < 6; i++)
            {
                Sprite deathFrame = new Sprite("RedPanda", content.Load <Texture2D>(String.Format("Characters/Effects/Death/explosion{0}", i)), Vector2.Zero, Color.White);
                deathSprite.Add(deathFrame);
            }

            foreach (Sprite frame in deathSprite)
            {
                frame.Origin = new Vector2(frame.Width / 2, frame.Height / 3 * 2);
                frame.Scale  = new Vector2(0.8f);
            }
            deathSprite.AnimateTime      = TimeSpan.FromMilliseconds(100);
            deathSprite.AnimationFinish += deathSprite_AnimationFinish;

            playerIndex = 1;

            //ria load
            Sprite idleRiaFrame = new Sprite("RedPanda", content.Load <Texture2D>("Characters/RedPanda/Ria/0"), Vector2.Zero, Color.White);

            idleRiaFrame.Origin = new Vector2(380, idleRiaFrame.Height);


            Texture2D   test            = content.Load <Texture2D>("Characters/RedPanda/Ria/1");
            SpriteSheet movingRiaFrames = new SpriteSheet("RedPanda", Vector2.Zero, Color.White, test);

            for (int i = 2; i < 7; i++)
            {
                Sprite frame = new Sprite("RedPanda", content.Load <Texture2D>(String.Format("Characters/RedPanda/Ria/{0}", i)), Vector2.Zero, Color.White);
                movingRiaFrames.Add(frame);
            }
            movingRiaFrames.Origin = new Vector2(380, test.Height);


            movingRiaFrames.AnimateTime = TimeSpan.FromMilliseconds(25 / (_level + 1));//speed animation up according to level. Kevin

            movingRiaFrames.AnimationFinish += movingRiaFrames_AnimationFinish;

            player = new Character(new ISprite[] { idleRiaFrame, movingRiaFrames, deathSprite });

            player.Position = new Vector2(fallingLocation[playerIndex].X - 1, RenderTarget.Height - 50);

            direction = Direction.None;
            //SpriteCollection.Add(tutorialText);
            SpriteCollection.Add(backGround);
            SpriteCollection.Add(_fpsLabel);

            SpriteCollection.Add(leftHelpButton);
            SpriteCollection.Add(rightHelpButton);

            string leftSwipeFile  = String.Empty;
            string rightSwipeFile = String.Empty;

            XnaAudio.MediaPlayer.Volume = 1;

            SpriteCollection.NameCheck = false;
            SpriteCollection.Add(player);

            foreach (Column column in _columns)
            {
                foreach (FallingItem item in column.Pool)
                {
                    SpriteCollection.Add(item);
                }
            }
            if (Global.Control == ControlTypes.Swipe)
            {
                leftHelpButton.IsVisible  = false;
                rightHelpButton.IsVisible = false;
            }
            else
            {
                leftHelpButton.IsVisible  = true;
                rightHelpButton.IsVisible = true;
            }
            _lastSpwaned   = _columns[0];
            Column.OffSet  = player.BoundingBox.Height + player.BoundingBox.Height / 4;
            leftSwipeFile  = "Sounds/Effects/Air 1 swipe to left";
            rightSwipeFile = "Sounds/Effects/Air 2 swipe to right";
#if !WINDOWS
            TouchManager touch = TouchManager.Instance;
            touch.GestureOccured += touch_GestureOccured;
#endif

            SpriteLabel helperLabel = new SpriteLabel("helperLabel", content.Load <SpriteFont>("Fonts/dnk48"), String.Empty, new Vector2(RenderTarget.Width / 2, RenderTarget.Height / 2), Color.White);

            helperLabel.Y     += 425;
            helperLabel.Origin = new Vector2(helperLabel.Width / 2, helperLabel.Height / 2);
            //helperLabel.Scale = new Vector2(1);
            SpriteCollection.Add(helperLabel);


            timeLabel          = new SpriteLabel("timeLabel", content.Load <SpriteFont>("Fonts/dnk72"), String.Empty, Vector2.Zero, Color.Black);
            timeLabel.Position = new Vector2(RenderTarget.Width / 2, 30);
            //timeLabel.Scale = new Vector2(2);
            SpriteCollection.Add(timeLabel);

            controlLabel       = new HighScoreControl("controlLabel", ControlTypes.Tap, new Vector2(0, 30));
            controlLabel.Scale = new Vector2(0.5f);
            controlLabel.X     = RenderTarget.Width - controlLabel.Width - 30;

            controlLabel.IsVisible = false;
            SpriteCollection.Add(controlLabel);

            deathSound     = content.Load <SoundEffect>("Sounds/Effects/DeathSound"); //content.Load<XnaAudio.Song>("Sounds/DeathSound");
            leftSwipe      = content.Load <SoundEffect>(leftSwipeFile);               //content.Load<XnaAudio.Song>(leftSwipeFile);
            rightSwipe     = content.Load <SoundEffect>(rightSwipeFile);              // content.Load<XnaAudio.Song>(rightSwipeFile);
            highScoreSound = content.Load <SoundEffect>("Sounds/Effects/RD High Score");
            _level         = 0;



            SpriteCollection.IsReadOnly = true;
        }
Ejemplo n.º 51
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     spriteFont  = Content.Load <SpriteFont>("Fonts/DebugFontBold");
 }
Ejemplo n.º 52
0
 ///
 /// Loads all the required content for the block.
 ///
 /// <param name="content">The content manager.</param>
 public virtual void Load(Microsoft.Xna.Framework.Content.ContentManager content)
 {
     texture = content.Load <Texture2D>("block");
 }