Arsilex Posted August 12, 2012 Share Posted August 12, 2012 function Panel ( ) dxDrawRectangle(1238.0,0.0,128.0,767.0,tocolor(0,0,0,200),true) boton1 = dxDrawImage(1240.0,163.0,126.0,96.0,"Imagenes/Stats.png",0.0,0.0,0.0,tocolor(255,255,255,255),true) boton2 = dxDrawImage(1239.0,1.0,126.0,102.0,"Imagenes/Maps.png",0.0,0.0,0.0,tocolor(255,255,255,255),true) addEventHandler ( "onClientClick", boton2, Mapas1, false ) end function Mapas1() state = ( not state ) removeEventHandler ( "onClientRender", root, maps ) if ( state ) then addEventHandler ( "onClientRender", root, maps ) end end Link to comment
Castillo Posted August 12, 2012 Share Posted August 12, 2012 Tu function es: "Panel", no "maps", ademas, addEventHandler ( "onClientClick", boton2, Mapas1, false ) Tiene que ir fuera de la funcion: "Panel". function Panel ( ) dxDrawRectangle(1238.0,0.0,128.0,767.0,tocolor(0,0,0,200),true) boton1 = dxDrawImage(1240.0,163.0,126.0,96.0,"Imagenes/Stats.png",0.0,0.0,0.0,tocolor(255,255,255,255),true) boton2 = dxDrawImage(1239.0,1.0,126.0,102.0,"Imagenes/Maps.png",0.0,0.0,0.0,tocolor(255,255,255,255),true) end function Mapas1 ( ) state = ( not state ) removeEventHandler ( "onClientRender", root, Panel ) if ( state ) then addEventHandler ( "onClientRender", root, Panel ) end end addEventHandler ( "onClientClick", boton2, Mapas1, false ) Link to comment
Arsilex Posted August 12, 2012 Author Share Posted August 12, 2012 yo lo que quiero es al presionar encima de boton2 osea el Dx ese que se active la funcion Mapas1 Link to comment
Castillo Posted August 12, 2012 Share Posted August 12, 2012 No existen eventos para hacer eso, lo unico que podes es comparar la posicion del cursor con la de la imagen. Link to comment
Recommended Posts