Jump to content

Help. guiCreateEdit


Hugos

Recommended Posts

Posted

Help. I need to create a "guiCreateEdit", focus on it (so that you can enter text immediately) and make it transparent. How?

Говорю на русском. Sorry for bad english.
 

Posted (edited)
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

Говорю на русском. Sorry for bad english.
 

Posted (edited)

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
Posted
On 11/06/2019 at 07:21, Hugos said:

Help. I need to create a "guiCreateEdit", focus on it (so that you can enter text immediately) and make it transparent. How?

guiFocus

من أراد الفشل عليه بالنجاح

Posted (edited)

 

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

Говорю на русском. Sorry for bad english.
 

Posted

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

  • Thanks 1

 

 

Posted
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! ?

Говорю на русском. Sorry for bad english.
 

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