656697_XNA.inddGreetings. You’ve probably seen our recent free ebook by Charles Petzold called Programming Windows Phone 7, which is available here. That ebook contains three parts: Part I, “The Basics” (Chapters 1-6), Part II, “Silverlight” (Chapters 7-18), and Part III, “XNA” (Chapters 19-24). In case you would like a fully indexed print version of the content in Charles’s ebook, we’ve created two books (for sale) from the one ebook.

Microsoft XNA Framework Edition: Programming Windows Phone 7 contains Part I, “The Basics,” and Part III, “XNA” (renumbered) from the ebook. The resulting book is 430 pages, and its ISBN is 9780735656697.

Please note that this book contains no new content but for the Index and the book’s screenshots are in black and white unlike the ebook’s screenshots, which are in color.

Here are the contents of this book:

TABLE OF CONTENTS

Part I   The Basics

1   Hello, Windows Phone 7

Targeting Windows Phone 7

The Hardware Chassis

Sensors and Services

File | New | Project

A First Silverlight Phone Program

The Standard Silverlight Files

Color Themes

Points and Pixels

The XAP is a ZIP

An XNA Program for the Phone

2   Getting Oriented

Silverlight and Dynamic Layout

Orientation Events

XNA Orientation

Simple Clocks (Very Simple Clocks)

3   An Introduction to Touch

Low-Level Touch Handling in XNA

The XNA Gesture Interface

Low-Level Touch Events in Silverlight

The Manipulation Events

Routed Events

Some Odd Behavior?

4   Bitmaps, Also Known as Textures

XNA Texture Drawing

The Silverlight Image Element

Images Via the Web

Image and ImageSource

Loading Local Bitmaps from Code

Capturing from the Camera

The Phone’s Photo Library

5   Sensors and Services

Accelerometer

A Simple Bubble Level

Geographic Location

Using a Map Service

6   Issues in Application Architecture

Basic Navigation

Passing Data to Pages

Sharing Data Among Pages

Retaining Data across Instances

The Multitasking Ideal

Task Switching on the Phone

Page State

Isolated Storage

XNA Tombstoning and Settings

Testing and Experimentation

Part II   XNA

7   Principles of Movement

The Naïve Approach

A Brief Review of Vectors

Moving Sprites with Vectors

Working with Parametric Equations

Fiddling with the Transfer Function

Scaling the Text

Two Text Rotation Programs

8   Textures and Sprites

The Draw Variants

Another Hello Program?

Driving Around the Block

Movement Along a Polyline

The Elliptical Course

A Generalized Curve Solution

9   Dynamic Textures

The Render Target

Preserving Render Target Contents

Drawing Lines

Manipulating the Pixel Bits

The Geometry of Line Drawing

Modifying Existing Images

10   From Gestures to Transforms

Gestures and Properties

Scale and Rotate

Matrix Transforms

The Pinch Gesture

Flick and Inertia

The Mandelbrot Set

Pan and Zoom

Game Components

Affine and Non-Affine Transforms

11   Touch and Play

More Game Components

The PhingerPaint Canvas

A Little Tour Through SpinPaint

The SpinPaint Code

The Actual Drawing

PhreeCell and a Deck of Cards

The Playing Field

Play and Replay

12   Tilt and Play

3D Vectors

A Better Bubble Visualization

The Graphical Rendition

Follow the Rolling Ball

Navigating a Maze