I am quite new to WP7 although have done lot of 2D games before(for BREW/J2ME).
But since in Windows phone we have the flexibility to create User Interface using XAML(through visual studio designer tools by drag/drop).
Is that really recommended or practical? I am asking because even the sample codes (provided here) doesn't have any XAML.
It really depends on your comfortably. Windows Phone 7 application can be made using the following
Silverlight for WP7 (Use this if your game is not very graphically intense)
XNA for WP7 (use this if you want to create a REAL game)
Silverlight and XNA for WP7 (use this if you would rather have all your menus using the easabilty of XAML, but still have all the gaming features XNA has)
The Microsoft provided GamestateManagementExample (http://create.msdn.com/en-US/education/catalog/sample/game_state_management) provides an easy to use alternative to baking some Silverlight into your XNA game. You can customise various options and add/remove screens really simply. You can make it look much more proffesional than using some "sprite" buttons.
Related
One thing I think is important is to give users a consistent look and feel for every page and every app on the Windows phone. I figured out how to do pretty page turns the same way native apps do them, and now I'm trying to figure out how to make all my ListBox items look the same way they do in native apps as well.
For example, when you are in the settings app and you click on an item, the item's text shrinks a little bit while your finger is on it, and when you release the button, the text goes back to normal size and initiates a page navigation.
I can do page navigation. But I want my navigation buttons be exactly the same, not just kinda similar. As a matter of fact, I want my whole app to conform so uniformly to the rest of the OS that the users will think Microsoft built it. Is there a standard library, set of controls, or framework that Microsoft uses that we can have access to? Is there a blog or some other resource devoted to showing us how to mimic Microsoft UI design?
Whilst Silverlight for WP7 makes it easy to create applications that have the same static look as the native apps (email etc...), the Silverlight framework lacks much of the dynamic features, the transitions, animations and other effects. A while back I wrote a Metro In Motion blog series that shows how to mimic the fluid animations that are exhibited by the native applications ...
Metro In Motion Part #1 – Fluid List Animation
Metro In Motion Part #2 – ‘Peel’ Animations
Metro In Motion Part #3 – Flying Titles!
Metro In Motion Part #4 – Tilt Effect
Metro In Motion Part #5 – SandwichFlow
Metro In Motion Part #6 – Rolling List Location Indicator
Metro In Motion Part #7 – Panorama Prettiness and Opacity
Metro In Motion Part #8 – AutoCompleteBox Reveal Animation
Hopefully these will help you achieve the native look and feel you are after.
For example, when you are in the settings app and you click on an item, the item's text shrinks a little bit while your finger is on it, and when you release the button, the text goes back to normal size and initiates a page navigation.
It's TiltEffect that you can use from Silverlight Toolkit
Silverlight for WP7 Toolkit TiltEffect in depth
Some system animation effects you can implement with help of Metro In Motion series
Here is a blog post from the Windows Phone team releasing an icon pack with many commonly used icons in WP7. It should be useful in the quest for UI uniformity.
EDIT:
Here is a list + samples of system text styles you can use.
With XNA and Windows Phone, using Guide.BeginShowKeyboardInput doesn't seem to use the native "tap to correct words" bar.
Is there any way to get it to show up, or is it a current XNA 4.0 limitation on Windows Phone?
From this article:
If your application requires keyboard support, then you should consider Silverlight. Silverlight applications get access to the software keyboard by default, but for games made with XNA Game Studio, developers need to build their own software keyboard control to enable keyboard input.
With XNA, you can only use Guide.BeginShowKeyboardInput, and this doesn't have the functionality you desire.
What are the steps for in planing and developing a Windows Phone 7 application?
First design interface and write code
Expression blend and then VS 2010
First design layout in Photoshop then expression blend and then VS 2010
Write code first in VS 2010 (to achieve main goal) then design interface
What is the correct method?
I typically use a tool like Balsamiq to mock up my UI design
Once I am happy with the UI design, I design and code the entities to support my app
Once the entities are designed, I create ViewModel objects (I use MVVM).
With the ViewModel done, I create the UI for WP7.
Iterate through 1 to 4.
Once I am happy, I then use Blend to prettify the UI (add animations, states, etc).
I need to create a designer for Silverlight in WPF and I’m thinking of a few options
Use a WebBrowser control,
display the content there and
communicate Silverlight using the
JavaScript Bridge. Not sure if this
will be enough for the scenarios I
need to support (see below). This is what KaXaml is doing. SilverlightSpy uses a a more sophisticated WebBrowser control, but I'm not sure how they communicate with Silverlight.
Communicate using Sockets
between the Host and Silverlight.
Host the Silverlight runtime (not in
a browser), but directly using
AgCore.dll. Similar to what sllauncher does for OOB. I imagine
this is what Blend/VS are doing.
Do whatever Blend or VS are doing
which.
I obviously don’t want to go as far as VS and Blend, but I need to support drag and drop of some controls as well as grouping, changing the layout, moving controls in the design surface and obviously updating the Xaml as a result of this actions.
Any ideas, recommendations or pointers on the best way to create a Silverlight Designer in WPF?
SharpDevelop 4 has a WPF based editor for WPF and Silverlight -> http://www.icsharpcode.net/opensource/sd/
Is there a way to get textboxes, labels and other wpf controls in xna that supports margins, etc that flexes for window size?
You might give CeGui a shot.
If your game needs advanced GUI capabilities, CeGui# might just hit the nail on the head for you. Marketese aside, this is a seriously good GUI library with Buttons, ListBoxes, Scrollbars, ProgressBars, Sliders, ComboBoxes and more.
To access the Xna version you'll need to check out the latest copy from the project's SVN and load up CeGui-XNA.sln.
There are other options listed in this thread, but I have no idea how well any of the others work (and it probably isn't a comprehensive list anymore).
The official GUI systems FAQ thread in the XNA Forum:
What GUI systems are there for the XNA framework?
CEGUI# is powerful, but it doesn't support the Xbox 360 (eg. its design doesn't include responding to game pad input) - a major overhaul would be required to refit it to be usable with something else than mouse and keyboard.
Not exactly what you're looking for, but here is an example of getting winforms GUI elements mixed in with XNA 3d content:
http://creators.xna.com/en-US/sample/winforms_series1
Check out SQUID: http://www.ionstar.org/
It's a really clean, fast, and engine independent UI system. I've worked with it extensively and really enjoy using it. The download includes sample code for XNA 3.1, Truevision3D, and SlimDX.
It is possible to embed an XNA game in a WPF form (google: XNA in WPF) if you target only Windows system. You will then have access to all the controls available in XPF for your 2D GUI.
If you also target Xbox 360 or Zune; you must make your own GUI library :(