SerweryWłasny serwerDla twórcówForumFAQDokumentacjaBezpieczeństwo
Pobierz launcher
  1. Dokumentacja
  2. Funkcje klienta
  3. guiCreateEdit

Funkcja

guiCreateEdit

Tworzy jednolinijkowe pole tekstowe. Zmiana tekstu wywołuje onClientGUIChanged, Enter onClientGUIAccepted.

Składnia

gui-edit guiCreateEdit(float x, float y, float width, float height, string text, bool relative [, element parent = nil])

Argumenty

xfloat
Pozycja X.
yfloat
Pozycja Y.
widthfloat
Szerokość.
heightfloat
Wysokość.
textstring
Tekst początkowy.
relativebool
Wartości względne.W MTA:SA opcjonalny: bool relative = false
parentelement, opcjonalny = nil
Rodzic.

Różnice względem MTA:SA

  • Argumenty zaznaczone innym kolorem różnią się od MTA:SA.

W MTA:SA

guiCreateEdit(float x, float y, float width, float height, string text, bool relative = false, gui-element parent = nil)

Zwraca

Pole.

Przykład

local edit = guiCreateEdit(20, 20, 260, 30, "", false)
guiEditSetMaxLength(edit, 24)
addEventHandler("onClientGUIAccepted", edit, function()
    outputChatBox("Wpisano: " .. guiGetText(edit))
end, false)

Zobacz też