xna-4.0


How do I fix 'No suitable method found to override' error on XNA 4.0?


I am following the road not taken tutorial, but I get a No suitable mthod found to override error. Here is my XNA project:
Code
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
SpriteBatch mSpriteBatch;
Texture2D mTrack;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
/// <summary>
/// Allows the game to perform any initialization it needs to before
/// starting to run. This is where it can query for any required
/// services and load any non-graphic related content.
/// Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
//Change the resolution to 800x600
graphics.PreferredBackBufferWidth = 800;
graphics.PreferredBackBufferHeight = 600;
graphics.ApplyChanges();
base.Initialize();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadGraphicsContent(bool loadAllContent)
{
if (loadAllContent)
{
//Create the SpriteBatch used for drawing the Sprites
mSpriteBatch = new SpriteBatch(graphics.GraphicsDevice);
//Load the images from computer into the Texture2D objects
mTrack = Content.Load<Texture2D>("Track");
}
// TODO: use this.Content to load your game content here
}
/// <summary>
/// UnloadContent will be called once per game and is the place to unload
/// all content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back
== ButtonState.Pressed)
this.Exit();
// TODO: Add your update logic here
base.Update(gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
mSpriteBatch.Begin();
mSpriteBatch.Draw(mTrack,
new Rectangle(0, 0, mTrack.Width, mTrack.Height),
Color.White);
mSpriteBatch.End();
base.Draw(gameTime);
}
}
}
Error
TheRoadNotTaken.Game1.LoadGraphicsContent(bool)': no suitable method found to override
How can I fix this error?
I believe LoadGraphicsContent has been deprecated. You need to override LoadContent() instead of LoadGraphicsContent(bool loadAllContent)
If that tutorial is for 4.0, then its using outdated information. Here's the MSDN for it: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.loadgraphicscontent(v=xnagamestudio.31).aspx

Related Links

Adding GamerServicesComponent causes ridiculously long program start
Platformer tile engine--advice on what to do with long tiles
XNA Vector2 path contained inside rectangle
XNA changing 200 or so tiles pixels
Loading files during run time in XNA 4.0
Optimized keyboard controls for XNA game
Best structure for xna Arcade Game
xna 4 taking desktop screenshot
Can't reset my gametime to zero in XNA
Displaying seconds in XNA with Keypress?
XNA game how to make a snake tail
Creating an array of game objects
Lap timer in XNA 4.0?
XNA: Identifying identical sprites created with for loop
Increase Character Spacing in XNA
XNA choosing a subgroup of Game.Components

Categories

HOME
vim
activiti
comparison
fft
cplex
bookshelf.js
rdf
frameworks
v8
fingerprint
opengl-es-2.0
mouse
uber-api
synchronization
gorm
communication
offline
rascal
windows-azure-storage
timeout
circular-dependency
moonmail
hex-editors
designer
netflix
transformation
shared-hosting
firefox-webextensions
swiftlint
jquery-ajaxq
kudan
zurb-foundation-6
nhapi
neo4j-spatial
nouislider
stormpath
stringtemplate
hybridauth
mapdb
unobtrusive-validation
opshub
grid.mvc
google-closure
ibpy
netcdf4
fault
promela
paxos
snmptrapd
pearson
spring-cache
lync-client-sdk
webdriverjs
chord-diagram
angular-cache
nsfilemanager
qpid
goose
jfugue
execute
thredds
collapse
qdialog
cakephp-3.1
event-bubbling
web-controls
c++03
xc16
elliptic-curve
fluentautomation
android-2.2-froyo
centos5
flexmojos
.aspxauth
dir
inbox
odata4j
dotnetnuke-5
mylyn
android-hardware
cassini-dev
factory-method
manchester-syntax
parametric-equations
winbugs14
imac
dmx512
phonon
zend-decorators
post-build
windows-live-messenger

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App