Jump to content

Gui Editbox


holuzs

Recommended Posts

Render:

dxDrawText(guiGetText(username), panelX+56, panelY+127, panelSize[1]*0.25, 30, tocolor(255, 255, 255, 255), 1, fontbold, "left", "top", false, false, true, true)
    if not showPassword then
        dxDrawText(string.rep("*", string.len(guiGetText(password))), panelX+56, panelY+167, panelSize[1]*0.25, 30, tocolor(255, 255, 255, 255), 1, fontbold, "left", "top", false, false, true, true)
    else
        dxDrawText(guiGetText(password), panelX+56, panelY+167, panelSize[1]*0.25, 30, tocolor(255, 255, 255, 255), 1, fontbold, "left", "top", false, false, true, true)
    end

 

Editbox:

function loadGuis(state)
    if state=="login" then
        username = guiCreateEdit(panelX+13+35, panelY+120, panelSize[1]-65, 35, "", false)
        password = guiCreateEdit(panelX+13+35, panelY+160, panelSize[1]-65, 35, "", false)
        guiSetAlpha(username, 0)
        guiSetAlpha(password, 0)
        guiEditSetMaxLength(username, 24)
        guiEditSetMaxLength(password, 24)
    elseif state=="charCreate" then
        usernameCharCreate = guiCreateEdit(panelX+306, panelY+105, panelSize[1]*0.82, 40, "", false)
        passwordCharCreate = guiCreateEdit(panelX+306, panelY+185, panelSize[1]*0.82, 40, "", false)
        guiSetAlpha(usernameCharCreate, 0)
        guiSetAlpha(passwordCharCreate, 0)
        guiEditSetMaxLength(usernameCharCreate, 24)
        guiEditSetMaxLength(passwordCharCreate, 24)
    end
end

 

Link to post

Create the editbox outside of the screen, and if you click on the background of the editbox (dxDrawRectangle zone), select the editbox what you created outside of the screen.

 

Hungarian:

Hozd létre az editboxot képernyőn kívül, és ha az editbox dxDrawRectangle hátterére kattint, akkor jelöld ki a gui editboxot, amit létrehoztál képernyőn kívül.

 

 

-- This example creates an edit box and sets the input focus so the player does not have to click before typing:

local editBox = guiCreateEdit( 1.1, 0, 0.1, 0.1, "", true )
guiBringToFront( editBox )
guiEditSetCaretIndex( editBox, 1 )

 

Edited by Patrick2562
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...