Random VSLive Day 4 Notes
Set of tools and managed libraries to build games on windows, phone, xbox
Essentially replaces managed direct x and adds some new things
Current version is 4 includes phone developer tools
Cross platform, write once deploy everywhere
Ability to publish to market place
Game studio is free, part of windows visual studio phone tools
If you deploy you need to play 99 for both platforms.
Draw objects to the screen
Screen resolution 480/800
Xna games run at 30 fps no matter what
Games can run in portrait or landscape mode
Allows you to easily import a variety of assets with no code required
Simply drag and drop assets to the content project and they will be built into a custom format compatable with all platforms
Can create your own importer to plug into the pipeline
Content is turned into an xna file that best suited for the platform
Content pipeline is just separate project type in xna
This allows you to create multiple content projects and set references to any all multiple project types
This is easy way to separate assets for the various devices
Your game object has a content property which is used to load content whenever you need it
Content is cached integrally no need to cache
The xna game loops calls the update and draw method frequently
Calls update method on an interval specifies with a defaul of 1/60 of a second, note on the phone this is 30fps so for phone change this value so we don't waste cycles
Draw calls will be slipped if the game starts to lag and update will be called multiple times to catch up
Calls update and draw as fast as possible
Depending in your loops type you need to time your animations properly
With content in the pipeline we
Draw to the screen in the Draw method using spritebatch
Spritebatch draws a batch of sprites to the screen with all require the same art of parameters
The final End() will push everything to the screen
Various Draw overloads which handle scaling, rotation, etc.
Very easy to draw text to the screen
Add a new sprite font to your content application
This will add an XML file to the content project for you to edit
Modify the parameters to define how your font looks
Use SpriteBatch.DrawString() to draw it to the screen
Use SpriteFon.MeasureString() to determine size before drawing
Xna can read from keyboards control pad, or windows phone touch screen
Call methods to retrieve input state during update method, act appropriately.
Simply load from content pipeline and play fire and forget
Supported on all three platforms
Use create instance method to return object you can use to manipulate sound effect dynamically
Used for complex audio with surround effects and custom audio changes.
Remove unnessacary capabilities
Set genre, normal start menu, game Xbox live
As simple as right clicking and choose create copy for Xbox 360
Right click on project and create copy of project for windows
Run and debug like any other windows application
ViewBag and ViewData share the same information
Test controller redirections
Use reflection to make sure correct attributes are on your methods.
Use coded UI tests for validating the UI
Building native app with html5 and jQuery
One em is a scale for the default font size of an element.
No reliance on custom classes
No custom mapping XML files necessary
Convention over configuration
Intuitive fluet API to customize persistence
Latest version is on nuget
Add dell reference and ready to go.
4.1 initial release on code first
4.2 bug fixes for third party providers
CTP EF (not code first specifically)
Auto compiled linq queries
Collections/relationships
DataAnnotations can be used to configure alter the built in conventions.
Attributes are not required for unambiguous types. For stings you need to configure string length for example.
If you want to alter the behavior of the model creation, override the onmodelcreating which allows you to use the fluent API to alter columns max length and other such ways
If you you lots of tables you can break it down to each class for a configuration instead of having it all in onmodelcreating, and then you just need to add the configuration class in that method.
To update you can create the class with the id, attach it to the context, alter the values and then save. Do this for update so you don't cause an unnecessary trip to the database
Alter the IIS recycle time when using an ORM so the context hit is minimized.
Power tool to reverse engineer code first from an existing database.
Optimizing dbcontext, power tools
Repository Pattern, using set of T
Customizing global conventions
Building html5 mvvm with JavaScript
Role of json, the way for data to be used in an HTML5 application.
jQuery Templates, JSRender is the successor to jQuery templates.
HTML templates simplify Ajax applications
Minimizes custom JavaScript
Rich client side interactivity
Dependency tracking via observables
Observable is like INotifyPropertyChange
Bind the view model to the view.
Other Templates, JSRender
Named templates, if you use each it will render the full template
Creating observables is monotonous
Especially from json data from an Ajax call
Converts json to an object with observables
Auto detect when changes occur
Reset the comparison baseline
Binding handlers on a template
Used for custom actions for remove and an add when a template gets called
You can use inline binding
In KO 1.3 you can use jQuery delegate, allow to pass data context
Sometimes in a template you need to change data binding scope