Keep Calm on Tumblr

I’ve set up a blog for Keep Calm posters on Tumblr and I will be posting my own creations however I will also be accepting any posters that have been produced with Keep Calm, Keep Calm Pro or Posters.

Keep Calm and Carry On App on Tumblr

Advertisements

Play Time

This morning I was scrolling through iTunes having a look at my top played songs and it occurred to me that iTunes doesn’t actually offer a way of seeing how much time you’ve dedicated to listening to a song or your entire library. My first approach to solving this problem was to make a spreadsheet and type in the length of each song and the play count however after a couple of songs I got bored so came up with a simpler solution.

iTunes stores a list of all your music in an XML file in the iTunes folder so I put together a simple app in Xcode that reads this file (or the user can select one if the iTunes file couldn’t be found) and does all the math for you. Play Time should work on 64-bit Lion fine.

Play Time for Lion (DMG)

Drawing stars with HTML5 Canvas

Update: I’ve since written a slightly different version that can draw n-sided polygons.


I was searching around for some decent HTML5 demos earlier and I noticed that there weren’t any particularly good tutorials or functions for drawing regular stars. Obviously Canvas is fine for drawing polygons and so I was able to produce this very simple function that uses the rotate() function to position the points:

function star(ctx, x, y, r, p, m)
{
    ctx.save();
    ctx.beginPath();
    ctx.translate(x, y);
    ctx.moveTo(0,0-r);
    for (var i = 0; i < p; i++)
    {
        ctx.rotate(Math.PI / p);
        ctx.lineTo(0, 0 - (r*m));
        ctx.rotate(Math.PI / p);
        ctx.lineTo(0, 0 - r);
    }
    ctx.fill();
    ctx.restore();
}

You call the function by using star(canvas, x of center, y of center, radius, number of points, fraction of radius for inset). Here are some examples. To create a five point star, therefore, you call star(ctx, 100, 100, 90, 5, 0.5). Here is an example of what that looks like:

Obviously because the function doesn’t actually set styles or shadows but this isn’t too difficult to implement. Here is a live demo of the star being drawn.

Keep Calm update

I’ve just published a minor update to Keep Calm (free) bringing it up to version 2.3. This update has fixed a couple of bugs and also includes some extra help information because it seems that some users hadn’t worked out how to save, share or set their designs as wallpaper – this can be done by swiping along the bottom menu to reveal the extra options.

I haven’t done much Android development recently as I’ve been becoming increasingly busy with other projects and I have no immediate plans to launch any more Android apps however I will continue to support Keep Calm, Keep Calm Pro and Posters.

This summer, however, I plan to begin working on at least two iOS apps that will be launched by September.

Keep Calm on Google Play