In my app, Musician the text won't show, I know it has to do with the background because the text will appear if there is no background can someone help?
Code:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.White);
spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
if (Menu == true)
{
spriteBatch.DrawString(Arial, "Play to start, Right and Left to change background",
new Vector2(10, 10), Color.Blue, 0, Vector2.Zero, 1, SpriteEffects.None, 1);
}
if (bgchoice == 1)
{
spriteBatch.Draw(bg1, mainFrame, Color.White);
}
if (bgchoice == 2)
{ spriteBatch.Draw(bg2, mainFrame, Color.White);
}
if (bgchoice == 3)
{
spriteBatch.Draw(bg3, mainFrame, Color.White);
}
if (bgchoice == 4)
{
spriteBatch.Draw(bg4, mainFrame, Color.White);
}
if (bgchoice == 5)
{
spriteBatch.Draw(bg5, mainFrame, Color.White);
}
if (bgchoice == 6)
{
spriteBatch.Draw(bg6, mainFrame, Color.White);
}
spriteBatch.End();
base.Draw(gameTime);
}
}
}
__________________
Formally SmileDog.
Note: I prefer to have conversations over Skype, not over PM.
You will be bottom priority if I happen to be talking to a friend/relative.
thx Jorvette!
@TipTup300
Version 0.3 is already like 3 mb... I don't think the memory will allow for that much... But I'll take the request for more.
__________________
Formally SmileDog.
Note: I prefer to have conversations over Skype, not over PM.
You will be bottom priority if I happen to be talking to a friend/relative.
thx Jorvette!
@TipTup300
Version 0.3 is already like 3 mb... I don't think the memory will allow for that much... But I'll take the request for more.
If you really have to put in a switchable background feature, instead of using an abomination of if statements such as what you've got now, load only one background and store it in a class-level variable (aka field), then render it every time in your Draw function.
In my Runaway game, I actually use a switch for it. I guess it's neater than all the if statements, but it gets the job done relatively the same, doesn't it?
_A Few Things_
A) Why isn't this thread been Locked?It's already locked.
J)I am still getting used to C#, thanks for the advice and solution RedSky and Truck.
L)I'm an "if" addict.
__________________
Formally SmileDog.
Note: I prefer to have conversations over Skype, not over PM.
You will be bottom priority if I happen to be talking to a friend/relative.
thx Jorvette!
__________________
Formally SmileDog.
Note: I prefer to have conversations over Skype, not over PM.
You will be bottom priority if I happen to be talking to a friend/relative.
thx Jorvette!