Jump to content

[Busco] DxEdit


Recommended Posts

Posted

Bueno, estoy creando un panel de logueo y querría saber si alguien me podría aportar un dxedit para él ya que estuve intentando hacer combinaciones entre guiEdit y dx pero nada, queda fatal.

Gracias.

Posted

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) 

Posted

Por que no te sirvió?, Podrías postear el codigo para ayudarte un poco mejor?.

PD:También puedes crear un guiEdit con posiciones relativas y el alpha a 0 y solo cuando se de click al dxEdit este sea visible.

Posted

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 

  • Recently Browsing   0 members

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