Game Dev Show 15 - Building a Windows 10 (or Xbox) Game with Win2D, C# and XAML

Sign in to queue

Description

In this episode of the Game Dev Show, I introduce you to Win2D – a powerful and easy-to-use Open Source library for immediate mode 2D graphics rendering with GPU acceleration. It is available to C# and C++ developers writing Universal apps and games for Windows 10 (UWP) - including Xbox One - and also Windows Runtime apps for Windows & Windows Phone 8.1. It utilizes the power of Direct2D, and integrates seamlessly with XAML and CoreWindow.
 
Win2D (http://microsoft.github.io/Win2D) lets Visual Studio developers tap into hardware accelerated graphics without the need to call low-level DirectX APIs. Win2D is implemented as a layer on top of Direct2D, and supports interop in both directions. In this episode, I show you how to get started with Win2D, then integrate Win2D graphics within a XAML UI canvas, and show you how to draw shapes & primitives.
 
Win2D is a powerful framework for app and 2D game developers alike, come learn how to get started and get involved.
Here is an outline of this episode:
 
[00:00] - Teaser
[00:32] - Recap of the Universal Windows Platform (UWP)
[04:00] - Approaches to build games for Windows 10
[06:56] - Introduction to Win2D graphics library
[07:43] - DEMO - Win2D Examples Gallery
[10:35] - Why use Win2D?
[12:18] - DEMO - Building a game with Win2D
[24:16] - Wrapping-up and reference links
 
Reference Links
 
 
 
Watch the Win2D session from BUILD 2015 with Simon Tao:
Introducing Win2D: DirectX-Powered Drawing in C#
 
Follow Shawn Hargreaves on Twitter, original Win2D creator and key contributor:
 

Embed

Download

The Discussion

  • User profile image
    Vito

    Great video!

    I would like to ask for a bit of help though. I have a problem that I'm dealing with here, while building a 2D game. I'm fairly new to Win2D, only been using it for a month or so, so with that in mind, is there any way to animate a single sprite based on the png stripe image of different positions of the sprite? When my sprite moves forward, I want to use let's say a stripe of 8 graphical positions of that player. I have the Canvas_AnimatedControl up and running and I have loaded the asset in the async createresources method, but I have no clue how to proceed in order to "play" that single animation which I need. I am only able to draw a single "new Rect" based static 2D image.

    Any help would be greatly appreciated! :)

  • User profile image
    ActiveNick

    @Vito: The best place to ask questions and raise issues is on GitHub. This is where the team and other community members are actively helping developers. I encourage you to submit your question there: https://github.com/Microsoft/Win2D/issues.

    In the meantime, the spritesheet demo in the example gallery would be your best bet as to how to animate via spritesheets. The wizard in that sample has two spritesheet-based animations (walking & idle), and there is also a spritesheet for the environment. You can get the source code at https://github.com/Microsoft/Win2D-samples, and this example is in the UAP project (not the shared project).

Add Your 2 Cents