Jump to content

  • Log In with Google      Sign In   
  • Create Account


GameComponent vs DrawableGameComponent... thoughts?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 IcedCrow   Members   -  Reputation: 260

Like
0Likes
Like

Posted 16 July 2013 - 07:14 PM

XNA has two seperate component objects I've run into.  I've been for my 2D games just using GameComponent and that was mainly to represent different screens.  (title screen, main screen, end screen, etc)

 

I note that we also have a DrawableGameComponent.  

My question is ... what's the difference in the two?


For more on my wargaming title check out my dev blog at http://baelsoubliette.wordpress.com/

Sponsor:

#2 Tarika   Members   -  Reputation: 481

Like
0Likes
Like

Posted 17 July 2013 - 12:10 AM

Tip, in visual studio when you see a class that looks unfamiliar, type it out into the code editor then right click and choose "Go To Definition" or click on the text and press F12. This will take you to a window that shows how the class is seen by reflection.

 

dgc.jpg

 

In this case you can see the DrawableGameComponent class inherits the GameComponent class, and the IDrawable interface. So basically it's a derivative of the GameComponent class that implements methods found in IDrawable including the Draw method. This however doesn't meant it's the only one you can use, in fact you could write your own version of DrawableGameComponent that includes your own set of methods, the XNA team created this class as a prefabricated example of how to make a customized GameComponent smile.png

 

Aimee


Edited by AmzBee, 17 July 2013 - 12:11 AM.

We are now on Tumblr, so please come and check out our site! 

 

http://xpod-games.com


#3 IcedCrow   Members   -  Reputation: 260

Like
0Likes
Like

Posted 17 July 2013 - 06:24 AM

Ah good to know.  I knew about the definition I just didn't think to go look at it to see what it implemented. 

Awesome.


For more on my wargaming title check out my dev blog at http://baelsoubliette.wordpress.com/




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS