Jump to content

Pregunta sobre Cursor (Mouse)


JuanM27

Recommended Posts

hola quiera saber como puedo poner un cursor custom,

eh visto varios servidores mta que usan un efecto en el mouse,

busque en el wiki sobre "mouse" y como "Cursor"

pero no encontre nada relacionado a lo que yo ando buscando...

no pido que me den un script o ejemplo, simplemente pregunto sobre que funciones y / o eventos se usan para lograr esos efectos o remplazar el cursor.

saludos

Link to comment

bueno tengo un pequeño problema....

logre hacer que se ponga una imagen y se mueva con el mouse..

addEventHandler( "onClientRender", root, 
    function() 
        if isCursorShowing() then 
            
          local screenx, screeny, worldx, worldy = getCursorPosition() 
               dxDrawImage ( worldx, worldy, 15, 15, "cursor.png",0, 0, 0,tocolor( 255, 0, 0, 255 ),false) 
           
        end 
    end 
) 

addEventHandler( "onClientCursorMove", getRootElement( ), 
    function ( _, _, x, y ) 
     if isCursorShowing() then 
        dxDrawImage ( x, y, 15, 15, "cursor.png",0, 0, 0,tocolor( 255, 0, 0, 255 ),false) 
        end 
    end 
) 

el problema que tengo es que cuando el mouse se queda quieto la imagen desaparece y solo se muestra cuando se mueve el mouse...

como tendria que hacer para que la imagen siempre este visible cuando el isCursorShowing sea True?

Link to comment
addEventHandler( "onClientRender", root, 
    function() 
        if isCursorShowing() then 
            
          local screenx, screeny, worldx, worldy, worldz = getCursorPosition() 
               dxDrawImage ( screenx, screenyx, 16, 16, "cursor.png",0, 0, 0,tocolor( 255, 0, 0, 255 ),false) 
           
        end 
    end 
) 

Link to comment
addEventHandler( "onClientRender", root, 
    function() 
        if isCursorShowing() then 
            
          local screenx, screeny, worldx, worldy, worldz = getCursorPosition() 
               dxDrawImage ( screenx, screenyx, 16, 16, "cursor.png",0, 0, 0,tocolor( 255, 0, 0, 255 ),false) 
           
        end 
    end 
) 

sigue sin funcionar.

Link to comment

Error en el debug?

Intenta:

local w, h = guiGetScreenSize () 
addEventHandler( "onClientRender", root, 
    function() 
        if isCursorShowing() then 
          local screenx, screeny, worldx, worldy, worldz = getCursorPosition() 
               dxDrawImage ( screenx*w, screeny*h, 16, 16, "cursor.png",0, 0, 0,tocolor( 255, 0, 0, 255 ),true) 
           
        end 
    end 
) 
  

Link to comment
Error en el debug?

Intenta:

local w, h = guiGetScreenSize () 
addEventHandler( "onClientRender", root, 
    function() 
        if isCursorShowing() then 
          local screenx, screeny, worldx, worldy, worldz = getCursorPosition() 
               dxDrawImage ( screenx*w, screeny*h, 16, 16, "cursor.png",0, 0, 0,tocolor( 255, 0, 0, 255 ),true) 
           
        end 
    end 
) 
  

Perfecto Alex, Muchas gracias. anda joya..

por lo que vi es que le faltaba el guiGetScreenSize

y bueno sobre tu pregunta... (ya no tiene sentido responder) pero igual te respondo..

en dubugscript no tiraba ningun error.

pero asi anda joya, y bueno gracias de nuevo.

Link to comment
  • Recently Browsing   0 members

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