Hugos
-
Posts
172 -
Joined
-
Last visited
Posts posted by Hugos
-
-
2 hours ago, salh said:
print?
+
-
3 hours ago, salh said:
use
guiGetText?
--try this local screenWidth, screenHeight = guiGetScreenSize ( ) editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "", true ) function salh() dxDrawText ( guiGetText(editBox),44, 41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.0, "pricedown" ) end addEventHandler ( "onClientRender", root, salh)
Thank! Text is not displayed. Added timer:
setTimer ( function() dxDrawText ( guiGetText(editBox),44, 41, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1.0, "pricedown" ) end, 1, 0 )
I already have one function (displays "dxDrawRectangle", "dxDrawText"). How to print "function salh ()" over?
-
2 hours ago, #BrosS said:
guiFocus
Thank, With that sorted out,
-
2 hours ago, MRmihailZH said:
Hi, sorry for bad english.
I have a question about DGS.
I create a window in which I create a button (buttonWindow) and add an event to it, but the function works even if you clicked on the window (wnd).wnd = dgsCreateWindow (...) buttonWindow = dgsCreateButton (...,wnd) addEventHandler ("onDgsMouseClick", buttonWindow, buttonWindowFunction) function buttonWindowFunction () ... end
How can I fix this?
Thank you in advance!Didn't understand the code a bit, but try so!
function button() buttonWindow = dgsCreateButton() addEventHandler("onDgsMouseClick", buttonWindow, buttonWindowFunction) end addEventHandler("onClientResourceStart", root, button) function buttonWindowFunction() dgsCreateWindow() end
write the required parameters in parentheses:
-
9 hours ago, Hugos said:
Help. I need to create a "guiCreateEdit", focus on it (so that you can enter text immediately) and make it transparent. How?
With that sorted out, i found my mistakes. There is such a question:
How do I display text (guiGetText) on the screen when the user enters text in "guiCreateEdit" (in real time)? -
Help. I need to create a "guiCreateEdit", focus on it (so that you can enter text immediately) and make it transparent. How?
-
33 minutes ago, DNL291 said:
"backspace" only works for the "onClientKey" event, my bad.
In this case, add this event for the "backspace" key and it should work.
Thank!
-
2 hours ago, IIYAMA said:
see this example with vehicle:
how to tilt it?
-
Tell me if you can create a camera and fix it over the player + tilt 90 degrees to get a top view. (as in gta 2)
-
40 minutes ago, salh said:
use this:
id = guiCreateEdit(414, 226, 353, 90, "", false) guiSetAlpha(id, 0.00) addEventHandler("onClientRender", root, function() dxDrawRectangle(412, 223, 365, 98, tocolor(7, 39, 0, 121), false) dxDrawText(guiGetText(id), 411, 224, 777, 316, tocolor(255, 255, 255, 255), 2.00, "default", "center", "center", false, false, false, false, false) end )
It not suitable)
-
Just now, salh said:
becose the onClientCharacter hes job get the key
not make action for hem
if you want backspace you need make new function for new action
?
-
34 minutes ago, DNL291 said:
local text = "" addEventHandler( "onClientCharacter", root, function ( character ) if character == "backspace" then text = text:sub( 1, -2 ) else text = text .. character end end )
I don't know why, but "backspace" doesn't work. (For example, if you change the character to y, q, d, f or s - works)
-
8 hours ago, salh said:
local text = "" addEventHandler( "onClientCharacter", root, function ( character ) text = text .. character end ) addEventHandler("onClientRender", root, function() dxDrawText(text, 398, 71, 817, 192, tocolor(255, 255, 255, 255), 2.00, "default", "center", "center", false, false, false, false, false) end )
Thank!
-
20 hours ago, DNL291 said:
Example:
local text = "" addEventHandler( "onClientCharacter", root, function ( character ) text = text .. character end )
can the resulting text be output to "DxDrawText"? If so, then how to do it?
(Can be example on opportunities?
) -
19 minutes ago, salh said:
"new function"
?
-
1 minute ago, salh said:
yes its possible
you can make new function for this
What function?
-
11 hours ago, DNL291 said:
Example:
local text = "" addEventHandler( "onClientCharacter", root, function ( character ) text = text .. character end )
Is it possible to delete the last character when clicking on "backspace"?
-
10 hours ago, DNL291 said:
Example:
local text = "" addEventHandler( "onClientCharacter", root, function ( character ) text = text .. character end )
Thank!
-
-
You must set a variable with this function: The user enters the characters on the keyboard and they are shown with one line on the screen.
How can this be done?
(A variable is a string of text)
-
12 minutes ago, salh said:
why you make this local
salh = guiCreateLabel(453, 0, 476, 78, character, false) -- this is gui you can use local ut not Necessary
The text is displayed not in a string, but in a single character on top of another. What to do?
-
+ The text is displayed not in a string, but in a single character on top of another
-
1 hour ago, salh said:
-- gui Button = guiCreateStaticImage(250, 250, 250, 30, "gfx/Button.png", false) function outputPressedCharacter(character) if character==" " then --if the character is a space character = "space" --change 'character' to 'space' end setTimer( function() guiSetText(salh, "") end, 100, 1 ) salh = guiCreateLabel(453, 0, 476, 78, character, false) end addEventHandler("onClientGUIClick", root, function () if source == Button then addEventHandler("onClientCharacter", getRootElement(), outputPressedCharacter) end end)
thsi code make the text show
this*
this script does not work. (Show black display)
1 hour ago, salh said:-- gui Button = guiCreateStaticImage(250, 250, 250, 30, "gfx/Button.png", false) function outputPressedCharacter(character) if character==" " then --if the character is a space character = "space" --change 'character' to 'space' end setTimer ( function() guiSetText(salh, "") end, 100, 1 ) salh = guiCreateLabel(453, 0, 476, 78, character, false) end addEventHandler("onClientGUIClick", root, function () if source == Button then addEventHandler("onClientCharacter", getRootElement(), outputPressedCharacter) end end)
thsi code make the text show
this*
Understood. Find errors.
Necessary:local salh = guiCreateLabel(453, 0, 476, 78, character, false)
instead "salh = guiCreateLabel(453, 0, 476, 78, character, false)" and must be before "guiSetText(salh, "")"
-
2 hours ago, salh said:
ok this show the text
?
Help. guiCreateEdit
in Scripting
Posted
I understand, you need to use the "postGUI"