Old 04-15-2009, 03:10 PM   #1 (permalink)
Member
 
BroiledVictory's Avatar
 
Join Date: Dec 2008
Location: Puyallup, Washington State
Posts: 526
BroiledVictory will become famous soon enough
Send a message via Skype™ to BroiledVictory
Awards Showcase
Biggest Shouter 
Total Awards: 1
Default Text won't show.

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!




BroiledVictory is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old 04-15-2009, 03:17 PM   #2 (permalink)
lost in paradise with rae
Support Team
Moderator
Expert Zuner
 
Red Sky's Avatar
 
Join Date: Nov 2007
Location: Pennsylvania
Posts: 2,661
Red Sky is just really niceRed Sky is just really niceRed Sky is just really nice
Send a message via MSN to Red Sky
Default

It draws in the order you call it. Put draw string after the background stuff.

Basically, the string is being drawn, then the background on top of it.





Red Sky is offline   Reply With Quote
Old 04-16-2009, 09:51 PM   #3 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 808
Tiptup300 has disabled reputation
Default

You should have over 100 different bg images. That would be cool.



Tiptup300 is offline   Reply With Quote
Old 04-18-2009, 12:26 PM   #4 (permalink)
Member
 
BroiledVictory's Avatar
 
Join Date: Dec 2008
Location: Puyallup, Washington State
Posts: 526
BroiledVictory will become famous soon enough
Send a message via Skype™ to BroiledVictory
Awards Showcase
Biggest Shouter 
Total Awards: 1
Default

@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!




BroiledVictory is offline   Reply With Quote
Old 04-18-2009, 11:47 PM   #5 (permalink)
you lost the game.
zB Programmer
Moderator
Elite Zuner
 
itsnotabigtruck's Avatar
 
Join Date: May 2008
Posts: 2,434
itsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud of
Default

Quote:
Originally Posted by SmileDog View Post
@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.
__________________

signature by vettexl




itsnotabigtruck is offline   Reply With Quote
Old 04-19-2009, 09:14 PM   #6 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 808
Tiptup300 has disabled reputation
Default

I personally like his method. ;D



Tiptup300 is offline   Reply With Quote
Old 04-20-2009, 07:11 AM   #7 (permalink)
lost in paradise with rae
Support Team
Moderator
Expert Zuner
 
Red Sky's Avatar
 
Join Date: Nov 2007
Location: Pennsylvania
Posts: 2,661
Red Sky is just really niceRed Sky is just really niceRed Sky is just really nice
Send a message via MSN to Red Sky
Default

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?





Red Sky is offline   Reply With Quote
Old 04-20-2009, 08:39 PM   #8 (permalink)
Member
 
BroiledVictory's Avatar
 
Join Date: Dec 2008
Location: Puyallup, Washington State
Posts: 526
BroiledVictory will become famous soon enough
Send a message via Skype™ to BroiledVictory
Awards Showcase
Biggest Shouter 
Total Awards: 1
Default

_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!




BroiledVictory is offline   Reply With Quote
Old 04-21-2009, 03:43 PM   #9 (permalink)
GETTING AWAY WITH MURDER
Retired Staff
Expert Zuner
 
Bolt's Avatar
 
Join Date: Oct 2008
Location: In your closet, in your head
Posts: 3,258
Bolt is a splendid one to beholdBolt is a splendid one to beholdBolt is a splendid one to beholdBolt is a splendid one to beholdBolt is a splendid one to beholdBolt is a splendid one to behold
Send a message via Yahoo to Bolt
Default

Where does it say it was locked?
__________________



Bolt is offline   Reply With Quote
Old 04-23-2009, 09:05 PM   #10 (permalink)
Member
 
BroiledVictory's Avatar
 
Join Date: Dec 2008
Location: Puyallup, Washington State
Posts: 526
BroiledVictory will become famous soon enough
Send a message via Skype™ to BroiledVictory
Awards Showcase
Biggest Shouter 
Total Awards: 1
Default

I for some reason I don't remember saying the It's already locked part.
__________________
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!




BroiledVictory is offline   Reply With Quote
Reply

Bookmarks

Thread Tools