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

How to add a start (splash) screen in XNA 4.0?
My program is being reported as a high-level security threat by AVG?
How to add an end screen in XNA 4.0?
Texture2D is way oversized in XNA 4.0?
How to set xna's TextureFilter to Point
Why doesnt my xna pixel shader turn this texture blue?
How to calibrate kinect skeleton data to video feed?
XNA game studio4.0 using c#
How to add collision detection in a 2D car game in XNA?
Texturing a terrain causes Windows Phone to crash (without an exception) or Models are not drawn afterwards
compiling and deploy window mobile phone platform games into xbox360 game platform with XNA 4.0
'Expected class, delegate, enum, interface,or struct' in XNA 4.0?
Having errors running JigLibX 0.3.1 on XNA 4.0
How to remove splash screen?
Layouting a row of bricks on the wall in XNA 4
Xbox 360 XNA HLS Streaming

Categories

HOME
pandas
xamarin
wso2
netsuite
zeromq
deezer
mockito
dictionary
react-virtualized
vmware
tesseract
maven-3
amortized-analysis
amazon-ecs
youtube-api-v3
enterprise-library-5
opengl-es-2.0
reveal.js
u-sql
zebra-printers
circuit
tostring
pc
finite-automata
serilog
http-status-code-504
google-pagespeed
mps
java-7
angular2-aot
h2db
facebook-access-token
replaceall
atlassian-crucible
windowbuilder
subdomains
twilio-api
titanium-mobile
commit
mmenu
bytecode-manipulation
http-digest
main
dosbox
restlet
dartium
gesture
ssjs
webdriver-manager
optix
texmaker
node-gyp
nand2tetris
.net-4.6.2
thin
sas-jmp
azure-application-gateway
dropbox-php
nstextview
feeds
lift-json
np-complete
mako
flutterwave
spring-mongodb
vtigercrm
smart-table
watchconnectivity
cubes
underscore.js-templating
login-control
lua-5.1
hill-climbing
cloudbees
historian
prerequisites
tmuxinator
iis-arr
android-listview
jsapi
system.reflection
clicktag
c3
cdt
nsbutton
preferences
sgen
yorick
undefined-reference
typo3-neos
jsctypes
dataservice
qt-faststart
pushbackinputstream
enterprisedb
clipper
typoscript2
quickdialog
nsnetservice
rdoc
word-processor
manchester-syntax
errai
onsubmit
objective-c-2.0
bubble-chart
ohm
stage
subgurim-maps
coercion
javax.script
netbeans-7.1
cxxtest
digest-authentication
sproutcore-2
dentrix
mozilla-prism
anti-piracy
scripting-languages

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App