<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Exploring the TouchPanel API with the Zune HD &amp; XNA 3.1</title>
	<atom:link href="http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/feed" rel="self" type="application/rss+xml" />
	<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31</link>
	<description>IArchitect, IBlog, ILeader</description>
	<lastBuildDate>Fri, 02 Jul 2010 14:23:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chris</title>
		<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/comment-page-1#comment-167</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Mar 2010 17:32:26 +0000</pubDate>
		<guid isPermaLink="false">http://christopherdeweese.com/christopherdeweese.com/blog/post.aspx?id=36295034-6120-4fa2-9059-2229a98b7b5f#comment-167</guid>
		<description>Nope. It was on the list but got bumped way down to the bottom :(</description>
		<content:encoded><![CDATA[<p>Nope. It was on the list but got bumped way down to the bottom <img src='http://christopherdeweese.com/blog2/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josh nespodzany</title>
		<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/comment-page-1#comment-166</link>
		<dc:creator>josh nespodzany</dc:creator>
		<pubDate>Wed, 03 Mar 2010 01:21:49 +0000</pubDate>
		<guid isPermaLink="false">http://christopherdeweese.com/christopherdeweese.com/blog/post.aspx?id=36295034-6120-4fa2-9059-2229a98b7b5f#comment-166</guid>
		<description>Have you had a chance to play with the accelerometer at all?</description>
		<content:encoded><![CDATA[<p>Have you had a chance to play with the accelerometer at all?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Nespodzany</title>
		<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/comment-page-1#comment-165</link>
		<dc:creator>Josh Nespodzany</dc:creator>
		<pubDate>Tue, 02 Mar 2010 13:50:41 +0000</pubDate>
		<guid isPermaLink="false">http://christopherdeweese.com/christopherdeweese.com/blog/post.aspx?id=36295034-6120-4fa2-9059-2229a98b7b5f#comment-165</guid>
		<description>Yes apparently that is how Microsoft set it up  

- &quot;to clean up resources and reload the firmware so that no leaks or possible exploits exist&quot;.

Obviously that is specific to non-Microsoft approved apps.

- josh</description>
		<content:encoded><![CDATA[<p>Yes apparently that is how Microsoft set it up  </p>
<p>- &#8220;to clean up resources and reload the firmware so that no leaks or possible exploits exist&#8221;.</p>
<p>Obviously that is specific to non-Microsoft approved apps.</p>
<p>- josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/comment-page-1#comment-163</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 01 Mar 2010 14:20:30 +0000</pubDate>
		<guid isPermaLink="false">http://christopherdeweese.com/christopherdeweese.com/blog/post.aspx?id=36295034-6120-4fa2-9059-2229a98b7b5f#comment-163</guid>
		<description>Ahhh, yes. It&#039;s been a while but I remember the same thing happening.  Much smoother without the debugger going.

When you click the menu button to exit does your Zune restart?  That is the one thing I couldn&#039;t figure out.</description>
		<content:encoded><![CDATA[<p>Ahhh, yes. It&#8217;s been a while but I remember the same thing happening.  Much smoother without the debugger going.</p>
<p>When you click the menu button to exit does your Zune restart?  That is the one thing I couldn&#8217;t figure out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Nespodzany</title>
		<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/comment-page-1#comment-162</link>
		<dc:creator>Josh Nespodzany</dc:creator>
		<pubDate>Sun, 28 Feb 2010 18:39:46 +0000</pubDate>
		<guid isPermaLink="false">http://christopherdeweese.com/christopherdeweese.com/blog/post.aspx?id=36295034-6120-4fa2-9059-2229a98b7b5f#comment-162</guid>
		<description>Update: Hey ya know what. This actually works fine, for some reason only when it was connected to the computer and in testing mode was it a lil wonky but if I run it from the disconnected zune it runs great.

thanks
josh</description>
		<content:encoded><![CDATA[<p>Update: Hey ya know what. This actually works fine, for some reason only when it was connected to the computer and in testing mode was it a lil wonky but if I run it from the disconnected zune it runs great.</p>
<p>thanks<br />
josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh nespodzany</title>
		<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/comment-page-1#comment-161</link>
		<dc:creator>Josh nespodzany</dc:creator>
		<pubDate>Thu, 25 Feb 2010 14:46:28 +0000</pubDate>
		<guid isPermaLink="false">http://christopherdeweese.com/christopherdeweese.com/blog/post.aspx?id=36295034-6120-4fa2-9059-2229a98b7b5f#comment-161</guid>
		<description>This lesson actually started out by me following one of the lessons from this book http://www.amazon.com/Zune-Development-using-Experts-Voice/dp/1430218614/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1267108720&amp;sr=1-2-spell however when I was done programming it I had realized that it was actually for the zune model prior to the HD and was designed for the TouchPad. Luckily I found your site! Your code pretty much had all I needed to upgrade the code from TouchPad to TouchScreen however...

It dosen&#039;t seems to really follow my touch all that precisely to the point that it almost seems like a random movement when i touch. The Numbers in the string do seem to look accurate. And there are times it dashes about a pixel or so back and forth without me touching at all. 
Heres my code:

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace ZunePadExample
{
    /// 
    /// This is the main type for your game
    /// 
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;
        Texture2D characterTex;
        SpriteFont aldoFont;
        Vector2 characterPosition = new Vector2(120, 160);
        Vector2 characterTexVector;
        float touchPressure;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = &quot;Content&quot;;

            // Frame rate is 30 fps by default for Zune.
            TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);
        }

        /// 
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// 
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
        }

        /// 
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// 
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            characterTex = Content.Load(&quot;character&quot;);
            aldoFont = Content.Load (&quot;Aldo&quot;);
        }

        /// 
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// 
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }

        /// 
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// 
        /// Provides a snapshot of timing values.
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            // TODO: Add your update logic here
            IEnumerator touches = TouchPanel.GetState().GetEnumerator();
            while (touches.MoveNext())
            {
                characterTexVector = touches.Current.Position;
                touchPressure = touches.Current.Pressure;
            }

            base.Update(gameTime);
        }

        /// 
        /// This is called when the game should draw itself.
        /// 
        /// Provides a snapshot of timing values.
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here
            spriteBatch.Begin();
            string currentVector = string.Format(&quot;{0}.{1} : {2}&quot;, characterTexVector.X.ToString(), characterTexVector.Y.ToString(), touchPressure.ToString());
            spriteBatch.DrawString(aldoFont, currentVector, new Vector2(50, 50), Color.Black);
            spriteBatch.Draw(characterTex, characterTexVector, Color.White);
            spriteBatch.End();

            base.Draw(gameTime);
        }
    }
}

thanks for your assistance!
josh</description>
		<content:encoded><![CDATA[<p>This lesson actually started out by me following one of the lessons from this book <a href="http://www.amazon.com/Zune-Development-using-Experts-Voice/dp/1430218614/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1267108720&amp;sr=1-2-spell" rel="nofollow">http://www.amazon.com/Zune-Development-using-Experts-Voice/dp/1430218614/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1267108720&amp;sr=1-2-spell</a> however when I was done programming it I had realized that it was actually for the zune model prior to the HD and was designed for the TouchPad. Luckily I found your site! Your code pretty much had all I needed to upgrade the code from TouchPad to TouchScreen however&#8230;</p>
<p>It dosen&#8217;t seems to really follow my touch all that precisely to the point that it almost seems like a random movement when i touch. The Numbers in the string do seem to look accurate. And there are times it dashes about a pixel or so back and forth without me touching at all.<br />
Heres my code:</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using Microsoft.Xna.Framework;<br />
using Microsoft.Xna.Framework.Audio;<br />
using Microsoft.Xna.Framework.Content;<br />
using Microsoft.Xna.Framework.GamerServices;<br />
using Microsoft.Xna.Framework.Graphics;<br />
using Microsoft.Xna.Framework.Input;<br />
using Microsoft.Xna.Framework.Media;<br />
using Microsoft.Xna.Framework.Net;<br />
using Microsoft.Xna.Framework.Storage;</p>
<p>namespace ZunePadExample<br />
{<br />
    ///<br />
    /// This is the main type for your game<br />
    ///<br />
    public class Game1 : Microsoft.Xna.Framework.Game<br />
    {<br />
        GraphicsDeviceManager graphics;<br />
        SpriteBatch spriteBatch;<br />
        Texture2D characterTex;<br />
        SpriteFont aldoFont;<br />
        Vector2 characterPosition = new Vector2(120, 160);<br />
        Vector2 characterTexVector;<br />
        float touchPressure;</p>
<p>        public Game1()<br />
        {<br />
            graphics = new GraphicsDeviceManager(this);<br />
            Content.RootDirectory = &#8220;Content&#8221;;</p>
<p>            // Frame rate is 30 fps by default for Zune.<br />
            TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);<br />
        }</p>
<p>        ///<br />
        /// Allows the game to perform any initialization it needs to before starting to run.<br />
        /// This is where it can query for any required services and load any non-graphic<br />
        /// related content.  Calling base.Initialize will enumerate through any components<br />
        /// and initialize them as well.<br />
        ///<br />
        protected override void Initialize()<br />
        {<br />
            // TODO: Add your initialization logic here</p>
<p>            base.Initialize();<br />
        }</p>
<p>        ///<br />
        /// LoadContent will be called once per game and is the place to load<br />
        /// all of your content.<br />
        ///<br />
        protected override void LoadContent()<br />
        {<br />
            // Create a new SpriteBatch, which can be used to draw textures.<br />
            spriteBatch = new SpriteBatch(GraphicsDevice);</p>
<p>            // TODO: use this.Content to load your game content here<br />
            characterTex = Content.Load(&#8220;character&#8221;);<br />
            aldoFont = Content.Load (&#8220;Aldo&#8221;);<br />
        }</p>
<p>        ///<br />
        /// UnloadContent will be called once per game and is the place to unload<br />
        /// all content.<br />
        ///<br />
        protected override void UnloadContent()<br />
        {<br />
            // TODO: Unload any non ContentManager content here<br />
        }</p>
<p>        ///<br />
        /// Allows the game to run logic such as updating the world,<br />
        /// checking for collisions, gathering input, and playing audio.<br />
        ///<br />
        /// Provides a snapshot of timing values.<br />
        protected override void Update(GameTime gameTime)<br />
        {<br />
            // Allows the game to exit<br />
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)<br />
                this.Exit();</p>
<p>            // TODO: Add your update logic here<br />
            IEnumerator touches = TouchPanel.GetState().GetEnumerator();<br />
            while (touches.MoveNext())<br />
            {<br />
                characterTexVector = touches.Current.Position;<br />
                touchPressure = touches.Current.Pressure;<br />
            }</p>
<p>            base.Update(gameTime);<br />
        }</p>
<p>        ///<br />
        /// This is called when the game should draw itself.<br />
        ///<br />
        /// Provides a snapshot of timing values.<br />
        protected override void Draw(GameTime gameTime)<br />
        {<br />
            GraphicsDevice.Clear(Color.CornflowerBlue);</p>
<p>            // TODO: Add your drawing code here<br />
            spriteBatch.Begin();<br />
            string currentVector = string.Format(&#8220;{0}.{1} : {2}&#8221;, characterTexVector.X.ToString(), characterTexVector.Y.ToString(), touchPressure.ToString());<br />
            spriteBatch.DrawString(aldoFont, currentVector, new Vector2(50, 50), Color.Black);<br />
            spriteBatch.Draw(characterTex, characterTexVector, Color.White);<br />
            spriteBatch.End();</p>
<p>            base.Draw(gameTime);<br />
        }<br />
    }<br />
}</p>
<p>thanks for your assistance!<br />
josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/comment-page-1#comment-160</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 25 Feb 2010 13:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://christopherdeweese.com/christopherdeweese.com/blog/post.aspx?id=36295034-6120-4fa2-9059-2229a98b7b5f#comment-160</guid>
		<description>Sorry I didn&#039;t include that.  touchPressure was defined as a float at the class level in a private field.

How is it acting crazy?</description>
		<content:encoded><![CDATA[<p>Sorry I didn&#8217;t include that.  touchPressure was defined as a float at the class level in a private field.</p>
<p>How is it acting crazy?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Nespodzany</title>
		<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/comment-page-1#comment-159</link>
		<dc:creator>Josh Nespodzany</dc:creator>
		<pubDate>Thu, 25 Feb 2010 00:53:21 +0000</pubDate>
		<guid isPermaLink="false">http://christopherdeweese.com/christopherdeweese.com/blog/post.aspx?id=36295034-6120-4fa2-9059-2229a98b7b5f#comment-159</guid>
		<description>Hi, sorry for this really really basic question but just started learning XNA for zune coming from an AS3 background.

In your example what type of variable did you set &quot;touchPressure&quot; to be. I tried &quot;float&quot; but it seems to act a bit crazy.

thanks for sharing!
josh</description>
		<content:encoded><![CDATA[<p>Hi, sorry for this really really basic question but just started learning XNA for zune coming from an AS3 background.</p>
<p>In your example what type of variable did you set &#8220;touchPressure&#8221; to be. I tried &#8220;float&#8221; but it seems to act a bit crazy.</p>
<p>thanks for sharing!<br />
josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: November 2009 &#8211; Top Posts &#171; christopherDeweese.com</title>
		<link>http://christopherdeweese.com/blog2/post/exploring-the-touchpanel-api-with-the-zune-hd-xna-31/comment-page-1#comment-6</link>
		<dc:creator>November 2009 &#8211; Top Posts &#171; christopherDeweese.com</dc:creator>
		<pubDate>Fri, 18 Dec 2009 03:44:41 +0000</pubDate>
		<guid isPermaLink="false">http://christopherdeweese.com/christopherdeweese.com/blog/post.aspx?id=36295034-6120-4fa2-9059-2229a98b7b5f#comment-6</guid>
		<description>[...] 4: Exploring the TouchPanel API with the Zune HD – Posted September [...]</description>
		<content:encoded><![CDATA[<p>[...] 4: Exploring the TouchPanel API with the Zune HD – Posted September [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

