]>
Commit | Line | Data |
---|---|---|
63419029 BB |
1 | #region File Description |
2 | //----------------------------------------------------------------------------- | |
3 | // SuperPolarityMacGame.cs | |
4 | // | |
5 | // Microsoft XNA Community Game Platform | |
6 | // Copyright (C) Microsoft Corporation. All rights reserved. | |
7 | //----------------------------------------------------------------------------- | |
8 | #endregion | |
9 | ||
10 | #region Using Statements | |
11 | using System; | |
12 | ||
13 | using Microsoft.Xna.Framework; | |
14 | using Microsoft.Xna.Framework.Audio; | |
15 | using Microsoft.Xna.Framework.Graphics; | |
16 | using Microsoft.Xna.Framework.Input; | |
17 | using Microsoft.Xna.Framework.Input.Touch; | |
18 | using Microsoft.Xna.Framework.Storage; | |
19 | using Microsoft.Xna.Framework.Content; | |
20 | using Microsoft.Xna.Framework.Media; | |
21 | ||
22 | #endregion | |
23 | ||
24 | namespace SuperPolarityMac | |
25 | { | |
26 | /// <summary> | |
27 | /// Default Project Template | |
28 | /// </summary> | |
29 | public class Game1 : Game | |
30 | { | |
31 | ||
32 | #region Fields | |
33 | GraphicsDeviceManager graphics; | |
34 | SpriteBatch spriteBatch; | |
35 | Texture2D logoTexture; | |
36 | #endregion | |
37 | ||
38 | #region Initialization | |
39 | ||
40 | public Game1() | |
41 | { | |
42 | ||
43 | graphics = new GraphicsDeviceManager(this); | |
44 | ||
45 | Content.RootDirectory = "Content"; | |
46 | ||
47 | graphics.IsFullScreen = false; | |
48 | } | |
49 | ||
50 | /// <summary> | |
51 | /// Overridden from the base Game.Initialize. Once the GraphicsDevice is setup, | |
52 | /// we'll use the viewport to initialize some values. | |
53 | /// </summary> | |
54 | protected override void Initialize() | |
55 | { | |
56 | base.Initialize(); | |
57 | } | |
58 | ||
59 | ||
60 | /// <summary> | |
61 | /// Load your graphics content. | |
62 | /// </summary> | |
63 | protected override void LoadContent() | |
64 | { | |
65 | // Create a new SpriteBatch, which can be use to draw textures. | |
66 | spriteBatch = new SpriteBatch(graphics.GraphicsDevice); | |
67 | ||
68 | // TODO: use this.Content to load your game content here eg. | |
69 | logoTexture = Content.Load<Texture2D>("logo"); | |
70 | } | |
71 | ||
72 | #endregion | |
73 | ||
74 | #region Update and Draw | |
75 | ||
76 | /// <summary> | |
77 | /// Allows the game to run logic such as updating the world, | |
78 | /// checking for collisions, gathering input, and playing audio. | |
79 | /// </summary> | |
80 | /// <param name="gameTime">Provides a snapshot of timing values.</param> | |
81 | protected override void Update(GameTime gameTime) | |
82 | { | |
83 | // TODO: Add your update logic here | |
84 | ||
85 | base.Update(gameTime); | |
86 | } | |
87 | ||
88 | /// <summary> | |
89 | /// This is called when the game should draw itself. | |
90 | /// </summary> | |
91 | /// <param name="gameTime">Provides a snapshot of timing values.</param> | |
92 | protected override void Draw(GameTime gameTime) | |
93 | { | |
94 | // Clear the backbuffer | |
95 | graphics.GraphicsDevice.Clear(Color.CornflowerBlue); | |
96 | ||
97 | spriteBatch.Begin(); | |
98 | ||
99 | // draw the logo | |
100 | spriteBatch.Draw(logoTexture, new Vector2 (130, 200), Color.White); | |
101 | ||
102 | spriteBatch.End(); | |
103 | ||
104 | //TODO: Add your drawing code here | |
105 | base.Draw(gameTime); | |
106 | } | |
107 | ||
108 | #endregion | |
109 | } | |
110 | } |