public void LoadContent(ContentLoader content) { myEffect = content.ContentManager.Load<ParticleEffect>(name); myEffect.LoadContent(content.ContentManager); myEffect.Initialise(); myRenderer.LoadContent(content.ContentManager); }
public ParticleEntity(Screen.GameScreen screen, string effectName) : base(screen) { abyss = screen.Game; gameScreen = screen; Effect = abyss.Content.Load<ParticleEffect>(effectName).DeepCopy(); Effect.Initialise(); Effect.LoadContent(abyss.Content); }
public void LoadContent(ContentManager content) { flameEffect = content.Load<ParticleEffect>("Particles\\flameEffect"); flameEffect.LoadContent(content); flameEffect.Initialise(); explosionEffect = content.Load<ParticleEffect>("Particles\\explosionEffect"); explosionEffect.LoadContent(content); explosionEffect.Initialise(); particleRenderer.LoadContent(content); }
public ParticleEffectComponent(Engine engine, string effectName, Vector2 initialPosition) : base(engine) { DrawParticleEffect = true; particleEffectName = effectName; this.Position = initialPosition; particleEffect = Engine.Content.Load<ParticleEffect>(@"ParticleEffects\" + particleEffectName); particleEffect.LoadContent(Engine.Content); particleEffect.Initialise(); DrawOrder = int.MaxValue - 1; Engine.AddComponent(this); }
public PlayerShip(Game game, Vector2 position) { Game = game; _soundBank = Game.Services.GetService<SoundBank[]>(); _world = Game.Services.GetService<World>(); krypton = Game.Services.GetService<KryptonEngine>(); thrustLR = _soundBank[0].GetCue("thrust01"); thrustLR.Play(); thrustLR.Pause(); thrustUD = _soundBank[0].GetCue("thrust01"); thrustUD.Play(); thrustUD.Pause(); Position = position; _particleRenderer = Game.Services.GetService<SpriteBatchRenderer>(); //_textures = Game.Services.GetService<Textures>(); //Loadcontentstuff _shiptxture = Game.Content.Load<Texture2D>("player_ship"); _turretTxture = Game.Content.Load<Texture2D>(".\\guns\\turret01"); _centreVect = new Vector2(_shiptxture.Width / 2, _shiptxture.Height / 2); ProximityBox = new Rectangle(0, 0, _shiptxture.Width+Globals.PhysBuffer, _shiptxture.Height + Globals.PhysBuffer); //make ship fixture in for farseer box = BodyFactory.CreateCircle(_world, ConvertUnits.ToSimUnits(_shiptxture.Width / 2), 7.0f); box.BodyType = BodyType.Dynamic; box.Restitution = 0.5f; box.Friction = 0.2f; box.FixedRotation = true; box.LinearDamping = 0.4f; box.Position = ConvertUnits.ToSimUnits(Position.X + _centreVect.X, Position.Y + _centreVect.Y); box.UserData = "player"; //box.OnCollision += Collide; box.OnSeparation += Collide; //make light in krypton var mLightTexture = LightTextureBuilder.CreateConicLight(Game.GraphicsDevice, 256, 2.0f); light = CreateLights(mLightTexture,400); var mLightTexture2 = LightTextureBuilder.CreatePointLight(Game.GraphicsDevice, 64); light2 = CreateLights(mLightTexture2,200); //set up thruster particle _thrustparticle = Game.Content.Load<ParticleEffect>(".\\mercury\\thruster"); _thrustparticle.LoadContent(Game.Content); _thrusterEmitter = (ConeEmitter)_thrustparticle[0]; //_thrusterEmitter.Initialise(); _thrusterEmitter.ParticleTexture = Game.Content.Load<Texture2D>(".\\mercury\\Particle004"); _thrustparticle.Initialise(); _particleRenderer.LoadContent(Game.Content); //_centerVect = new Vector2(_shiptxture.Width / 2,_shiptxture.Width / 2); currentWeapon = new Gun(Game, true, BulletsStats.Plasma01); }
public void LoadFromFile(Game game, string path) { effect = game.Content.Load<ParticleEffect>(path); effect.LoadContent(game.Content); effect.Initialise(); }
protected override void LoadContent() { // Rendering inits. spriteBatch = new SpriteBatch(GraphicsDevice); kinectRGBVideo.Texture = new Texture2D(GraphicsDevice, gameWidth, gameHeight, false, SurfaceFormat.Color); // Game Set inits. initGameSetList(); generateGameSet(); // Load sounds correct_snd = new GameSFX(Content.Load<SoundEffect>("kling")); //Loads the background music and plays it GameMusic background = new GameMusic(Content.Load<Song>("background_music3")); background.PlayLooping(); particleRenderer.LoadContent(Content); particleEffect = Content.Load<ParticleEffect>(("BasicExplosion")); particleEffect.LoadContent(Content); particleEffect.Initialise(); /* //skeleton right hand GameTextureInstance texture = GameTextureInstance.CreateBlank(GraphicsDevice, 20, 20); texture.Position = new Vector2(0, 0); texture.Alpha = 1; texture.Color = Color.Orange; skeletonSpots.Add(texture); //Left hand texture = GameTextureInstance.CreateBlank(GraphicsDevice, 20, 20); texture.Position = new Vector2(0, 0); texture.Alpha = 1; texture.Color = Color.BlueViolet; skeletonSpots.Add(texture); //hotspots texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes); texture.Position = new Vector2(EdgeOffset); texture.Alpha = HotSpotAlpha; hotSpots.Add(texture); texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes); texture.Position = new Vector2(GraphicsDevice.Viewport.Width - texture.Texture.Width - EdgeOffset, EdgeOffset); texture.Alpha = HotSpotAlpha; hotSpots.Add(texture); texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes); texture.Position = new Vector2(10, GraphicsDevice.Viewport.Height - texture.Texture.Height - EdgeOffset); texture.Alpha = HotSpotAlpha; hotSpots.Add(texture); texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes); texture.Position = new Vector2(GraphicsDevice.Viewport.Width - texture.Texture.Width - EdgeOffset, GraphicsDevice.Viewport.Height - texture.Texture.Height - EdgeOffset); texture.Alpha = HotSpotAlpha; hotSpots.Add(texture); //debug textures GameTextureInstance rectTexture = GameTextureInstance.CreateBlank(GraphicsDevice, 80, 80); rectTexture.Alpha = 0.3f; rectTexture.Color = Color.HotPink; debugSpots.Add(rectTexture); rectTexture = GameTextureInstance.CreateBlank(GraphicsDevice, 80, 80); rectTexture.Alpha = 0.3f; rectTexture.Color = Color.HotPink; debugSpots.Add(rectTexture); ResetSquareColors(); */ }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); sfScore = Content.Load<SpriteFont>("ScoreFont"); sfSplash = Content.Load<SpriteFont>("SplashFont"); Vector2 tmpVec = sfSplash.MeasureString("SNAKE"); splashVec = new Vector2((graphics.GraphicsDevice.Viewport.Width / 2.0f) - (tmpVec.X / 2.0f), 0); tmpVec = sfScore.MeasureString("Press 'SpaceBar' to Play"); enterVec = new Vector2((graphics.GraphicsDevice.Viewport.Width / 2.0f) - (tmpVec.X / 2.0f), graphics.GraphicsDevice.Viewport.Height - tmpVec.Y); blockTexture = Content.Load<Texture2D>("block"); explode = Content.Load<ParticleEffect>("BasicExplosion"); explode.LoadContent(Content); explode.Initialise(); renderer.LoadContent(Content); }
public void Load(string _fileName) { fileName = _fileName; effect = Content.Load<ParticleEffect>(fileName); effect.LoadContent(Content); effect.Initialise(); renderer.LoadContent(Content); }
protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // load particle effects myEffect = Content.Load<ParticleEffect>(@"EffectLibrary\CampFire"); myEffect.LoadContent(this.Content); myEffect.Initialise(); myRenderer.LoadContent(Content); Camera = new Camera2d(); Camera.Pos = new Vector2(400.0f, 400.0f); meteoros = new Meteor(Content.Load<Texture2D>("Sprites\\meteoro_teste")); NaveFilho_1 = new NaveFilho(Content.Load<Texture2D>("Sprites\\StarShip_Filho"), viewportRect.Width / 2);//, 1); NaveFilho_2 = new NaveFilho(Content.Load<Texture2D>("Sprites\\StarShip_Filho"), viewportRect.Width / 2 + 200);//, 2); //NaveFilho.Velocidade *= -1; shipCannon = new shipCannon(Content.Load<Texture2D>("Sprites\\shipCannon")); shipCannon2 = new shipCannon(Content.Load<Texture2D>("Sprites\\shipCannon")); HUD = Content.Load<SpriteFont>("Fonts\\HUD"); meteorTexture = Content.Load<Texture2D>("Sprites\\meteoro_teste"); //meteorTexture = Content.Load<Texture2D>("Sprites\\1"); Debug = Content.Load<SpriteFont>("Fonts\\Score"); Fundo = Content.Load<Texture2D>("Sprites\\background"); elementoBen = new elementoBenefico(Content.Load<Texture2D>("Sprites\\insgrocha"), Content.Load<Texture2D>("Sprites\\insignacoracao")); shipCannon2.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 + 110, Window.ClientBounds.Height - 100); shipCannon.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 - 65, Window.ClientBounds.Height - 120); shipCannon.center = new Vector2(shipCannon.sprite.Width / 2, shipCannon.sprite.Height / 2 - 30); }
private void AddParticleEffect(ParticleEffect particleEffect, ICollidableTile trackingObject) { particleEffect.LoadContent(m_game.Content); particleEffect.Initialise(); var entry = new LightCausingParticleObject(particleEffect, m_particleRenderer, new PointLight() { Colour = Color.Orange, LightIntensity = 4, LightRadius = 25, LightPosition = new Vector3(300, 160, -100) }, trackingObject) { Name = "FlameThrower", Enabled = false }; ParticleEffects.Add(entry); }
protected virtual void loadContent(ContentManager content) { player.loadContent(content); scenario.loadContent(content); sf = content.Load<SpriteFont>("Fonts/gamefont"); if (background == null) { background = content.Load<Texture2D>("Levels/FondoTest"); } foreach (Collectible c in collectibles) { c.loadContent(content); } myEffect = content.Load<ParticleEffect>(@"Particles/BasicExplosion"); myEffect.LoadContent(content); myEffect.Initialise(); myRenderer.LoadContent(content); sbRenderer.LoadContent(content); special = new SpriteSheet(ScreenManager.Game, content.Load<Texture2D>("collectiblePez"), 2,2, ScreenManager.SpriteBatch); special.scale = 40f / special.frameWidth; simple = new SpriteSheet(ScreenManager.Game, content.Load<Texture2D>("collectibleLeche"), 2, 2, ScreenManager.SpriteBatch); simple.scale = 40f / simple.frameWidth; simple.gotoAndStop(1); debugView.LoadContent(ScreenManager.Game.GraphicsDevice, content); }
/// <summary> /// Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources. /// </summary> protected override void LoadContent() { mScreenCenter = new Vector2(mGraphics.GraphicsDevice.Viewport.Width / 2f, mGraphics.GraphicsDevice.Viewport.Height / 2f); mTexture = mContentManager.Load<Texture2D>(@"Content\Textures\boxSprite"); mWidth = ConvertUnits.ToSimUnits(mTexture.Width); mHeight = ConvertUnits.ToSimUnits(mTexture.Height); mOrigin = new Vector2(mWidth / 2, mHeight / 2); mPosition = ConvertUnits.ToSimUnits(mScreenCenter.X, mScreenCenter.Y); mBody = BodyFactory.CreateRectangle(mWorld, mWidth, mHeight,1f, mPosition); //mBody.LinearDamping = f; //mBody.Restitution = 1f; if (playerIndex == PlayerIndex.One) mBody.BodyType = BodyType.Dynamic; else mBody.BodyType = BodyType.Dynamic; mBody.OnCollision += new OnCollisionEventHandler(OnCollision); mBody.OnSeparation += new OnSeparationEventHandler(OnSeparation); mWorld.ContactManager.OnBroadphaseCollision += OnBroadphaseCollision; mBody.FixtureList[0].AfterCollision += new AfterCollisionEventHandler(OnAfterCollision); //FixedPrismaticJoint fixedPrismJoint = new FixedPrismaticJoint(mBody, mBody.Position, new Vector2(0, 1f)); //fixedPrismJoint.LimitEnabled = true; //fixedPrismJoint.LowerLimit = -3f; //fixedPrismJoint.UpperLimit = 3f; //fixedPrismJoint.Enabled = true; //mWorld.AddJoint(fixedPrismJoint); particleRenderer.LoadContent(mContentManager); particleEffect = mContentManager.Load<ParticleEffect>(@"Content\basicExplosion"); particleEffect.LoadContent(mContentManager); particleEffect.Initialise(); base.LoadContent(); }
protected void LoadContent(bool loadAllContent) { spriteBatch = new SpriteBatch(GraphicsDevice); levelOneTrue = 0; levelTwoTrue = 0; //load bbox images torch = Content.Load<Texture2D>("torch"); fountain = Content.Load<Texture2D>("fountain"); //load level images level1 = Content.Load<Texture2D>("level1"); level2 = Content.Load<Texture2D>("level2"); //load item bboxs torchBbox1 = new Bbox(torch, 600, 150, "fire"); torchBbox2 = new Bbox(torch, 150, 150, "fire"); fountainBbox = new Bbox(fountain, 250, 220, "water"); //load levels levelOne = new Level(level1); levelTwo = new Level(level2); //right hand rightHand = new Bbox(handImage, righthandPosition.X, righthandPosition.Y, "normal"); //fill level bbox lists levelOne.addBbox(torchBbox1); levelOne.addBbox(torchBbox2); levelTwo.addBbox(fountainBbox); //create tasks levelOneT1 = new CollisionTask(rightHand, torchBbox1, "fire"); levelOneT2 = new CollisionTask(rightHand, torchBbox2, "fire"); levelTwoT1 = new CollisionTask(rightHand, fountainBbox, "water"); //level one tasks levelOne.addTask(levelOneT1); levelOne.addTask(levelOneT2); //level two tasks levelTwo.addTask(levelTwoT1); myEffect = Content.Load<ParticleEffect>("handflame"); myEffect.LoadContent(Content); myEffect.Initialise(); waterEffect = Content.Load<ParticleEffect>("WaterJet"); waterEffect.LoadContent(Content); waterEffect.Initialise(); smokeEffect = Content.Load<ParticleEffect>("BasicSmokePlume"); smokeEffect.LoadContent(Content); smokeEffect.Initialise(); myRenderer.LoadContent(Content); //Load the sound file using Content.Load roomTone = Content.Load<SoundEffect>("kinectFinal--soundScape"); fireSound = Content.Load<SoundEffect>("fx_fire_embers_01_a_lp"); waterSound = Content.Load<SoundEffect>("amb_water_river_lp"); instance1 = roomTone.CreateInstance(); fireInstance = fireSound.CreateInstance(); waterInstance = waterSound.CreateInstance(); instance1.IsLooped = true; waterInstance.IsLooped = true; fireInstance.IsLooped = true; instance1.Play(); }
protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // load particle effects myEffect = Content.Load<ParticleEffect>(@"EffectLibrary\BasicExplosion"); myEffect.LoadContent(this.Content); myEffect.Initialise(); myRenderer.LoadContent(Content); shipCannon = new GameObject(Content.Load<Texture2D>("Sprites\\shipCannon")); // shipCannon2 = new GameObject(Content.Load<Texture2D>("Sprites\\shipCannon")); HUD = Content.Load<SpriteFont>("Fonts\\HUD"); meteorTexture = Content.Load<Texture2D>("Sprites\\Meteorito"); Debug = Content.Load<SpriteFont>("Fonts\\Score"); Fundo = Content.Load<Texture2D>("Sprites\\fundo"); shipCannon2 = new GameObject(Content.Load<Texture2D>("Sprites\\shipCannon")); shipCannon2.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 + 110, Window.ClientBounds.Height - 100); shipCannon.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 - 80, Window.ClientBounds.Height - 100); //shipCannon2.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 + 100, //Window.ClientBounds.Height - 20); viewportRect = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); }
protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // load particle effects myEffect = Content.Load<ParticleEffect>(@"EffectLibrary\CampFire"); myEffect.LoadContent(this.Content); myEffect.Initialise(); myRenderer.LoadContent(Content); shipCannon = new GameObject(Content.Load<Texture2D>("Sprites\\shipCannon")); HUD = Content.Load<SpriteFont>("Fonts\\HUD"); meteorTexture = Content.Load<Texture2D>("Sprites\\meteoro_teste"); //meteorTexture = Content.Load<Texture2D>("Sprites\\1"); Debug = Content.Load<SpriteFont>("Fonts\\Score"); Fundo = Content.Load<Texture2D>("Sprites\\background"); shipCannon2 = new GameObject(Content.Load<Texture2D>("Sprites\\shipCannon")); elementoBen = new elementoBenefico(Content.Load<Texture2D>("Sprites\\insgrocha"), Content.Load<Texture2D>("Sprites\\insignacoracao")); shipCannon2.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 + 110, Window.ClientBounds.Height - 100); shipCannon.position = new Vector2(Window.ClientBounds.Width / 2 - shipCannon.sprite.Width / 2 - 80, Window.ClientBounds.Height - 100); meteorTextureDB = new Color[meteorTexture.Width * meteorTexture.Height]; meteorTexture.GetData(meteorTextureDB); }
public GOEffect(GraphicsDeviceManager _graphics, ContentManager _Content, string _fileName) { graphics = _graphics; Content = _Content; renderer = new SpriteBatchRenderer { GraphicsDeviceService = graphics }; effect = new ParticleEffect(); fileName = _fileName; effect = Content.Load<ParticleEffect>(fileName); effect.LoadContent(Content); effect.Initialise(); renderer.LoadContent(Content); Visible = true; }