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

Module minimap

source code

Classes [hide private]
  Minimap
A basic minimap.
  _MinimapTransform
  _MinimapImage
Encapsulates handling of fife Image.
Functions [hide private]
 
get_minimap_color(world_coords, world, island_color, water_color)
Return the color that the minimap would have for given world coordinates
source code
 
iter_minimap_points_colors(location, world, island_color, water_color)
Return an iterator over the pixels of a minimap of the given world.
source code
Function Details [hide private]

get_minimap_color(world_coords, world, island_color, water_color)

source code 

Return the color that the minimap would have for given world coordinates

The color is a (r, g, b) tuple. The world_coords should be a (x, y) tuple of integer coordinates, giving the location on the real_world map.

If you only have the minimap coords you have to use _MinimapTransform.minimap_to_world() first

island_color is the color used for unclaimed parts of islands

iter_minimap_points_colors(location, world, island_color, water_color)

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.

This function is not used anymore in the in-game minimap, but it is necessary for the minimap preview.