0

I'm trying to make a simple Zune "game" (it's really an app, but my Zune only supports games) that takes in two integers, which are time intervals, and plays one sound after time1 and plays another sound after time1+time2, and then repeats.I'm using Visual C# 2008 Express with XNA 3.1.

All I really need is two components/containers that allow for specification of time, and one for "play". The purpose of this is for interval training, where one sprints for a certain duration and then rests for another duration, usually 30 seconds of sprinting followed by 90 seconds of resting.

In short, how do make a component that allows for the input of an integer in Visual C#?

Wim Coenen
  • 66,094
  • 13
  • 157
  • 251
  • @user642 I'm not sure what your trying to do here. Do you mean a class instead of a component? That would make more sense in my opinion. Adding this as a GameComponent is a viable option but the class is so simple I really would recommend not doing so. – Darkhydro Mar 03 '11 at 03:37

1 Answers1

0

I believe the Zune SDK doesn't provide a soft input keyboard. See this MSDN Topic:
http://msdn.microsoft.com/en-US/library/dd282502(v=XNAGameStudio.30).aspx?appId=Dev10IDEF1&l=EN-US&k=k(MICROSOFT.XNA.FRAMEWORK.INPUT.KEYBOARD);k(TargetFrameworkMoniker-%22.NETFRAMEWORK&k=VERSION=V4.0%22);k(DevLang-CSHARP)&rd=true

APIs related to input devices not available on Zune, such as Mouse and Keyboard, can be accessed in code running on a Zune device. The X and Y values in MouseState returned on Zune will always be zero. Similarly, checking for keys pressed using Keyboard on Zune will always return keys in an unpressed state. Also, you should not expect an exception when you access the mouse, keyboard, or other unexpected input devices on Zune.

You would have to program your own display, which is relatively easy if you want simple integer input.

  1. Draw a box
  2. When the user "presses" the box, show a grid of boxes with a number drawn on each one
  3. When the user "presses" one of those boxes, draw the corresponding number in the original box

You are obviously recreating some basic controls here ... but that's life when you make a UI framework on the Zune :-)

Joel Martinez
  • 46,929
  • 26
  • 130
  • 185