public Pigeon(ContentManager con) { boundingBox = new Vector3(6, 3, 6); distance = 0; rand = new Random(); dx = (0.5-rand.NextDouble())*0.8 + 0.2; dy = rand.NextDouble()*1.5 + 0.7; dz = 0.8; x = 5.8; y = -2; z = 83.5; sx = 5.8; sy = -2; sz = 83.5; this.world = Matrix.CreateTranslation(new Vector3((float)x, (float)y, (float)z)); model = con.Load<Model>(@"models/pigeon"); isDone = false; }
public ControlState controlState; //get and set the control state #endregion #region constructor/load public TacticalBattle(List<Piece> player1Army, List<Piece> player2Army, TacMap map, ContentManager content) { //p1Avatar = player1; //p2Avatar = player2; this.player1Army = player1Army; this.player2Army = player2Army; isPlayer1Turn = true; this.map = map; battleOver = false; gridOn = false; mouseVisible = true; controlState = ControlState.selectUnit; selectedUnit = null; status = "Combat begins"; selectionTiles = new List<Tile>(); unitInfo = ""; //load interface items TODO confirmation = content.Load<Texture2D>("confirmationPopup"); background = content.Load<Texture2D>("TerrainSprites/battle"); statusFont = content.Load<SpriteFont>("Arial"); playerFont = content.Load<SpriteFont>("playerFont"); infoFont = content.Load<SpriteFont>("infoFont"); moveBox = content.Load<Texture2D>("TerrainSprites/move"); targetBox = content.Load<Texture2D>("TerrainSprites/target"); selectedBox = content.Load<Texture2D>("TerrainSprites/selected"); horizontal = content.Load<Texture2D>("TerrainSprites/horizontal"); vertical = content.Load<Texture2D>("TerrainSprites/vertical"); winBox = content.Load<Texture2D>("Menu/Win message"); //set units to starting positions startingPositions(); }
public void LoadContent(ContentManager content, GraphicsDeviceManager graphicsDeviceManager) { texture = content.Load<Texture2D>("brick_texture_map"); wall = new VertexPositionTexture[22]; wall[0] = new VertexPositionTexture(new Vector3(200, 0, 200), new Vector2(0, 0)); wall[1] = new VertexPositionTexture(new Vector3(200, 200, 200), new Vector2(2, 0)); wall[2] = new VertexPositionTexture(new Vector3(0, 0, 200), new Vector2(0, 2)); wall[3] = new VertexPositionTexture(new Vector3(0, 200, 200), new Vector2(2, 2)); wall[4] = new VertexPositionTexture(new Vector3(0, 0, 220), new Vector2(0, 0)); wall[5] = new VertexPositionTexture(new Vector3(0, 200, 220), new Vector2(2, 0)); wall[6] = new VertexPositionTexture(new Vector3(200, 0, 220), new Vector2(0, 2)); wall[7] = new VertexPositionTexture(new Vector3(200, 200, 220), new Vector2(2, 2)); wall[8] = new VertexPositionTexture(new Vector3(200, 0, 200), new Vector2(0, 0)); wall[9] = new VertexPositionTexture(new Vector3(200, 200, 220), new Vector2(2, 0)); wall[10] = new VertexPositionTexture(new Vector3(200, 200, 200), new Vector2(2, 2)); wall[11] = new VertexPositionTexture(new Vector3(0, 200, 220), new Vector2(0, 2)); wall[12] = new VertexPositionTexture(new Vector3(0, 200, 200), new Vector2(0, 0)); // Set vertex data in VertexBuffer vertexBuffer = new VertexBuffer(graphicsDeviceManager.GraphicsDevice, typeof(VertexPositionTexture), wall.Length, BufferUsage.None); vertexBuffer.SetData(wall); // Initialize the BasicEffect effect = new BasicEffect(graphicsDeviceManager.GraphicsDevice); }
public RenderingExplosion(ContentManager Content) : base(Content) { spriteBatch = Content.ServiceProvider.GetService(typeof(SpriteBatch)) as SpriteBatch; explosionTexture = Content.Load<Texture2D>("TroopTexture/explosion"); stateGame = Content.ServiceProvider.GetService(typeof(StateGame)) as StateGame; }
public static void Load(ContentManager content) { Player = content.Load<Texture2D>("Player"); Pixel = new Texture2D(Player.GraphicsDevice, 1, 1); Pixel.SetData(new[] { Color.White }); }
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); }
/// <summary> /// Loads graphics content for this screen. The background texture is quite /// big, so we use our own local ContentManager to load it. This allows us /// to unload before going from the menus into the game itself, wheras if we /// used the shared ContentManager provided by the Game class, the content /// would remain loaded forever. /// </summary> public override void LoadContent() { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); backgroundTexture = content.Load<Texture2D>("background"); }
public override void DrawObjects(GraphicsDevice graphicDevice, SpriteBatch spriteBatch, ContentManager content) { graphicDevice.Clear(Color.CornflowerBlue); SpriteFont newFont = content.Load<SpriteFont>(@"Fonts/Text"); spriteBatch.Begin(); this.controlScreenBackgroundPosition = new Vector2(0, 0); spriteBatch.Draw(this.controlScreenBackgroundTexture, this.controlScreenBackgroundPosition, Color.White); if (this.controlScreenItems.Count < 1) { // Back planket and text; this.buttonPosition = new Vector2(840, 660); this.controlScreenItems.Add(new MenuItems(this.button, this.buttonPosition, "Back", newFont, false)); } this.controlScreenItems[this.selectedEntry].Selected = true; foreach (var item in this.controlScreenItems) { item.DrawMenuItems(spriteBatch, new Color(248, 218, 127)); } this.DrawCursor(spriteBatch); spriteBatch.End(); }
public Paddle(ContentManager theContent, string theAssetName, Input theInput, PaddlePosition thePosition) : base(theContent, theAssetName) { SourceRectangle = new Rectangle(0, 0, 1, 1); Scale = new Vector2(10.0f, 100.0f); mColor = Color.SlateBlue; mPaddlePosition = thePosition; switch (thePosition) { case PaddlePosition.Left: { Boundary = new Rectangle(140, 185, 10, 833); break; } case PaddlePosition.Right: { Boundary = new Rectangle(1130, 185, 10, 833); break; } } Position = Center(Boundary); mInput = theInput; }
public static void LoadRepositoryXml(string filePath, ContentManager content) { XmlDocument document = new XmlDocument(); document.Load(filePath); foreach (XmlNode itemNode in document.SelectNodes("ItemRepository/Item")) { Item item = new Item(); item.Name = XmlExtensions.GetAttributeValue(itemNode, "Name", null, true); item.FriendlyName = itemNode.SelectSingleNode("FriendlyName").InnerText; item.Description = itemNode.SelectSingleNode("Description").InnerText; item.Weight = XmlExtensions.GetAttributeValue<float>(itemNode, "Weight", 0); item.ItemType = (ItemType)Enum.Parse(typeof(ItemType), XmlExtensions.GetAttributeValue(itemNode, "ItemType", null, true)); foreach(XmlNode drawableSetNode in itemNode.SelectNodes("Drawables/Drawable")) { string src = XmlExtensions.GetAttributeValue(drawableSetNode, "src"); DrawableSet.LoadDrawableSetXml(item.Drawables, src, content); } if (itemNode.SelectSingleNode("Icon") != null) item.Icon = content.Load<Texture2D>(XmlExtensions.GetAttributeValue(itemNode.SelectSingleNode("Icon"), "src")); GameItems.Add(item.Name, item); } }
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); }
public LevelFactory(ContentManager content, IBoard board, DoodadFactory doodadFactory, Session session) { this.content = content; this.board = board; this.doodadFactory = doodadFactory; this.session = session; }
public Fatter(Vector3 position, ComponentManager componentManager, ContentManager content, GraphicsDevice graphics) : base("Fatter", position, componentManager, content, graphics, "fatwalk") { }
public override void LoadContent(ContentManager content) { Scale = 2.0f; asteroids = content.Load<Texture2D>(@"Test\asteroids"); createSprite(sourceRect); base.LoadContent(content); }
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); }
public void Draw(SpriteBatch theSpriteBatch, ContentManager theContentManager) { if(MyMenuState == MenuState.Startup) { Logo.Draw(theSpriteBatch, theContentManager); PlayButton.Draw(theSpriteBatch, theContentManager); OptionsButton.Draw(theSpriteBatch, theContentManager); HighScoresButton.Draw(theSpriteBatch, theContentManager); ExitGameButton.Draw(theSpriteBatch, theContentManager); } else if (MyMenuState == MenuState.Options1) { MusicOn.Draw(theSpriteBatch, theContentManager); MusicOff.Draw(theSpriteBatch, theContentManager); SoundOn.Draw(theSpriteBatch, theContentManager); SoundOff.Draw(theSpriteBatch, theContentManager); Cheats.Draw(theSpriteBatch, theContentManager); Debug.Draw(theSpriteBatch, theContentManager); Cave1.Draw(theSpriteBatch, theContentManager); Cave2.Draw(theSpriteBatch, theContentManager); Cave3.Draw(theSpriteBatch, theContentManager); Back.Draw(theSpriteBatch, theContentManager); OptionsLabel.Draw(theSpriteBatch, theContentManager); MusicLabel.Draw(theSpriteBatch, theContentManager); SoundFXLabel.Draw(theSpriteBatch, theContentManager); CaveLabel.Draw(theSpriteBatch, theContentManager); } }
public DebugScreen(ContentManager content,Vector2 new_player_pos) { Vector2 temp = new Vector2(1366 / 2, 768 / 2); font = content.Load<SpriteFont>("Stuff/Arial"); player_pos.vector = Vector2.Zero; player_pos.vertices = new VertexPositionColor[4]; player_speed.vertices = new VertexPositionColor[4]; player_speed.startpos =temp; gravity.vertices = new VertexPositionColor[4]; gravity.startpos =temp; jump.vertices = new VertexPositionColor[4]; jump.startpos =temp; gamepad_pos.vertices = new VertexPositionColor[4]; gamepad_pos.startpos =temp; for(int i=0;i<4;i++) { player_pos.vertices[i] = new VertexPositionColor(Vector3.Zero,Color.White); player_speed.vertices[i] = new VertexPositionColor(Vector3.Zero,Color.Blue); gravity.vertices[i] = new VertexPositionColor(Vector3.Zero,Color.Red); jump.vertices[i] = new VertexPositionColor(Vector3.Zero,Color.Green); gamepad_pos.vertices[i] = new VertexPositionColor(Vector3.Zero,Color.HotPink); } collision_state_string = "Collision:"; framerate_string = "FPS:"; inputkeys_string = "Input:"; player_speed.vector = Vector2.Zero; gravity.vector = Vector2.Zero; jump.vector = Vector2.Zero; gamepad_pos.vector = Vector2.Zero; }
/// <summary> /// Creates a new instance of a Green Goblin enemy ship /// </summary> /// <param name="content">A ContentManager to load resources with</param> /// <param name="position">The position of the Green Goblin ship in the game world</param> public GreenGoblin(uint id, ContentManager content, Vector2 position) : base(id) { // Randomly generates the diagonal flight length diagFlightLength = rand.Next(20, 150); this.position = position; diagCount = 0; spritesheet = content.Load<Texture2D>("Spritesheets/newshf.shp.000000"); spriteBounds[(int)GreenGoblinSteeringState.Left].X = 0; spriteBounds[(int)GreenGoblinSteeringState.Left].Y = 0; spriteBounds[(int)GreenGoblinSteeringState.Left].Width = 25; spriteBounds[(int)GreenGoblinSteeringState.Left].Height = 26; spriteBounds[(int)GreenGoblinSteeringState.Straight].X = 25; spriteBounds[(int)GreenGoblinSteeringState.Straight].Y = 0; spriteBounds[(int)GreenGoblinSteeringState.Straight].Width = 25; spriteBounds[(int)GreenGoblinSteeringState.Straight].Height = 26; spriteBounds[(int)GreenGoblinSteeringState.Right].X = 50; spriteBounds[(int)GreenGoblinSteeringState.Right].Y = 0; spriteBounds[(int)GreenGoblinSteeringState.Right].Width = 25; spriteBounds[(int)GreenGoblinSteeringState.Right].Height = 26; steeringState = GreenGoblinSteeringState.Straight; }
public FieldPong() { graphics = new GraphicsDeviceManager(this); content = new ContentManager(Services); graphics.PreferredBackBufferWidth = 1024; graphics.PreferredBackBufferHeight = 768; graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0; graphics.SynchronizeWithVerticalRetrace = true; physicsSimulator = new PhysicsSimulator(new Vector2(0)); physicsSimulator.AllowedPenetration = 0.3f; physicsSimulator.BiasFactor = 1.0f; Services.AddService(typeof(PhysicsSimulator), physicsSimulator); screenManager = new ScreenManager(this); Components.Add(screenManager); bloomProcessor = new BloomPostProcessor(this); Components.Add(bloomProcessor); // Uncomment this to monitor the FPS: //fpsCounter = new FrameRateCounter(this); //Components.Add(fpsCounter); audioEngine = new AudioEngine("Content\\Audio\\FieldPongAudio.xgs"); waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb"); backgroundMusic = soundBank.GetCue("GameSong0010 16 Bit"); backgroundMusic.Play(); }
public AllBackground(ContentManager content, Plane player) { Backgrounds = new List<Scrolling>(); this.Content = content; playerSpeed = player.speed; AddAll(); }
public void HandleBombsIntersection(Player p, BuildingHandler bh, ContentManager theContentManager) { if (p.bombs.Count > 0) { foreach (Bomb b in p.bombs) { bombRectangle = new Rectangle((int)b.X, (int)b.Y, 20, 20); //TODO: width, height if needed foreach (Building building in bh.buildings) { buildingRectangle = new Rectangle((int)building.X, (int)building.Y - building.H + 10, building.W, building.H); if (bombRectangle.Intersects(buildingRectangle)) { building.Damaged = true; p.score.AddPoints(50); p.eh.CreateExplosion("huge", new Vector2(b.X - 48, b.Y - 16), theContentManager); p.bombs.Remove(b); bombRemoved = true; } } if (bombRemoved) { bombRemoved = false; break; } } } }
public override bool InitOne(ContentManager content, int id) { XmlDocument _doc = new XmlDocument(); _doc.Load(_xmlInfo); XmlNode _gameTitle = _doc.SelectSingleNode(@"//GameTitle[@id = '" + id.ToString() + "']"); _prototype[id] = new GameTitle(); XmlNodeList _listOfTitle = _gameTitle.SelectNodes(@"//Title"); _prototype[id]._nsprite = _listOfTitle.Count; _prototype[id]._sprite = new GameSprite[_prototype[id]._nsprite]; for (int i = 0; i < _prototype[id]._nsprite; i++) { int _numofframe = int.Parse(_listOfTitle[i].SelectSingleNode(@"NumOfFrames").InnerText); string _contentname = _listOfTitle[i].SelectSingleNode(@"ContentName").InnerText; Texture2D[] _textures = new Texture2D[_numofframe]; for (int j = 0; j < _numofframe; ++j) { _textures[j] = content.Load<Texture2D>(_contentname + j.ToString("00")); } _prototype[id]._sprite[i] = new GameSprite(_textures, 0, 0); } _prototype[id].X = float.Parse(_gameTitle.SelectSingleNode(@"X").InnerText); _prototype[id].Y = float.Parse(_gameTitle.SelectSingleNode(@"Y").InnerText); ((GameTitle)_prototype[id]).DelayTime = int.Parse((_gameTitle.SelectSingleNode(@"DelayTime").InnerText)); return true; }
public override void UpdateObjects(ContentManager content) { this.mouse = Mouse.GetState(); this.keyboard = Keyboard.GetState(); this.UpdateCursor(); if (this.keyboard.IsKeyDown(Keys.Enter) && this.previousKeyboard.IsKeyUp(Keys.Enter) && this.controlScreenItems.Count != 0) { if (this.controlScreenItems[this.selectedEntry].ItemText == "Back") { Rpg.PActiveWindow=EnumActiveWindow.MainMenu; } } if (this.mouse.LeftButton == ButtonState.Pressed) { foreach (var item in this.controlScreenItems) { if (this.mouse.X > item.ItemPosition.X && this.mouse.X < item.ItemPosition.X + item.ItemTexture.Bounds.Width && this.mouse.Y > item.ItemPosition.Y && this.mouse.Y < item.ItemPosition.Y + item.ItemTexture.Bounds.Height) { if (item.ItemText == "Back") { Rpg.PActiveWindow=EnumActiveWindow.MainMenu; break; } } } } this.previousKeyboard = this.keyboard; }
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); }
public void loadContent(ContentManager content) { foreach (Laser baseProjectile in m_LaserArray) { baseProjectile.loadContent(content); } }
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); }
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); }
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(); }
public Game() { inRun = false; isFixedTimeStep = true; visibleDrawable = new List <IDrawable>(); enabledUpdateable = new List <IUpdateable>(); components = new GameComponentCollection(); components.ComponentAdded += new EventHandler <GameComponentCollectionEventArgs>(GameComponentAdded); components.ComponentRemoved += new EventHandler <GameComponentCollectionEventArgs>(GameComponentRemoved); services = new GameServiceContainer(); content = new ContentManager(services); gameUpdateTime = new GameTime(TimeSpan.Zero, TimeSpan.Zero, TimeSpan.Zero, TimeSpan.Zero); inactiveSleepTime = TimeSpan.FromTicks(0); targetElapsedTime = TimeSpan.FromTicks(DefaultTargetElapsedTicks); gameHost = new SdlGameHost(this); gameHost.EnsureHost(); isActive = true; }
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"); }
public void Load(ContentManager content) { random = new Random(); space_ship = new SpaceShip(); space_ship.Load(content); float y=-50; active_obstacles = new List<Obstacle>(); for (int i = 0; i < 29; i++) { active_obstacles.Add(new Obstacle()); active_obstacles[i].Load(content); } active_obstacles[0].Init(0,-50); for (int i = 1;i<29;i++) { y += 80 * active_obstacles[i - 1].scale; active_obstacles[i].Init(0, y); } last_obstacle = 0; //active_obstacles[0].Init(0, -50); //active_obstacles[1].Init(0, -50 + (float)Math.Pow(1.02, 1 )/20); //active_obstacles[2].Init(0, -50 + (float)Math.Pow(1.02, 1 )/20 + (float)Math.Pow(1.02, 2) / 20); //active_obstacles[3].Init(0, -50 + (float)Math.Pow(1.02, 1) / 20 + (float)Math.Pow(1.02, 2) / 20 + (float)Math.Pow(1.02, 3) / 20); //active_obstacles[4].Init(0, -50 + (float)Math.Pow(1.02, 1) / 20 + (float)Math.Pow(1.02, 2) / 20 + (float)Math.Pow(1.02, 3) / 20 + (float)Math.Pow(1.02, 4 )/20); //active_obstacles[5].Init(0, -50 + (float)Math.Pow(1.02, 1) / 20 + (float)Math.Pow(1.02, 2) / 20 + (float)Math.Pow(1.02, 3) / 20 + (float)Math.Pow(1.02, 4) / 20 + (float)Math.Pow(1.02, 5) / 20); frame_counter = 1; newest = 0; }
public GameWin(Game1 game1, GraphicsDeviceManager graphics, ContentManager Content) { rectangle = new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); game1.IsMouseVisible = true; MediaPlayer.Volume = vol; songMenu = Content.Load<Song>("Menu//songMenu"); }
public HUD(Scene scene, Microsoft.Xna.Framework.Content.ContentManager Content) { this.scene = scene; this.Content = Content; textFont = Content.Load <SpriteFont>("DebugFont"); G2DPanel statusBar = new G2DPanel(); statusBar.Bounds = new Rectangle(-10, 570, 642, 170); statusBar.Border = GoblinEnums.BorderFactory.LineBorder; statusBar.Transparency = 0.5f; // Ranges from 0 (fully transparent) to 1 (fully opaque) statusBar.BackgroundColor = Color.Black; statusBar.DrawBorder = false; scene.UIRenderer.Add2DComponent(statusBar); G2DPanel topBar = new G2DPanel(); topBar.Bounds = new Rectangle(-10, -3, 850, 35); topBar.Border = GoblinEnums.BorderFactory.LineBorder; topBar.Transparency = 0.5f; // Ranges from 0 (fully transparent) to 1 (fully opaque) topBar.BackgroundColor = Color.Black; topBar.DrawBorder = false; scene.UIRenderer.Add2DComponent(topBar); createCorderBackground(); }
public void UnloadContent(ContentManager content) { if (_currentAmbientEffectInstance != null) { _currentAmbientEffectInstance.Stop(); } }
public override void loadContent(string spriteSheetName, Microsoft.Xna.Framework.Content.ContentManager content) { base.loadContent(spriteSheetName, content); m_Animate.addAnimation(new Animation(8, new int[] { 0, 1, 2, 3 })); m_Animate.addAnimation(new Animation(8, new int[] { 0, 1, 2, 3 })); m_Animate.addAnimation(new Animation(8, new int[] { 0 })); }
public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content) { base.LoadContent(Content); this.anchoMensaje = calcular_Ancho_y_Alto_String.CalcularDimensiones(base.Fuente, base.Texto).X; this.altoMensaje = calcular_Ancho_y_Alto_String.CalcularDimensiones(base.Fuente, base.Texto).Y; //base.Posicion = new Vector2(anchoMensaje, altoMensaje); }
public FPS(Game game, string fullFontName, XnaContentManager xnaContent) : base(game) { Content = xnaContent; Content.RootDirectory = "Content"; fontName = fullFontName; }
public void loadContent(ContentManager content) { foreach (KeyItem key in keys) { key.loadContent("Key", content); } }
public Button(ContentManager content, string buttonName, Vector2 buttonPosition) { this.content = content; this.buttonName = buttonName; this.buttonPosition = buttonPosition; LoadContent(); }
public Jewel(Microsoft.Xna.Framework.Content.ContentManager Content, TypeName typeName, Vector2 vector2, Color color) { // TODO: Complete member initialization this.Content = Content; this.typeName = typeName; this.vector2 = vector2; this.color = color; }
public EngineContentManager(Game game, ContentManager XNAContent) { EngineContentManager.game = game; LoadTextureContent(); EngineContentManager.XNAcontent = XNAContent; LibContent = new ContentManager(game.Services); LibContent.RootDirectory = "Content"; }
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"))); }
public override void Init(Microsoft.Xna.Framework.Content.ContentManager _content) { base.Init(_content); this.MainDeck.Init(_content, "1"); this.GraveYard.Init(_content); this.Lp_change.Position = GlobalSetting.Default.LP_Change; this.LifePoint = GlobalSetting.Default.MaxLP; this.m_numsprite.Position = GlobalSetting.Default.LifePointNum; }
public override void LoadContent() { if (content == null) { content = new Microsoft.Xna.Framework.Content.ContentManager(ScreenManager.Game.Services, "Content"); } backgroundTexture = content.Load <Texture2D>("Interface\\Menu"); }
/// <summary> /// Load graphics content for the screen. /// </summary> public virtual void LoadContent(Microsoft.Xna.Framework.Content.ContentManager contentManager) { this.ContentManager = contentManager; if (this.ContentManager.RootDirectory == String.Empty) { this.ContentManager.RootDirectory = "Content"; } }
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)); } }
public ScreenManager(Game game, GraphicsDeviceManager graphicsdevice, GameServiceContainer service, Microsoft.Xna.Framework.Content.ContentManager m_content) : base(game) { graphics = graphicsdevice; services = service; content = m_content; TouchPanel.EnabledGestures = GestureType.None; // we must set EnabledGestures before we can query for them, but // we don't assume the game wants to read them. }
public override void init(Microsoft.Xna.Framework.Content.ContentManager Content) { content = Content; image.init(Content); image.position.X = 800 / 2 - image.texture.Width / 2; image.position.Y = -image.texture.Height; tweener = new Tweener(image.position.Y, 40, 1f, Back.EaseOut); // tweener.endCallback = goBack; }
public override void init(Microsoft.Xna.Framework.Content.ContentManager Content) { content = Content; base.init(Content); image.init(Content); if (itemModel.rufusModel.title != "COMMING") { star.init(Content); } }
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); }
public override void init(Microsoft.Xna.Framework.Content.ContentManager Content) { content = Content; backBar.init(Content); colorBar.init(Content); invencibleButton.init(Content); colorBar.origin = new Vector2(0, colorBar.position.Y + colorBar.texture.Height - 5); //ableInvencible = false; initDown = false; colorBar.scale.Y = 0f; }
public static void Load(Microsoft.Xna.Framework.Content.ContentManager p_loader) { JKContentManager.Font.MenuFont = SmartLoadFonts(p_loader, ParseData._mod.Fonts.MenuFont, 0); //JKContentManager.Font.MenuFont = p_loader.Load<SpriteFont>("mods/font/sf_litter_lover2_bold"); JKContentManager.Font.MenuFontSmall = SmartLoadFonts(p_loader, ParseData._mod.Fonts.MenuFontSmall, 1); JKContentManager.Font.StyleFont = SmartLoadFonts(p_loader, ParseData._mod.Fonts.StyleFont, 2); JKContentManager.Font.OptimusUnderline = SmartLoadFonts(p_loader, ParseData._mod.Fonts.OptimusUnderline, 3); JKContentManager.Font.Tangerine = SmartLoadFonts(p_loader, ParseData._mod.Fonts.Tangerine, 4); JKContentManager.Font.LocationFont = SmartLoadFonts(p_loader, ParseData._mod.Fonts.LocationFont, 5); JKContentManager.Font.GargoyleFont = SmartLoadFonts(p_loader, ParseData._mod.Fonts.GargoyleFont, 6); }
public static void Initialize(GDM gdm, GD gd, CM cm, SB sb) { G.gdm = gdm; G.gd = gd; G.cm = cm; G.sb = sb; w = gdm.PreferredBackBufferWidth = 1024; h = gdm.PreferredBackBufferHeight = 768; gdm.ApplyChanges(); leftVp = new Viewport(0, 0, G.w / 2, G.h); rightVp = new Viewport(G.w / 2, 0, G.w / 2, G.h); screenVp = new Viewport(0, 0, G.w, G.h); }
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])); } }
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); }
public override void Load(Microsoft.Xna.Framework.Content.ContentManager content) { GameSettings gameSettings = GameSettings.GetGameSettings(); string[] textureNames = null; if (_SpriteType == SpriteType.Blinkey) { textureNames = new string[] { "Blinky/GHOSTA_LEFT", "Blinky/GHOSTA_RIGHT", "Blinky/GHOSTA_UP", "Blinky/GHOSTA_DOWN" }; } if (_SpriteType == SpriteType.Pinkey) { textureNames = new string[] { "Pinky/GHOSTA_LEFT", "Pinky/GHOSTA_RIGHT", "Pinky/GHOSTA_UP", "Pinky/GHOSTA_DOWN" }; } if (_SpriteType == SpriteType.Clyde) { textureNames = new string[] { "Clyde/GHOSTA_LEFT", "Clyde/GHOSTA_RIGHT", "Clyde/GHOSTA_UP", "Clyde/GHOSTA_DOWN" }; } if (_SpriteType == SpriteType.Inky) { textureNames = new string[] { "Inky/GHOSTA_LEFT", "Inky/GHOSTA_RIGHT", "Inky/GHOSTA_UP", "Inky/GHOSTA_DOWN" }; } int i = 0; for (i = 0; i < textureNames.Length; i++) { Animation animation = new Animation(content, true, .08f, 1f); for (int j = 1; j <= 2; j++) { animation.AddTexture(gameSettings.ImagesPath + textureNames[i] + j.ToString()); } AddAnimation(animation); } textureNames = new string[] { "BlueGhost/GHOSTA_LEFT", "BlueGhost/GHOSTA_RIGHT", "BlueGhost/GHOSTA_UP", "BlueGhost/GHOSTA_DOWN" }; for (i = 0; i < textureNames.Length; i++) { Animation animation = new Animation(content, true, .08f, 1f); for (int j = 1; j <= 2; j++) { animation.AddTexture(gameSettings.ImagesPath + textureNames[i] + j.ToString()); } AddAnimation(animation); } }
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(); } }
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(); } }
// Token: 0x060000D1 RID: 209 RVA: 0x0000AEFC File Offset: 0x000090FC private static void LoadMerchants(Microsoft.Xna.Framework.Content.ContentManager p_loader) { JKContentManager.OldMan.merchantSettings = new Dictionary <string, MerchantSettings>(); string str = "mods/props/textures/old_man/"; Dictionary <string, MerchantSettings> dictionary = UltraContent.LoadXmlFiles <MerchantSettings>(Game1.instance, str + "merchant/", ".xml"); JKContentManager.OldMan.merchant_names = new string[dictionary.Count]; int num = 0; foreach (string key in dictionary.Keys) { NPCs.AddSetting(p_loader, dictionary[key].settings); JKContentManager.OldMan.merchant_names[num++] = dictionary[key].settings.name; JKContentManager.OldMan.merchantSettings.Add(dictionary[key].settings.name, dictionary[key]); } }
public Engine() { this.graphics = new Microsoft.Xna.Framework.GraphicsDeviceManager(this); /*the first this is used because the "graphics" variable is outside the scope of method Engine() ,So we need to * get the variable which will be present in the object of this class...So we use "this" keyword to get it. * The 2nd this is the parameter passed to the constructor of class GraphicsDeviceManager which takes as its argument * the game to which the graphics device manager should be associated with. We know that it will be associated to the * object of this class...SO we use "this" again. */ this.content = new Microsoft.Xna.Framework.Content.ContentManager(this.Services); //this.spriteBatch = new Microsoft.Xna.Framework.Graphics.SpriteBatch(this.graphics.GraphicsDevice); //this.box = new mygame.Graphics.Image[Max_Obj]; //this.Initialize(); }