Jayceon Posted February 20, 2017 Share Posted February 20, 2017 (edited) Hello. I have a custom F11 map, but i has some problem with "waypoint" create. When i'm click on map, the waypoint makes not in the cursor position, the waypoint has a small offset (left, right, up, down) and this is not good. local screenX, screenY = guiGetScreenSize() local mapTextureSize = 3072 local bigmapMapUnit = mapTextureSize / 6000 local bigmapWidth = screenX - 60 local bigmapHeight = screenY - 60 local bigmapX = 30 local bigmapY = 30 local bigmapCurrentZoom = 1.5 local playerX, playerY, playerZ = 0, 0, 0 -- automatic updating in render function getWorldFromMapPosition(mapX, mapY) -- This function dont work correctly (mapX, mapY = cursor relative X,Y) local worldX = playerX + ((mapX * (((bigmapX + bigmapWidth) / bigmapCurrentZoom) * 2)) - ((bigmapX + bigmapWidth) / bigmapCurrentZoom)) local worldY = playerY - ((mapY * (((bigmapY + bigmapHeight) / bigmapCurrentZoom) * 2)) - ((bigmapY + bigmapHeight) / bigmapCurrentZoom)) return worldX, worldY end function getMapFromWorldPosition(worldX, worldY) local mapX = (bigmapX + bigmapWidth / 2) + ((worldX - playerX) * bigmapCurrentZoom) * bigmapMapUnit local mapY = (bigmapY + bigmapHeight / 2) - ((worldY - playerY) * bigmapCurrentZoom) * bigmapMapUnit return mapX, mapY end Thanks the replies. Edited February 20, 2017 by Jayceon Link to comment
Investor Posted February 20, 2017 Share Posted February 20, 2017 (edited) Is it an issue with 2D display of waypoint on the custom map or the actual 3D position of the blip/marker/whatever? Edited February 20, 2017 by Investor Link to comment
Jayceon Posted February 21, 2017 Author Share Posted February 21, 2017 The 2D display Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now