Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 3.3

COLUMN

Control Panels

Combine Both Libraries

Issue: 3.3 (January/February 2005)
Author: Joe Nastasi
Author Bio: Joe Nastasi is the president of Pyramid Design, a software development firm and the developers of A-OK! Spacecraft Simulation System and FTP Suite.
Article Description: No description available.
Article Length (in bytes): 6,618
Starting Page Number: 38
Article Number: 3318
Related Link(s): None

Excerpt of article text...

Not the OS variety of control panels, but real ones! If you've ever taken even a brief look at flight or car simulators recently, you've had to notice the amazing control panels and cockpit consoles these programs have. Guess what? They are done using 3D technology! Yes, it's 2D (most of the time), but using 3D has quite a few advantages that regular graphics methods do not.

During the process of creating a panel engine prototype for A-OK! Spacecraft Simulation System, now in development, I tried various methods of drawing controls on the screen. The original method used in A-OK! The Wings of Mercury utilized separate canvases. This worked, but only because the drawing involved was simple. There was only one picture for the background and either a drawn black line for a gauge needle or additional graphics for light indicators or switch positions. In A-OK! SSS, the bar has been raised considerably. First, transparency will be mask-based, not the simple white = clear option that is available for images. Second, I wanted to use images for gauge needles instead of simple solid lines. Finally, I needed to support image layers. Most gauges require at least three: a background, a needle image, and a cover plate. Some instruments, like an attitude indicator (the round thing with a little plane and a brown section for land and blue for sky) require four or more images.

I dismissed the separate canvas idea right away. Since the panel engine draws its panel items based on information supplied from a definition file, I did not need the convenience of being able to visually layout a panel in the REALbasic IDE. Additionally, I did not like the idea of having to have one of each panel item type in a window because REALbasic cannot create control objects from scratch -- only clone them.

I built a prototype that drew directly to a window's background graphics object. That worked very well until I had three or more instruments. At that point, things started to slow down considerably. Even bypassing Quartz by setting UseOldRendering to True didn't help much.

...End of Excerpt. Please purchase the magazine to read the full article.