Reputation: 1549
I'm making a project to Windows Phone using Silverlight + XNA, but I don't know how I can use the DrawableGameComponent
because the constructor requires a Game
class, it looks like this:
Planet.cs
class Planet : DrawableGameComponent
{
public Planet(Game game): base(game){
{
}
but in my first page of Silverlight and XNA project not is a Game
class it's this:
GamePage.xaml.cs
public partial class GamePage : PhoneApplicationPage
{
...
}
Where do I find the Game
class to pass into the DrawableGameComponent
constructor?
Upvotes: 0
Views: 81
Reputation: 4213
Yap, I know, there is no Game
object, or GameComponents
in a combined Silverlight and XNA application.
I've found another implementations of those classes (such as GameComponent
, DrawableGameComponent
, IDrawable
...) on Microsoft XNA Community Game Platform that I use everytime in Silverlight+XNA, but I don't remember where so I can't give you a link. If you can give me your email I'll send them to you, or I can try to paste the whole 7 classes code here if you prefer.
Upvotes: 1