Game Development Reference
In-Depth Information
File Picker Sample - This sample shows how to access files and folders by letting the
user choose them through the file pickers and how to save a file so that the user can spe-
cify the name, file type, and location of a file to save.
Reading and Writing Data Sample - This sample shows how to use the DataReader
and DataWriter classes to store and retrieve data.
Accelerometer Support
While the accelerometer is fully supported in HTML5 games on Windows 8, I personally
find using it a little difficult on larger tablets. It also doesn't make much sense on a tradition-
al computer, which is why I didn't cover it in the chapter on input. However, adding acceler-
ometer support is very easy. Here is some reference material on how to implement it:
Visual Studio Sample
Accelerometer Sensor Sample - This sample shows how to use the Win-
dows.Devices.Sensors.Accelerometer API.
OrientationSensor Sample - This sample shows how to use the Win-
dows.Devices.Sensors.OrientationSensor API. This sample allows the user to view the
rotation matrix and Quaternion values that reflect the current device orientation.
Pen Support
When it comes to pen support, this is also a difficult feature to add in a game that may have
been originally designed for the Web and desktop computers. If you remember back to our
review of the pointer event in touch, you will remember that we can test the input type from
the event. There may be some interesting things you can do when it comes to pen input in
your game. While I wouldn't rule it out, just keep in mind that not many form factors are
shipping with pens, so again, just like with the accelerometer, think about your ROI and if
supporting it is worth the time investment.
Visual Studio Sample
Input: Devices Capabilities Sample - This sample demonstrates how to query the input
devices that are connected to the user's device and support the input modes (pointer,
touch, pen/stylus, mouse, keyboard) of a Windows Store app.
Search WWH ::




Custom Search