Hello!
I'm trying to draw a background in one of my menus(which I have done the same way before) and it just doesn't work.
I've tried to restart Visual studio without help.
In my class, I have created these:
In LoadContent:
In my draw:
Now, I'm getting these errors:
Error 1:
The best overloaded method match for 'Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(Microsoft.Xna.Framework.Graphics.Texture2D, Microsoft.Xna.Framework.Rectangle, Microsoft.Xna.Framework.Color)' has some invalid arguments'
Error 2:
Argument 1: cannot convert from 'Microsoft.Xna.Framework.Graphics.Texture' to 'Microsoft.Xna.Framework.Graphics.Texture2D'
I have no idea what's wrong since it should work! Thanks in advance
I'm trying to draw a background in one of my menus(which I have done the same way before) and it just doesn't work.
I've tried to restart Visual studio without help.
In my class, I have created these:
Texture BackgroundTexture; Rectangle BackgroundRectangle;
In LoadContent:
BackgroundTexture = Content.Load<Texture2D>("Inventory/InventoryBackground");
BackgroundRectangle = new Rectangle(0, 0, ScreenWidth, 432);
In my draw:
spriteBatch.Draw(BackgroundTexture, BackgroundRectangle, Color.White);
Now, I'm getting these errors:
Error 1:
The best overloaded method match for 'Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(Microsoft.Xna.Framework.Graphics.Texture2D, Microsoft.Xna.Framework.Rectangle, Microsoft.Xna.Framework.Color)' has some invalid arguments'
Error 2:
Argument 1: cannot convert from 'Microsoft.Xna.Framework.Graphics.Texture' to 'Microsoft.Xna.Framework.Graphics.Texture2D'
I have no idea what's wrong since it should work! Thanks in advance