aka Blue Posted November 7, 2015 Posted November 7, 2015 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.
starksZ Posted November 7, 2015 Posted November 7, 2015 Usa el de ASuS , Ve al advanced search y escribe dxEdit, Allí lo encontraras.
alex17 Posted November 7, 2015 Posted November 7, 2015 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)
starksZ Posted November 7, 2015 Posted November 7, 2015 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.
alex17 Posted November 8, 2015 Posted November 8, 2015 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
Recommended Posts