Reference Sheet

 

Drawing a sprite

spriteBatch.Begin(<SpriteBlendMode>);

spriteBatch.Draw(<Background>, <Parent Frame>, <Color>);

spriteBatch.End();

Verify If The Device Is Not An Xbox 360
#if !XBOX

<Your Code Here>

#endif

Button Click Conditional (XBOX)

GamePadState <Name> = GamePad.GetState(<Player Index>);

if (currentState.IsConnected && <Name>.Buttons.<Button Name> == ButtonState.Pressed)
{

<Your Code Here>

}

Button Click Conditional (PC)

KeyboardState <Name> = Keyboard.GetState();

if (<Name>.IsKeyDown(Keys.<Key>))
{

<Your Code Here>
}

Loading Game Content

Content.Load<Content Type>("<Content Folder Path>");
           

Vector Object Positioning

object.<Postion Property> =  new Vector2(X, Y);

Getting Supported Display Modes

GraphicsAdapter

 

.<Adapter Name>.SupportedDisplayModes

 


Select Storage Device
Guide.BeginShowStorageDeviceSelector

Show Friends UI (Xbox 360)
Guide.ShowFriends

Show Gamercard UI
Guide.ShowGamerCard

Accessing Game Profile Information
GamerProfile ProfileName = new GamerProfile();

 

Game Profile Members

ProfileName.GamerPicture

ProfileName.GamerScore

ProfileName.GamerZone

ProfileName.Motto

ProfileName.Region

ProfileName.Reputation

ProfileName.TitlesPlayed

ProfileName.TotalAchievements

 

Accessing Game Window Properties
GameWindow WindowTitle = this.Window;

 

Accessing GameWindow Members

 

WindowTitle.Member = Value;

Check System Power Status

if (PowerStatus.PowerLineStatus == PowerLineStatus.Offline)

{

// Actions if powerline is offline

}

else if (PowerStatus.PowerLineStatus == PowerLineStatus.Online)

{

// Actions if powerline is online

}

else

{

// Actions if powerline status is unknown

}


Exiting The Game
Exit();