Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

GameComponent.Initialize Method

Called when the GameComponent needs to be initialized. Override this method to query for required services and load any non-graphics resources.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Game (in microsoft.xna.framework.game.dll)

public virtual void Initialize ()

If this GameComponent has been added to the Game.Components collection, this method will be called automatically if you call base.Initialize in your Game.Initialize method. Note that the template code created by XNA Game Studio will already have this call to base.Initialize in place.

In classes that derive from Game, it is necessary to call base.Intialize in Game.Initialize, which will automatically enumerate through any game components that have been added to Game.Components and call their Initialize methods.

protected override void Initialize()

Xbox 360, Windows XP SP2, Windows Vista, Zune

Community Additions

© 2015 Microsoft