JuanM27 Posted February 7, 2013 Share Posted February 7, 2013 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
Alexs Posted February 7, 2013 Share Posted February 7, 2013 Usa: getCursorPosition isCursorShowing dxDrawImage "onClientRender" --No se si también, pero prueba con "onClientCursorMove" Link to comment
JuanM27 Posted February 7, 2013 Author Share Posted February 7, 2013 Usa: getCursorPosition isCursorShowing dxDrawImage "onClientRender" --No se si también, pero prueba con "onClientCursorMove" gracias, ahora voy a ver si me sale hacerlo, gracias por responder alex Link to comment
JuanM27 Posted February 7, 2013 Author Share Posted February 7, 2013 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
Alexs Posted February 7, 2013 Share Posted February 7, 2013 El problema se da en ambos códigos? Link to comment
Xperia Posted February 7, 2013 Share Posted February 7, 2013 Me parece que es el mismo codigo pero le gusto separlo en 2, porque lo he testeado y solo va junto. Link to comment
JuanM27 Posted February 7, 2013 Author Share Posted February 7, 2013 El problema se da en ambos códigos? lo estoy probando por separado, y solo funciona el evento "onClientCursorMove", el otro por mas que el mouse este activo no muestra la imagen. Link to comment
Alexs Posted February 7, 2013 Share Posted February 7, 2013 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
JuanM27 Posted February 7, 2013 Author Share Posted February 7, 2013 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
Alexs Posted February 7, 2013 Share Posted February 7, 2013 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
JuanM27 Posted February 7, 2013 Author Share Posted February 7, 2013 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
Recommended Posts