var map_ratio[2]; // saves the ratio from real world coordinates to map coordinates
var icon_pos[2]; // where the icon can be placed on the 2d map (screen position)
var map_size[2] = 1024,768;
var terrain_size[2] = 4000,4000;
function map_startup() //upper right quarter of terrain and screen
{
// map_ratio.x = map_size.x / terrain_size.x; //may be backwards
// map_ratio.y = map_size.y / terrain_size.y;
map_ratio.x = terrain_size.x/map_size.x ; //may be backwards
map_ratio.y = terrain_size.y/map_size.y ;
}
function map_CalcIconPos(&_WorldPos)
{
icon_pos.x = _WorldPos[0] / map_ratio.x;// - (map_size.x);
icon_pos.y = _WorldPos[1] / -map_ratio.y;// -(map_size.y );
// (vec_set(player.x) + 2000) / 3.90625 = icon_pos.x;
// (vec_set(player.y) + 2000) / 5.2083 = icon_pos.y;
}
panel player_icon
{
bmap = player_tga;
flags = d3d,refresh,overlay,visible;
layer = 20;
}
function place_player_icon() //places the player icon on the chart
{
if(land_chart.visible == on || land_chart_explored.visible == on)
{
map_CalcIconPos(player.x);
player_icon.pos_x = icon_pos.x;
player_icon.pos_y = icon_pos.y;
player_icon.visible = on;
}
}