Since I'm dumb and can't figure it out by myself, I'm asking here. I want markers, that go off-frame to appear on the frame edge. Short explaination:
- I have minimap, which rotates with player AimYaw.
- I have frame containing markers, which has common center with the minimap.
- Frame with markers rotates in opposite direction to player AimYaw, which makes the makers appear in correct position on the minimap.
- Yes, I have clip="1" over markers frame, which prevents them from being displayed beyond minimap egde.
It would be easy to display markers over map edge, if the minimap wasn't rotating. Because the minimap is rotating, the X and Y axes of the markers frame don't match with global X and Y axes.
Image:

As it appears on image, I need some of blue markers be placed in visible spot, over the map edge. If the marker remains inside the minimap square, it hould be left there untouched, as it's placed correctly.
Some of the code where I set markers position:
(part that rotates markers frame along with minimap map yaw is located in other part of script, and it's done automatically)
Code: Select all
// ---------------------------------- //
/** Set custom marker minimap position
*
* @param _Marker The marker to set position
* @param _Minimap The minimap to set marker
* @param _Position Position of the marker in world
* @param _Weight Weight of the marker
* @param _FitToEdge Move the marker to the map edge if its behind it
*/
Void SetMarkerPosition(CMlControl _Marker, CMlMinimap _Minimap, Vec3 _Position, Integer _Weight, Boolean _FitToEdge) {
if (_Marker == Null || _Minimap == Null || G_EnvironmentSize <= 0) return;
declare OutputPosition = <0., 0., _Weight * .1>;
// ---------------------------------- //
// Compute marker position
for (I, 0, 1) {
OutputPosition[I] =
// Substract positions
(_Position[I*2] - _Minimap.WorldPosition[I*2])
// Multiply
* _Minimap.Size[I]
// Adjust border
/ (G_EnvironmentSize / _Minimap.ZoomFactor)
;
if (I == 0) OutputPosition[I] *= -1;
}
// ---------------------------------- //
// Fit marker to the map edge (to be re-worked)
if (_FitToEdge) {
}
// ---------------------------------- //
// Set marker position
_Marker.RelativePosition = OutputPosition;
}
