Handling Input in XNA / MonoGame

This morning I didn’t have internet access and was trying to find this in my notes (which are also my blog posts), and I couldn’t; so purely for my own benefit, the following is a method of handling touch or mouse input in Monogame: By changing Pressed to Released, you can detect when the mouse […]

Adding and Using a New Font in MonoGame (The 11 Step Program)

This is not an undocumented subject; however, I didn’t find everything I needed in a single place; so this is my single point of reference. The Problem There is currently no facility within MonoGame to create a new Sprite Font. The workaround described below is, to put it mildly, time consuming. Adding a Font Step […]

Handling both Touch and Mouse Input with Monogame

I’ve already posted a few times on handling input for Monogame. This one’s a little bit different though, and came from the fact that I had a game trying to get through certification that was repeatedly failing. What I was doing was detecting touch capabilities and, where I found them, using them; otherwise, using keyboard […]

Detecting Keyboard Gestures Using Monogame

Recently, I got to the stage where I had just about finished one of my games, and suddenly realised that I had done nothing to deal with mouse gestures. Dealing with touch (which I have previously blogged about) can blind you to other input forms. Exactly how you deal with this will, of course, depend […]

Using data binding inside monogame to control ad control display

I’ve already blogged a few times on using monogame with XAML. One thing that occurred to me recently was that I could leverage this in order to better control when the ad control appears in one of my games. Basically, my idea was that I could bind the main game page to a model, which […]

Convert Monogame to Monogame with XAML

Some time ago, I blogged about the importance of creating a “Monogame With XAML” project. Before I’d written this, I’d started a long running project, and realised that I needed XAML (for reasons already indicated). So, is it possible to convert? YES! Is it easy? Actually, it’s not too bad; but to save anyone else […]

Detecting multiple gesture types using Monogame in Windows 8

Gestures in this environment are hard. Ridiculously hard. There is a ReadGesture function, but it doesn’t work. Let’s imagine that you want to detect the following gestures: Tap Double Tap Drag Not exactly complex. We’ll need to know some basic information about each gesture: Tap: where have we tapped Double tap: where have we double […]

Beware: asynchrony with monogame

The async / await keywords allow asynchrony extremely easily in comparison to previous implementations; however, this blog post is a word of caution for those working with monogame or XNA in general. Imagine the following update method: Okay, so this is spot on: where `UpdateMySprites` takes some time, it won’t stall execution… except that it […]

Adding Privacy Statement to Windows 8 Store App Built With Monogame

This has been covered many times on the web, but when using Monogame it isn’t as straightforward (not that it’s rocket science). The key thing is to make sure that when creating the Monogame project, it is created using Monogame and XAML (I’ve blogged about this previously here). In App.xaml.cs, add the following function to […]