Jump to content

[REL] dxLib


kikos500

Recommended Posts

Well im presenting a new dx library today it includes the following:

Windows

 createWindow( id, x, y, w, h, color, text)  

Tabs

 createTab(id,x,y,w,h,text,active,parent,bord) 

bord = if u want the tab to be boredered

Edits

 createEdit(id, x, y, w, h, text, parent)  

Checks

 createCheckBox(id,x,y,text,active,parent)  

Buttons

createButton(id,x,y,w,h,text,parent,color,colorh) 

and there is some more things u can edit by using the class

ex button = createButton(...) button.color = {0,0,0,255}

thats all for now

on TODO LIST:

Gridlists (99.999999999%)

download link?

https://community.multitheftauto.com/in ... s&id=13635

  • Like 3
Link to comment

http://imgur.com/a/KAtGU -- screens

file used in screens

  
local screenW, screenH = guiGetScreenSize() 
win = createWindow(1,(screenW - 444) / 2, (screenH - 337) / 2, 444, 337,{0,0,0,150},"test") 
tab1 = createTab(1,9, 58, 109, 35,"Tab 1",true,win,false) 
tab2 = createTab(2,9, 93, 109, 35,"Tab 2",false,win,false) 
button1 = createButton(1,183, 110, 111, 33,"pos",tab1,{0,0,255,150},{0,0,255,255}) 
check = createCheckBox(1,173, 60,"CheckTab2",false,tab2) 
  
function checkfunction() 
    if check.active then 
        outputChatBox("Checkbox: Active") 
    else 
        outputChatBox("Checkbox: Not active") 
    end 
end 
check.func = checkfunction 
  
function button() 
    local x,y,z = getElementPosition(localPlayer) 
    outputChatBox(getPlayerName(localPlayer)..": X = "..x.." Y = "..y.." Z = "..z.."") 
end 
button1.func = button 
  
function curs() 
    if not win.visible then 
        win.visible = true 
        showCursor(true) 
    else 
        win.visible = false 
        showCursor(false) 
    end 
end 
bindKey("f","down",curs) 
  

----------------------

¿How can i get the text of the edit?...

well just use edit.text like

local edit = createEdit(id, x, y, w, h, text, parent)

outputChatBox(edit.text)

---------------

Download the new version some bugs are fixed

https://community.multitheftauto.com/in ... s&id=13635

Link to comment
The

local edit = createEdit(id, x, y, w, h, text, parent) 

Will return a string right?

Can't you add a function like editGetText(edit) to get the text of the edit?

No it returns a table with all the edit data (x,y,w,h,text,parent,color,etc) why should i add such a function while u can use edit.text its the same it will just be a pointless function but if you want it here you go

  
function editGetText(edit) 
        if not edit.text then return nil end 
         return edit.text 
end 
  
function editSetText(edit, text) 
        if not edit.text then return nil end 
        edit.text = text 
end 
  

Link to comment
On 9/1/2016 at 2:45 PM, kikos500 said:

No it returns a table with all the edit data (x,y,w,h,text,parent,color,etc) why should i add such a function while u can use edit.text its the same it will just be a pointless function but if you want it here you go


  
function editGetText(edit) 
        if not edit.text then return nil end 
         return edit.text 
end 
  
function editSetText(edit, text) 
        if not edit.text then return nil end 
        edit.text = text 
end 
  
 

 

Oh ok now I got it.

Link to comment
  • 2 weeks later...
  • 3 weeks later...
  • 2 months later...
  • 4 weeks later...
  • 4 months later...
On 6/14/2017 at 20:11, xMKHx said:

i tried to make a simple Dx Window with exports but i failed, can you just make a simple script, and lemme make make another one base on it

actually i wouldn't recommend this library if u want to create a server use this one its much better 

 

  • Like 1
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...