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

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

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

 

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.