Jump to content

Help. guiCreateEdit


Hugos

Recommended Posts

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)?

Edited by Hugos
Link to comment

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)

 

Edited by salh
  • Like 1
Link to comment

 

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?

Edited by Hugos
Link to comment
12 hours ago, N3xT said:

By the way, using a timer inside a render event is useless because 'onClientRender' event gets triggered everytime GTA renders a new frame.

Only now understood. Thank you for making my life easier and code! ?

Link to comment

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...