Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline CARUFO  
#1 Posted : Friday, October 21, 2011 8:17:11 PM(UTC)
CARUFO

Joined: 8/21/2011(UTC)
Posts: 37

Was thanked: 1 time(s) in 1 post(s)
I can clear the screen in XNA with "graphics.GraphicsDevice.Clear", and in the DE ?

Edited by user Friday, October 21, 2011 8:20:04 PM(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Benjamin  
#2 Posted : Friday, October 21, 2011 8:34:24 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Its done automatically, you can just set the background color via ScreenSpace.BackgroundColor.

If you like you can also just call Graphics.Clear, but I am not sure why you would need to do that (e.g. when needing this for render to texture, it is also done there automatically).
Offline CARUFO  
#3 Posted : Friday, October 21, 2011 9:26:15 PM(UTC)
CARUFO

Joined: 8/21/2011(UTC)
Posts: 37

Was thanked: 1 time(s) in 1 post(s)
ScreenSpace don't contains BackgroundColor.

"Its done automatically"
It's not automatically, because when i don't use a BackgroundImage, i saw all Draws since i start the game.
Offline Benjamin  
#4 Posted : Friday, October 21, 2011 9:32:29 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
I forgot we already moved BackgroundColor to Application in v0.9.0, so just use
Code:

Application.BackgroundColor = Color.Black;


You are seeing all your draws since the default BackgroundColor is transparent (thus unused and much faster, especially on mobile devices) because the engine assumes you will draw something in the background layer. For unit tests the background color is always set, in your application you need to set it yourself if you want to use it.

Hope that helps :)
Offline CARUFO  
#5 Posted : Friday, October 21, 2011 9:48:15 PM(UTC)
CARUFO

Joined: 8/21/2011(UTC)
Posts: 37

Was thanked: 1 time(s) in 1 post(s)
Yes, Application.BackgroundColor works.
Thanks
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2022, Yet Another Forum.NET
This page was generated in 0.753 seconds.