TIvorySurface::Mapper

Holds a pointer to a TIvoryMapper component.

__property TIvoryMapper* Mapper;

Description

Use Mapper to specify the mapper component from which the surface reads the tile images.

If you want to draw a map on the surface, you must assign a TIvoryMapper component to the Mapper property. You also need to define the map itself. You can define the map in the Map property, or in the OnGetMap event. I suggest that you use the Map property, because it is faster. To define the map, set up an array of integers where each number refers to an image located in the TIvoryMapper component. Use a negative number to leave a tile empty. Then assign this array of integers to the Map property. Next, specify the MapLeft, MapTop, MapColumns, and the MapRows properties. Finally, set MapEnabled to true.

The surface doesn't redraw the map if you modify the Mapper property. Use Paint to redraw the surface.

Back to TIvorySurface