public void Load(ContentCache cache) { Log.Write(this, "Loading texture resource for video sprite."); cache.Load(resource, out texture); pixelData = new Color[texture.Width * texture.Height]; texture.GetData<Color>(pixelData); Loaded = true; }
public void Load(ContentCache cache) { cache.Load(resource, out font); Loaded = true; }
public virtual void Load(ContentCache cache) { Log.Write(this, "Loading game sky."); cache.Load(resource, out model); Loaded = true; }
public virtual void Load(ContentCache cache) { Log.Write(this, "Loading game terrain."); cache.Load(resource, out model); if (model != null) { heightMap = model.Tag as TerrainContent; if (heightMap == null) { string message = "The terrain model did not have a TerrainMap " + "object attached. Are you sure you are using the " + "TerrainProcessor?"; throw new InvalidOperationException(message); } } Loaded = true; }
/// <summary> /// Loads graphics for the particle system. /// </summary> public void Load(ContentCache cache) { Log.Write(this, "Loading effect resource for the video particle effect."); cache.Load(resource, out config); particles = new Particle[config.MaxParticles]; InitializeParticleEffect(); vertexDeclaration = new VertexDeclaration(Manager.Game.GraphicsDevice, Particle.VertexElements); // Create a dynamic vertex buffer. int size = Particle.SizeInBytes * particles.Length; vertexBuffer = new DynamicVertexBuffer(Manager.Game.GraphicsDevice, size, BufferUsage.WriteOnly | BufferUsage.Points); Loaded = true; }
public override void Load(ContentCache cache) { Log.Write(this, "Loading model resource for video model."); cache.Load(resource, out model); }
public virtual void Load(ContentCache cache) { cache.Load(resource, out texture); foreach (VideoEffect effect in effects) { effect.Load(cache); } Loaded = true; }
public void Load(ContentCache cache) { cache.Load (@"Models\skydome", out dome); cache.Load (@"Effects\atmosphere", out effect); cache.Load (@"Textures\daysky", out day); cache.Load (@"Textures\sunset", out sunset); cache.Load (@"Textures\nightsky", out night); effect.CurrentTechnique = effect.Techniques["SkyDome"]; foreach (ModelMesh mesh in dome.Meshes) { foreach (ModelMeshPart part in mesh.MeshParts) { part.Effect = effect; } } realTime = true; }
public virtual void Load(ContentCache cache) { Log.Write(this, "Loading game terrain."); cache.Load(modelResource, out model); cache.Load(textureResource, out texture); cache.Load(effectResource, out effect); foreach (ModelMesh mesh in model.Meshes) { foreach (ModelMeshPart part in mesh.MeshParts) { part.Effect = effect; } } Loaded = true; }