Sign in to follow this  
Hugos

Help. guiCreateEdit

Recommended Posts

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
2 hours ago, #BrosS said:

 guiFocus

Thank, With that sorted out,

Share this post


Link to post
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

Share this post


Link to post
2 hours ago, salh said:

print?

+

Share this post


Link to post

I understand, you need to use the "postGUI"
 

Share this post


Link to post

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

Share this post


Link to post
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! 🧐

Share this post


Link to post

You're welcome.

Share this post


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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.