Cocos2d: how to make a label to fit the Iphone screen width

In the iPhone game I’m working on I need to display a different label every time I start a new game level. Each one of these labels has a random string taken from an array of words, and each one of these strings has different size. So every time I create a new label I set the maximum font size and then I decrement it until the string size measures less than the iPhone screen. I do that using the sizeWithFont method of the NSString class:

»
Author's profile picture Andrea Franz

Terror the micro aggregator

Terror is a micro feed aggregator made with sinatra and bundled as a gem. It's very simple to use, just install the gem:

gem sources -a http://gems.github.com
sudo gem install gravityblast-terror

Create a new project

terror new_aggregator_name
cd new_aggregator_name 

Start the server

thin start -C config/thin.yml

Run the feeds fetcher

rake feeds:fetch # run it as a cron job

You can browse the source and fork it on github.

»
Author's profile picture Andrea Franz

Web app theme

A simple theme for web apps. Fork it on github and use it for your cool applications!

Web App Theme

[UPDATE]

Like I wrote in the comments, this layout is inspired from cool applications like lighthouse, basecamp, and others. I love those applications, I love their layouts, and it’s difficult to not be inspired by them.

»
Author's profile picture Andrea Franz

Radiant Gallery on Dreamhost with Ruby 1.8.7

Some people in the past had problems using the Gallery extension on Dreamhost. I didn’t try Dreamhost but someone from the Radiant list solved that problem following these instructions. Check it out if you are on Dreamhost too.

»
Author's profile picture Andrea Franz

Radiant iPhone extension 0.0.1

After some works for iPhone I decided to create an extension for Radiant that adds an iPhone tailored ui for the admin panel. It's the first version and for now it just allows to edit existing pages and add new page parts.

You can find more info in the README file on github.

Radiant iPhone extension

»
Author's profile picture Andrea Franz