First thing first, I do not create here the minimap through a 'view' since it drains some fps in my map, but it should not be too much of a difference.
We begin with the needed panels for the landmarks and an arrow for the player (what you already have but oh well):
PANEL* Minimap_pan =
{
pos_x = 0;
pos_y = 0;
bmap = "InterfaceMinimap.png";
layer = 2;
flags = SHOW | OUTLINE;
}
// this icon = 16 by 16, placing it at 56 allows it to appear //exactly at the middle of the minimap if your minimap is 128*128
//, otherwise change the pos_x and pos_y here
PANEL* Minimap_player_pan =
{
pos_x = 56;
pos_y = 56;
bmap = "InterfaceMinimapPlayer.bmp";
layer = 4;
flags = SHOW | OVERLAY;
center_x = 8; // set the rotation center at the panel center
center_y = 8;
}
// same here, icon of 16 by 16
PANEL* Minimap_cave_pan =
{
pos_x = 56;
pos_y = 0;
bmap = "InterfaceMinimapCave.png";
layer = 3;
flags = SHOW | OVERLAY;
}
In your case you can leave out the Minimap_pan since you use a 'view' for this. Also check if the layers of panels are good for your map. The layers of the panels should be higher than your 'view'. I use a cave here as an example for the landmarks.
Now to your question. You can use VEC_DIST to check if the distance between your player vector and the landmark vector is big enough to position the icon on the border. Else it is placed somewhere within the minimap / 'view'. I take it that the minimap itself does not rotate when the player rotates right? In that case you can do the following (otherwise it gets more complicated). For this example the landmark is in the center north of the map/level. Put the beneath in a while loop but create a vector first (here vector_landmarkCave) that has the position of the landmark in your map/level.
if (player) {
distance = vec_dist(player.x,vector_landmarkCave.x); // calculate distance of player and cave entities
if (distance > 500) { //change this number according to the size and height of your 'view'
Minimap_cave_pan.pos_x = 56; // cave icon here = 16 by 16 pixels, now it is centered on x axis of the minimap
Minimap_cave_pan.pos_y = 0;} // and on the border of the y_axis of the minimap
else {
//check if the x axis in your map is the same line as the pos_x
//on your minimap, otherwise do vector_landmarkCave.y for pos_x and vector_landmarkCave.x for pos_y
Minimap_cave_pan.pos_x = vector_landmarkCave.x / 40; //play a bit with the number 40
Minimap_cave_pan.pos_y = vector_landmarkCave.y / 40;} //play a bit with the number 40
}
Play a bit with the pos_x and pos_y of the Minimap_cave_pan in the else. Add e.g. +16 or -8 to it if needed in your map to get the positions right.
Hope this was clear, if not just fire away.
ps: this might not be the best way but it does work (atleast here it does :P)