Welcome to my Programming Blog...

I am currently working on a couple of projects: An original game called "Implosion" which I am porting from Flash to the iPad, and a remake of Q*bert in Python (pygame), as part of the class I am teaching. Please feel free to use the "Labels" (at right) to follow a specific project or theme. If you are one of my Python students, I recommend that you check out the Python thread.

Monday, June 7, 2010

Knowing one's boundaries and reading the writing on the wall...

Oh, boy! A video preview:



The latest two additions (highlighted in the video) are that the selector can't be taken "offscreen" and that text is now appearing with level, doors, and score info. It's not the best font for the job, but that's pretty easy to fix.

I struggled with the font a bit - it was not working the way I wanted it to. The sio2 system uses bitmap fonts. You get a single graphic with all the letters on it in ASCII order, and then it tiles it up and figures out the appropriate segment for each letter in the string you are writing. But when I made a graphic of fonts (using the tool they included), I would get blank fill.

It turns out that I was letting the font-graphic-creation tool choose how big to make the graphic be. I should have remembered that SIO2 (for some reason) only likes square graphics with dimensions that are powers of 2 pixels. (512 x 512 is good for most stuff.) This caused some problems.

The other issue I had was that the text was mighty faint, even when I set the colors all the way to 1.0 for red, green, and blue, as they did in the tutorial. After several hours of frustration, I realized I needed to take a cue from rock and roll - if I turned them up to 10 (or even 11), they now show up brightly.

1 comment:

  1. A note:
    This didn't go quite as smoothly as it seemed at first. When I tried to upload to the iPad, the fonts crashed the program. I soon remembered reading something about sio2 interacting poorly with the png files that Xcode likes to compress. (Lucky I had read that, or I'd be so lost....). Sure enough, a quick google search reminded me to change XCode's Project Settings so that "Compress png files" was disabled, and things worked as they were supposed to.

    ReplyDelete