Gridiron Solitaire #26: Oops
I learned something about myself last week.Several beta testers (who were all using 1440x900) had reported a substantial amount of text clipping in certain areas. In particular, the offseason human GM mini-game screen was causing lots of trouble.
I decided that the only way to fix this was to use a different layout and focus on using one particular type of control (TextBlock), because it scales text automatically when the layout is initially rendered as the window loads. The other controls I was using scale text just fine--after they were initially rendered--but it was the initial rendering pass that was causing the problem.
This doesn't sound complicated, really, but it was labor-intensive. 15 hours of labor, roughly, because that particular screen has a very large number of controls.
I finished on Saturday. I had done some intermediate testing along the way, but not with window scaling after the initial render. The TextBlocks did scale the text on initial render, just as I needed, but the position of the control wasn't scaling properly in relation to the position of the background graphic.
In other words, after 15 hours of work, I had successfully created more problems than I solved. The new layout was worse than the old one.
I had this initial, gut-wrenching moment when I realized how much time I had wasted. It was brutal, really. Then I realized that there was nothing I could do except look at my original layout more carefully and think more clearly about how I could solve the problem.
When I did, I realized that much of the text clipping was occuring because I had tried to minimize control size by barely making them larger than the text they contained. That seems fine, conceptually, but at lower resolutions, an identical font size takes up more space. So I made the controls wider and centered them, which should eliminate much of the clipping.
I also wrote a subroutine to manually adjust font size depending on text length in certain situations. That's a giant pain in the ass, but it's less difficult than trying to manage all the problems the new layout had introduced.
Here's what I learned: sometimes the degree to which a side problem is interesting overwhelms the bigger picture. I was so fascinated by the layout design that I stopped testing to see if it would solve the clipping problem, because I became more interested in solving layout problems in general. That's dumb. It's always about the big picture, or should be, at least.
One other thing I've learned, although I already kind of knew this, is that I like having a list and working through it one item at a time. I was trying to work on three things simultaneously last week--text clipping, new headline code, and new off-season A.I. for ratings changes--and I didn't like it at all. I'm far more comfortable being linear. This isn't good, because being able to handle multiple avenues is faster, but I find it very unsatisfying and stressful to work this way.
It's ironic, because I multi-task to an insane degree with things I'm very familiar with, but I'm still a real novice when it comes to code, and when I'm not familiar with something, linearity is very comforting and usually much more successful.
<< Home