Package horizons :: Package gui :: Package widgets :: Module minimap
[hide private]
[frames] | no frames]

Module minimap

source code

Classes [hide private]
  Minimap
A basic minimap.
  _MinimapImage
Encapsulates handling of fife Image.
Functions [hide private]
 
get_world_to_minimap_ratio(world_dimensions, minimap_dimensions)
Compute the number of pixels of the world needed for one pixel on the minimap.
source code
 
iter_minimap_points(location, world, island_color, water_color, area=None)
Return an iterator over the pixels of a minimap of the given world.
source code
Function Details [hide private]

get_world_to_minimap_ratio(world_dimensions, minimap_dimensions)

source code 

Compute the number of pixels of the world needed for one pixel on the minimap.

Returns a tuple for x and y, in case they differ. Accepts two tuples of (width, height) to compute the ratio on.

iter_minimap_points(location, world, island_color, water_color, area=None)

source code 

Return an iterator over the pixels of a minimap of the given world.

For every pixel, a tuple ((x, y), (r, g, b)) is returned. These are the x and y coordinated and the color of the pixel in RGB.

If `area` is set, it's supposed to be a part of `location`, that is to be returned.