Jump to content

[Busco] DxEdit


Recommended Posts

Esto deberia de funcionar pruebalo y me dices que tal te anda

    editbox = {} 
  
    function getCharacter(character) 
       if enableEdit then 
          table.insert( editbox, character) 
       end 
    end 
     
    function bindkey() 
      table.remove( editbox, # editbox) 
    end 
     
    function onClick(mButton,state,ax,ay) 
       if state == "down" then 
          if isCursorOnElement(posx, posy, ancho, largo) then 
             enableEdit = true 
          else 
             enableEdit = false 
          end 
       end 
    end 
     
    function dxDrawEditBox() 
      local editText = table.concat(editbox,"") 
      dxDrawRectangle(posx, posy, ancho, largo ....) 
      dxDrawText(editText, posx, posy , posx + ancho, posy + largo, ......) 
    end 
     
    bindKey("backspace", "down", bindkey)    
    addEventHandler("onClientCharacter", getRootElement(), getCharacter)     
    addEventHandler("onClientClick",getRootElement(),onClick) 
    addEventHandler("onClientRender", root, dxDrawEditBox) 

Link to comment

tal ves sea por que en el codigo que te di te falta poner en el esta funcion

    function isCursorOnElement(posx, posy, ancho, alto) 
       local x , y, w, h =  screenW * posx, screenH * posy, screenW * ancho, screenH * alto 
       local mx,my = getCursorPosition ()  
       if isCursorShowing() then else mx,my = x, y end 
       local fullx,fully = screenW, screenH 
       cursorx,cursory = mx*fullx,my*fully 
       if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true 
       else return false end 
    end 

Link to comment
  • Recently Browsing   0 members

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