English 中文(简体)
• 如何在XNA 4.0中添加开端(斜线)屏幕?
原标题:How to add a start (splash) screen in XNA 4.0?
  • 时间:2012-01-13 00:03:45
  •  标签:
  • xna-4.0

I just want to create a simple splash screen containing the following in the menu;

" Press "Enter" to start " // "Instructions"

(很明显,当你在指示网页上重读时,应当有一个“浮标回主要菜单”

I m 创造的游戏是2D型游乐游戏(我没有在这种游戏中执行时间(没有怎么做))

I ve tried to implement this in my code; http://create.msdn.com/en-US/education/catalog/sample/game_state_management

But I gave up after half an hours (too complicated)

任何帮助都是受欢迎的。 谢谢!

问题回答

你们可以采取的另一个行动是用大刀来储存不同的游戏区。

//Don t forget to put this above the Game1 class!
public enum GameState
{
    Menu,
    Game, 
    Credits,
    Etc
}

最初:

GameState gameState = new GameState();
gameState = GameState.Menu;

接着,你重新计算方法:

if(gameState == GameState.Menu)
{
// Draw your menu, do other stuff for other gamestates.
}

最后更新:

if(gameState == GameState.Menu)
{
// check if keyboard is pressed and continue if it is
}
else if(gameState == GameState.Game)
{
// Your main game update logic
}

希望帮助!

你在适当轨道上与微软游戏邦管理范例进行了交流。 基本上,你们需要某种国家管理,以控制什么表现和时间。

这可能与在主提炼方法中改变游戏物体(图象等)的滚动旗一样简单:。 开始游戏的新闻”

查阅Caapult Wars lab(),以实施作为MUCH更有力解决办法的GSM范例。





相关问题
XNA - Signing in with Local Profile

I am trying to learn XNA (4.0) multiplayer networking for the PC only environment. For development, I read that using local profiles (with SystemLink) for PC-only environment does not require me to ...

How to disable the depth buffer?

I don t see a RenderState as a member in the GraphicsDevice class, which is where the functions for disabling the depth buffer used to be. Anyone know how this is done with this new 4.0 API? It would ...

Xna 4.0 3D Vertex example

I m currently trying to make a simple square by combining two triangles, like in the tutorials by Riemer (Link to tutorial), but since a lot has changed from 3.x to 4.0, I find it difficult. I would ...

Drag/Swipe to scroll the screen

What would be the best way to have a vertical scrolling screen? My game will consume two screens high, the user should be able to move between the two screens by a simple drag or swipe action. The ...

How do I load a texture in XNA at runtime?

I m working on an application that uses the XNA framework to do it s 3D rendering. I now want to load a texture from file. I ve found two methods so far: Texture2D.FromStream(GraphicsDevice, Stream) ...

Problems with some textures in XNA

I have made a model using Sketchup, and have tested rendering it using Blender and it looks great. However loading it in XNA has two problems. 1. One of the textures becomes see-thru not entierly ...

Need help loading XML data into XNA 4.0 project

I d like to do this the right way if possible. I have XML data as follows: <?xml version="1.0" encoding="utf-8"?> <XnaContent> <Asset Type="PG2.Dictionary"> &...

Formatting Text in C# with XNA

I m currently trying to make a TextBox for my GUI with XNA, and I was wondering how could I find tagged text in a string. For instanceI have this kind of text: Hey there, I was <r>going to</...

热门标签