Archives - June 2007
2007.06.24
With the code refactored it was time to implement proper logging of what the framework is doing, rather than dumping everything to stdout. In order to do that I have added a logging utility that will write to file instead. For now it's hardcoded to write to the same logfile no matter where it is instantiated. I may very well modify this so that it can write to multiple files if necessary. For now, though, it gets the job done and makes it easy to see what's going on and where things go wrong.

I gutted all of the previous testing code and random testing assets. So, as of right now the only thing that running the application does is show the FPS count in the upper left hand corner. In order to do that there needs to be a default font. I'm not sure whether I want to include a default font within the source itself instead of relying on an outside file.

Lastly, over the past few days I've been battling with implementing fullscreen mode, which isn't as complicated as you would thing -- but figuring it out sure was a task. There are, apparently, many ways to implement full screen mode, but I opted for doing resolution switching (which seems the most natural). Getting everything to work required a few hacks, though. When switching into fullscreen mode, a "shielding" window is setup to prevent other applications from bringing up their windows or dialog boxes. The first problem here was that the framework's application window was being hidden as well. This was easy to overcome, as you can change the level of the window to be the same as the shielding window and voila, there it is in fullscreen glory... But there was one slight problem: the window still had it's title bar with the close, minimize, and zoom buttons -- that had to go! Unfortunately, you cannot programmatically remove the title bar or border elements from a window when it's already created. So, in order to get around this bordered window problem I simply create a new window by hand without a border, grab the view from the main application window, and place it on top of everything: instant fullscreen with a "window" that takes up the whole screen without a border.

One little problem, though -- when placing a borderless window at 0,0 (top left), the mouse reads its coordinates from that window in the negative range on the y-axis. I suspect this is due to the fact that the main OS X menubar still exists underneath the shielding window, and even though the borderless window lies on top of it, when reading the coordinates of the mouse it takes into account the main menu bar, or its own invisible title bar. In either case, I'll have to find a way to programmatically determine the y-difference and offset the mouse readings.

2007.06.17
I haven't done much work programming-wise since the last update. Because of the fact that the framework is wrapping up save a handful of odds and ends, it was about time I started refactoring the code. So, for now I've been tackling the task of properly commenting the code I've written (code that won't be changing very much) as well as renaming methods that seemed ambiguous and/or didn't lend themselves to be self descriptive.

2007.06.10
Text bubbles are now in the first initial "complete" iteration. Escape sequences are handled properly now--that is, they are parsed out when constructing the size of the box they are contained in, and then properly passed off to the functions that perform the actual requested operation. So far there are only two escape sequences: one to set the color for any type of printing (both text bubbles or regular printing) and one to set the delay between printing characters in a text bubble.

In addition to the escape sequences, I added the ability for a text bubble to show an indicator that there is another page waiting to be read, as well as the ability to show an indicator that the last page is in view. Eye candy is great, so the indicators can either bounce in place, or fade in and out while they are being displayed. The goodness doesn't stop there, though. On top of the indicators I have also added fading capabilities to the text bubble itself as it shows itself on the screen, and then closes after printing is complete.

The text bubbles wouldn't be complete without the ability to easily construct the border information that needs to tag along with it. In order to facilitate this very simple operation, I created a tool. This tool might be a bit of overkill, but it's more reliable and less annoying than making a copy of an existing file and hand typing the values into that file. I named this nifty little application Bubbler.

Most functionality of the framework is in place. I think I may potentially be in a stage where I could construct some small sort of game with it. The tilemap operations are a bit limited, but this is for a reason--as one can only generalize tilemap information so much without wasting time trying to accommdate all the different things one would like to do with them. I am also in the process of researching different type of "maps" that may be useful; for instance, objects with collision instead of simple tiles. This would allow me to have some very nice looking maps.

2007.06.05
My previously attempted solution at properly implementing escape sequences in text bubbles was flawed. In actuality, the colorization of text is enabled in the low level printing method. Actual colorization of text can be achieved in one of two ways: creating a colored texture for the font itself, or using glColor on a "white" colored texture. The escape sequencing for colorization performs a simple glColor operation when needed.

With the lower level colorization in place, I still needed to implement a version that worked for text bubbles. This threw me for a little bit of a spin. Since text bubbles can autosize themselves, or autofit the text for a fixed size, I ran into all sorts of problems. Escape sequences are part of the strings, so I obviously didn't want to include them when calculating the widths. I tried various different approaches until I finally landed on one that worked: when calculating the widths simply strip out the escape sequences. This works fine for dealing with colorization. When processing a text bubble, I just have to make sure that when I pass a string to the basic text printing routine that I always include full escape sequences if they exist. One of the still existing issues is handling text bubble specific escape sequences. Since the lower level printing routines will obviously not handle escape sequences that it doesn't know about, I'll have to do some hacking to make both the text bubbles and lower level routines to play nicely together.

With the basics of escape sequencing in place, there is one slight problem: anti-aliased fonts that are colored white to allow for colorization look terrible when antialiased. I'm going to be looking into this issue to see if it's simply the AA on the given fonts I'm attempting to use.

In addition to these updates, I modified the font format to use fancy plist files, much like the animated sprites. Previously I would generate a .dat file to accompany font texture images. These files would contain offsets for where each character existed in the texture itself. The fact that this data works hand in hand made it a perfect candidate for plisterization!

The next items on the text bubble agenda are implementing time delay escape sequences and visual indication that another page is available to be viewed.
copyright © 2001 - 2010 loomsoft