Game Development Reference
In-Depth Information
public static void UpdateScoreTile(int score)
{
}
This will allow us to easily set the tile from our game using a single line of code.
Once that is done, we need to retrieve the template xml definition for the type of
tile we want. There are many tile types available, and a full list can be found at ht-
tp://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx .
We do this with a call to GetTemplateContent , which is a static method sitting
inside Windows.UI.Notifications.TileUpdateManager . This method takes
an enumeration named TileTemplateType , which provides quick access to the
many different tile types specified in the aforementioned link. In our case we want
to use TileSquareText01 , which provides us with a square tile that has a larger
heading line, and then three text lines underneath. We will use these lines in the fol-
lowing manner:
1. Game name.
2. Score:.
3. The player's score.
This method will provide us with an XML object that we can manipulate to insert our
desired values, which we will then provide to the update method that will do the rest
for us.
Here is an example of the template XML generated by GetTemplateContent :
<tile>
<visual>
<binding template="TileSquareText01">
<text id="1">Text Field 1</text>
<text id="2">Text Field 2</text>
<text id="3">Text Field 3</text>
<text id="4">Text Field 4</text>
</binding>
Search WWH ::




Custom Search