I'm following the book Microsoft XNA Game Studio Creators Guide v2. and there is a snippet in the book that is used to return a Rectangle that represents the safe area you can draw without the fear of 'drawing' outside the screen.
Except in my IDE Visual Studio 2010, that method doesn't show up in intellisense and in fact doesn't show up anywhere.
Here is the snippet:
private void UpdateAsteroid(GameTime gameTime)
{
// time between frames
float timeLapse = (float)gameTime.ElapsedGameTime.Milliseconds;
if (move == true)
{ // asteroid centered at the middle of the image
Rectangle safeArea = TitleSafeRegion(rockWidth/2, rockHeight/2);
// asteroid right edge exceeds right window edge
if (rockPosition.X > safeArea.Right){
rockPosition.X = safeArea.Right; // move it back
rockSpeed *= -1.0f; // reverse direction
}
// asteroid left edge precedes the left window edge
else if (rockPosition.X - rockCenter.X < 0){
rockPosition.X = rockCenter.X; // move it back
rockSpeed *= -1.0f; // reverse direction
}
// asteroid within window bounds so update rockPosition
else
rockPosition.X += rockSpeed * timeLapse;
// Scale radians by time between frames so rotation is uniform
// rate on all systems. Cap between 0 & 2PI for full rotation.
const float SCALE = 50.0f;
rockRotation += rockRotationSpeed * timeLapse/SCALE;
rockRotation = rockRotation % (MathHelper.Pi * 2.0f);
}
}