Jump to content

help radar plz


Jacobob14

Recommended Posts

como puedo hacer que el texto gire junto con mi radar

mi imagen si rota pero el texto no :(

        
 local function getCameraRotation () 
        px, py, pz, lx, ly, lz = getCameraMatrix() 
        local rotz = 6.2831853071796 - math.atan2 ( ( lx - px ), ( ly - py ) ) % 6.2831853071796 
        local rotx = math.atan2 ( lz - pz, getDistanceBetweenPoints2D ( lx, ly, px, py ) ) 
        --Convert to degrees 
        rotx = math.deg(rotx) 
        rotz = math.deg(rotz)       
        return rotz 
    end 
  
local screenx, screeny = guiGetScreenSize( ); 
local posX = 30; 
local posY = 157; 
-- Make sure it's the right values 
local width = 135; 
local height = 135; 
-- 
local scale = 0.5; 
local texture = dxCreateTexture( 'sattelite.png', 'dxt5', true, 'clamp' ); 
imageWidth, imageHeight = dxGetMaterialSize( texture ); 
  
showPlayerHudComponent( "radar", false ) 
  
addEventHandler("onClientRender",root, 
    function( ) 
    
        local px ,py, pz = getElementPosition( localPlayer ) 
        local mapX = px / ( 6000 / imageWidth ) + ( imageWidth / 2 ) - ( width / scale / 2 ); 
        local mapY = py / ( -6000 / imageHeight ) + ( imageHeight / 2 ) - ( height / scale / 2 ); 
        local cx,cy,cz,tx,ty,tz = getCameraMatrix( ); 
        local rotation = getCameraRotation(); 
  
        dxDrawImageSection( posX, screeny - posY, width, height, mapX, mapY, width / scale, height / scale, texture, rotation, 0, 0, tocolor( 255, 255, 255, 255 ), false ); 
        dxDrawText("...text...", posX, posY+400, width, height, tocolor(253, 0, 0, 255), 0.65, "bankgothic", "left", "top", false, false, true, false, false); 
       
  

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...