Bonsai Posted April 17, 2018 Share Posted April 17, 2018 Hi, is there already a way to make the default gui editboxes transparent? It seems to always have a white background, which doesn't look so good if they are used within a dx environment. If not, then this might be a good way to make the default editboxes usable outside of an actual gui window. @ccw Bonsai Link to comment
Tails Posted April 17, 2018 Share Posted April 17, 2018 (edited) You can set the alpha property with setProperty: local edit = GuiEdit(200, 200, 200, 30, '', false) edit:setProperty('Alpha', 0.5) Edited April 17, 2018 by Tails Link to comment
Bonsai Posted April 18, 2018 Author Share Posted April 18, 2018 20 hours ago, Tails said: You can set the alpha property with setProperty: local edit = GuiEdit(200, 200, 200, 30, '', false) edit:setProperty('Alpha', 0.5) I tried guiSetAlpha( edit, 0 ) already. But this makes everything invisible, not just the white background. So you can't even see the text anymore. Basically only the white background needs to be transparent. Link to comment
xFFrozen Posted April 19, 2018 Share Posted April 19, 2018 (edited) u use a dxDraw interface right? then just create a guiEdit make alpha 0 and draw it with dxDrawText like this: text = guiCreateEdit(0.48, 0.47, 0.12, 0.02, "", true) setElementAlpha(text,0) dxDrawText( guiGetText(text) ,0.48, 0.47, 0.12, 0.02, tocolor(150, 150, 150,250), 1, segoeui, 'left', 'center') but u need 2 eventHandlers for that - need to render (onClientRender) dxDraw and do not need to render guiCreateEdit So create a Event and trigger it once, after remove EventHandler (onClientRender) u need to destroy guiElement Edited April 19, 2018 by xFFrozen Link to comment
Scripting Moderators thisdp Posted April 19, 2018 Scripting Moderators Share Posted April 19, 2018 If you really want a dx lib, I am glad to recommend you my dgs(dx gui framework) Link to comment
Bonsai Posted April 19, 2018 Author Share Posted April 19, 2018 10 hours ago, xFFrozen said: u use a dxDraw interface right? then just create a guiEdit make alpha 0 and draw it with dxDrawText like this: text = guiCreateEdit(0.48, 0.47, 0.12, 0.02, "", true) setElementAlpha(text,0) dxDrawText( guiGetText(text) ,0.48, 0.47, 0.12, 0.02, tocolor(150, 150, 150,250), 1, segoeui, 'left', 'center') but u need 2 eventHandlers for that - need to render (onClientRender) dxDraw and do not need to render guiCreateEdit So create a Event and trigger it once, after remove EventHandler (onClientRender) u need to destroy guiElement I actually tried this some time ago! The fonts sizes didn't match so it looked weird the longer the text in the editbox got. 9 hours ago, thisdp said: If you really want a dx lib, I am glad to recommend you my dgs(dx gui framework) I have actually downloaded and tried this framework some month ago. It seems to work pretty good but I usually don't like to use external resources. I might have to use the default mta gui for now and change it to something more fancy looking later. 2 Link to comment
xFFrozen Posted April 21, 2018 Share Posted April 21, 2018 u can fix the font just figure it out how... Link to comment
Scripting Moderators thisdp Posted May 10, 2018 Scripting Moderators Share Posted May 10, 2018 Now your problem is solved by DGS. If you have DGS, then loadstring(exports.dgs:dgsImportFunction())() edit = dgsCreateEdit(0.3,0.4,0.2,0.05,"test",true) dgsSetProperty(edit,"bgcolor",tocolor(255,255,255,0)) 1 Link to comment
Bonsai Posted May 12, 2018 Author Share Posted May 12, 2018 On 10.5.2018 at 17:44, thisdp said: Now your problem is solved by DGS. If you have DGS, then loadstring(exports.dgs:dgsImportFunction())() edit = dgsCreateEdit(0.3,0.4,0.2,0.05,"test",true) dgsSetProperty(edit,"bgcolor",tocolor(255,255,255,0)) Hey, Thank you! I will try this out! The main reason why I decided to use the default MTA Gui in my Multigamemode is because of the editboxes. If this works good then I can change it so it will probably look much better! 1 Link to comment
Scripting Moderators thisdp Posted May 12, 2018 Scripting Moderators Share Posted May 12, 2018 (edited) 6 hours ago, Bonsai said: Hey, Thank you! I will try this out! The main reason why I decided to use the default MTA Gui in my Multigamemode is because of the editboxes. If this works good then I can change it so it will probably look much better! Thanks for your supports. DGS edit doesn't supports arabic read style, but it will be added soon. Except for this, all things function. Text selection, other language and color and so on Edited May 12, 2018 by thisdp Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now