SET_MINIMAP_COMPONENT_POSITION doesn't re-render every component change automatically

  void SET_MINIMAP_COMPONENT_POSITION(char* name, char* alignX, char* alignY, float posX, float posY, float sizeX, float sizeY);

  -- -- defaults

  SetMinimapComponentPosition('minimap', 'L', 'B', -0.0045, 0.002, 0.150, 0.188888)

  SetMinimapComponentPosition('minimap_mask', 'L', 'B', 0.020, 0.032, 0.111, 0.159)

  SetMinimapComponentPosition('minimap_blur', 'L', 'B', -0.03, 0.022, 0.266, 0.237)

Using the new (June 5th, 2020) SET_MINIMAP_COMPONENT_POSITION native, I’m able to move the minimap around the screen, but it doesn’t automatically re-render the position of the minimap component itself, while it does the minimap_mask and minimap_blur component.

If you run the following code, you will see the _mask and _blur component move in real time and update on the HUD accordingly, while the minimap component will lag behind. I can “force” a re-render of the minimap component by pressing escape and accessing the pause menu, then exiting again.

  local startMinimapX, startMinimapY = -0.0045, 0.002

  local i = 0.001
  while i < 1 do
    startMinimapX = startMinimapX + 0.001
    startMinimapY = startMinimapY - 0.001
    SetMinimapComponentPosition('minimap', 'L', 'B',        startMinimapX, startMinimapY,              0.150, 0.188888)
    SetMinimapComponentPosition('minimap_mask', 'L', 'B',        startMinimapX, startMinimapY,              0.150, 0.188888)
    SetMinimapComponentPosition('minimap_blur', 'L', 'B',   startMinimapX,   startMinimapY,              0.266, 0.237)
    i = i + 0.01
    Wait(100)
  end

Link to native: https://github.com/citizenfx/fivem/commit/c601baf1fb132677cd372559ee9dac09a8977b93#diff-b0833dabc9bb9dd6a09e9f533d088e12

As a workaround, I believe toggling SET_BIGMAP_ACTIVE twice should be re-reading the minimap GFx position.

I also found something similar to this would work:

SetFrontendActive(true)
Wait(0)
SetFrontendActive(false)

Though of course this has more screen effects. Will give the SET_BIGMAP_ACTIVE workaround a try also!

Thanks!

  SetBigmapActive(true, false)
  Wait(0)
  SetBigmapActive(false, false)

The above does indeed work without any (known) unwanted side-effects.

I will leave this issue open for the time being, but feel free to close it if this is an appropriate solution.

Thanks again!