O'Reilly logo

Expert Delphi by Paweł Głowacki

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building the games main form

In our game, we have a visual grid of tiles. The most natural component to use in this context is the TGridLayout component. Drop it on the main form of our app, change its Name property to GridLayoutTiles, and align it to Client so that it occupies the whole screen of the main form under the toolbar. Now, we can add other visual controls to the grid layout. The size of each item in the grid layout can be controlled with its ItemHeight and ItemWidth properties.

We are going to use the TGlyph component to display bitmaps from our image list in the data module. There is also the TImage component that we could have used, but in this case we would need to load bitmaps directly to every TImage, which is not as effective ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required