本文整理汇总了C#中ContentManager.Load方法的典型用法代码示例。如果您正苦于以下问题:C# ContentManager.Load方法的具体用法?C# ContentManager.Load怎么用?C# ContentManager.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentManager
的用法示例。
在下文中一共展示了ContentManager.Load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParticleSystem
public ParticleSystem(GraphicsDevice device, ContentManager content)
{
this.device = device;
// Create vertex buffer used to spawn new particles
this.particleStart = Buffer.Vertex.New<ParticleVertex>(device, MAX_NEW);
// Create vertex buffers to use for updating and drawing the particles alternatively
var vbFlags = BufferFlags.VertexBuffer | BufferFlags.StreamOutput;
this.particleDrawFrom = Buffer.New<ParticleVertex>(device, MAX_PARTICLES, vbFlags);
this.particleStreamTo = Buffer.New<ParticleVertex>(device, MAX_PARTICLES, vbFlags);
this.layout = VertexInputLayout.FromBuffer(0, this.particleStreamTo);
this.effect = content.Load<Effect>("ParticleEffect");
this.texture = content.Load<Texture2D>("Dot");
this.viewParameter = effect.Parameters["_view"];
this.projParameter = effect.Parameters["_proj"];
this.lookAtMatrixParameter = effect.Parameters["_lookAtMatrix"];
this.elapsedSecondsParameter = effect.Parameters["_elapsedSeconds"];
this.camDirParameter = effect.Parameters["_camDir"];
this.gravityParameter = effect.Parameters["_gravity"];
this.textureParameter = effect.Parameters["_texture"];
this.samplerParameter = effect.Parameters["_sampler"];
this.updatePass = effect.Techniques["UpdateTeq"].Passes[0];
this.renderPass = effect.Techniques["RenderTeq"].Passes[0];
}
示例2: LoadContent
/// <summary>
/// Loads the content.
/// </summary>
/// <param name="content">The ContentManager.</param>
public override void LoadContent(ContentManager content)
{
_skyBox =
new Skybox(new[]
{
content.Load<Texture2D>("mainbackground.png"), content.Load<Texture2D>("bgLayer1.png"),
content.Load<Texture2D>("bgLayer2.png")
});
_header = new Font("Segoe UI", 25, TypefaceStyle.Bold);
_subHeader = new Font("Segoe UI", 40, TypefaceStyle.Bold);
_fadeableText1 = new FadeableText
{
Font = _header,
Text = "ThuCommix presents",
Position = new Vector2(270, 200),
FadeInVelocity = 2,
FadeOutVelocity = 3
};
_fadeableText2 = new FadeableText
{
Font = _header,
Text = "a game powered by Sharpex2D",
Position = new Vector2(220, 200),
FadeInVelocity = 2,
FadeOutVelocity = 3
};
_fadeableText3 = new FadeableText
{
Font = _subHeader,
Text = "XPlane",
Position = new Vector2(330, 200),
FadeInVelocity = 2,
FadeOutVelocity = 2
};
}
示例3: BGLayerButton
public BGLayerButton(ContentManager content)
: base(content)
{
normalTexture = content.Load<Texture2D>("Editor/Buttons/LayerButtons/Normal/Background");
TextureToDraw = normalTexture;
hooverTexture = content.Load<Texture2D>("Editor/Buttons/LayerButtons/Hoover/BackgroundHoover");
}
示例4: BGTile2
public BGTile2(ContentManager content)
: base(content)
{
normalTexture = content.Load<Texture2D>("Editor/ToolButtons/Normal/BGTile2");
TextureToDraw = normalTexture;
hooverTexture = content.Load<Texture2D>("Editor/ToolButtons/Hoover/BGTile2Hoover");
}
示例5: LoadContent
/// <summary>
/// Loads the content.
/// </summary>
/// <param name="content">The Content.</param>
public override void LoadContent(ContentManager content)
{
_skyBox =
new Skybox(new[]
{
content.Load<Texture2D>("mainbackground.png"), content.Load<Texture2D>("bgLayer1.png"),
content.Load<Texture2D>("bgLayer2.png")
});
}
示例6: loadResource
public static void loadResource(ContentManager Content)
{
plant = new Texture2D[5];
plant[0] = Content.Load<Texture2D>("UI/carrotIcon");
plant[1] = Content.Load<Texture2D>("UI/tomatoIcon");
plant[2] = Content.Load<Texture2D>("UI/eggplantIcon");
plant[3] = Content.Load<Texture2D>("UI/bananaIcon");
plant[4] = Content.Load<Texture2D>("UI/watermelonIcon");
}
示例7: GameWorld
public GameWorld(int width, int height, ContentManager Content)
{
screenWidth = width;
screenHeight = height;
random = new Random();
gameState = GameState.Menu;
inputHelper = new InputHelper();
block = Content.Load<Texture2D>("block");
reset = Content.Load<Texture2D>("reset");
font = Content.Load<SpriteFont>("SpelFont");
font2 = Content.Load<SpriteFont>("SpriteFont1");
font3 = Content.Load<SpriteFont>("SpriteFont2");
playButton = Content.Load<Texture2D>("Play");
optionsButton = Content.Load<Texture2D>("Options");
backButton = Content.Load<Texture2D>("Back");
polytris = Content.Load<Texture2D>("Polytris");
grid = new TetrisGrid(block);
level = 1;
levelspeed = 1;
score = 0;
i = (int)random.Next(7) + 1;
i2 = (int)random.Next(7) + 1;
blockcounter = 1;
blocks = new BlockList(block, Content); //Voegen de verschillende blockobjecten toe aan de lijst
block1 = new Block1(block, Content);
blocks.Add(block1, 1);
block2 = new Block2(block, Content);
blocks.Add(block2, 2);
block3 = new Block3(block, Content);
blocks.Add(block3, 3);
block4 = new Block4(block, Content);
blocks.Add(block4, 4);
block5 = new Block5(block, Content);
blocks.Add(block5, 5);
block6 = new Block6(block, Content);
blocks.Add(block6, 6);
block7 = new Block7(block, Content);
blocks.Add(block7, 7);
//Voegen de verschillende blockobjecten toe aan een tweede lijst voor het tekenen van het volgende blokje
block1res = new Block1(block, Content);
blocks.AddToReserve(block1res, 1);
block2res = new Block2(block, Content);
blocks.AddToReserve(block2res, 2);
block3res = new Block3(block, Content);
blocks.AddToReserve(block3res, 3);
block4res = new Block4(block, Content);
blocks.AddToReserve(block4res, 4);
block5res = new Block5(block, Content);
blocks.AddToReserve(block5res, 5);
block6res = new Block6(block, Content);
blocks.AddToReserve(block6res, 6);
block7res = new Block7(block, Content);
blocks.AddToReserve(block7res, 7);
options = new Options(block, reset, backButton, width, height, font, blocks);
menu = new Menu(playButton, optionsButton, polytris, width, height);
gameOver = new GameOver(backButton, width, height);
}
示例8: GameWorld
public GameWorld(int width, int height, ContentManager Content)
{
screenWidth = width;
screenHeight = height;
random = new Random();
gameState = GameState.Playing;
block = Content.Load<Texture2D>("block");
font = Content.Load<SpriteFont>("SpelFont");
grid = new TetrisGrid(block);
}
示例9: Load
public void Load(ContentManager content)
{
//MapGame = game;
// load map
//map = content.Load<Map>("Maps/Start");
map.Texture = content.Load<Texture2D>("Textures/tileSet");
font = content.Load<SpriteFont>("Arial");
map.Load();
}
示例10: Intro
public override void Intro( params object [] args )
{
contentManager = new ContentManager ( FileSystemManager.GetFileSystem ( "ManifestFileSystem" ) );
contentManager.AddDefaultContentLoader ();
LiqueurSystem.Launcher.InvokeInMainThread ( () =>
{
titleFont = contentManager.Load<TrueTypeFont> ( "Test.Game.Dodge.Resources.GameFont.ttf", 64 );
menuFont = contentManager.Load<TrueTypeFont> ( "Test.Game.Dodge.Resources.GameFont.ttf", 24 );
} );
base.Intro ( args );
}
示例11: Initialise
/// <summary>
/// Initialises the asset manager.
/// </summary>
/// <param name="coMan"></param>
public static void Initialise(ContentManager coMan)
{
if (coMan != null)
{
coManager = coMan;
DefTexture = coMan.Load<Texture2D>("Default/DefTexture");
DefFont = coMan.Load<SpriteFont>("Default/DefFont");
}
else
Console.WriteLine("The content manager send to the Asset class was null (empty)!");
}
示例12: Cannon
public Cannon(ContentManager Content)
{
this.cannonBarrel = Content.Load<Texture2D>("spr_cannon_barrel");
barrelPosition = new Vector2(72, 405);
barrelOrigin = new Vector2(cannonBarrel.Height, cannonBarrel.Height) / 2;
this.colorRed = Content.Load<Texture2D>("spr_cannon_red");
this.colorBlue = Content.Load<Texture2D>("spr_cannon_blue");
this.colorGreen = Content.Load<Texture2D>("spr_cannon_green");
currentColor = colorBlue;
Color = Color.Blue;
colorOrigin = new Vector2(currentColor.Width, currentColor.Height) / 2;
}
示例13: Paddle
public int Playertype; // 0 = Human, 1 = Computer
public Paddle(ContentManager Content, GraphicsDeviceManager graphics, int x, int y, int playerType)
{
xloc = x;
yloc = y;
Position = new Vector2(xloc, yloc); // inladen positie van 'Position' met variabelen xloc en yloc.
blauweSpeler = Content.Load<Texture2D>("blauweSpeler");
rodeSpeler = Content.Load<Texture2D>("rodeSpeler");
BoundsPaddle = blauweSpeler.Bounds;
BoundsPaddle.X = (int)Position.X;
BoundsPaddle.Y = (int)Position.Y;
Playertype = playerType;
}
示例14: Intro
public override void Intro( params object [] args )
{
contentManager = new ContentManager ( FileSystemManager.GetFileSystem ( "ManifestFileSystem" ) );
contentManager.AddDefaultContentLoader ();
audio1 = contentManager.Load<IAudio> ( "Test.Game.PlaySound.Resources.test1.ogg" );
audio2 = contentManager.Load<IAudio> ( "Test.Game.PlaySound.Resources.test2.ogg" );
font = contentManager.Load<TrueTypeFont> ( "Test.Game.PlaySound.Resources.GameFont.ttf", 20 );
Add ( InputHelper.CreateInstance () );
base.Intro ( args );
}
示例15: LoadContent
public override void LoadContent(ContentManager content)
{
base.LoadContent(content);
_ascii = content.Load<TileSet>("TileSets/ASCII.xml");
var progress = new Progress<string>(message => _progressMessages.Push(message));
content.Load<BlockRegistry>("Blocks/SampleBlockRegistry.xml");
ItemRegistry.Instance.Initialize();
_loadingTask = Task.Run(() =>
{
_level = new Level(ChunkType.Overworld);
var chunk = _level[ChunkLayer.Floor, 0, 0]; // generate the first chunk
}).ContinueWith(x => Thread.Sleep(100));
}