Jump to content

DGS


Recommended Posts

  • Scripting Moderators
3 hours ago, Egor_Varaksa said:

I don't understand how to round off certain elements with this. Can you explain?

Hi!
The first step is to use dgsCreateRoundRect function to create a round-rectangle. This function returns a shader that can be used to change the background of any DGS element to a rounded rectangle using dgsSetProperty. I will give you an example:

local button = dgsCreateButton(0.45, 0.45, 0.1, 0.07, "Test Button", true)

local roundRect = dgsCreateRoundRect(30, false, nil, nil, false)
dgsSetProperty (button, "image", roundRect) -- for more info https://wiki.multitheftauto.com/wiki/Dgs-dxbutton#image

2GCia5X.png

The same thing applies to any DGS element. All you need to do is find the background property of the element you wish to change. Each DGS element may have a different name for its background. Here's a list of all DGS properties you can change.

Edited by xLive
Link to comment
42 minutes ago, xLive said:

Hi!
The first step is to use dgsCreateRoundRect function to create a round-rectangle. This function returns a shader that can be used to change the background of any DGS element to a rounded rectangle using dgsSetProperty. I will give you an example:

local button = dgsCreateButton(0.45, 0.45, 0.1, 0.07, "Test Button", true)

local roundRect = dgsCreateRoundRect(30, false, nil, nil, false)
dgsSetProperty (button, "image", roundRect) -- for more info https://wiki.multitheftauto.com/wiki/Dgs-dxbutton#image

2GCia5X.png

The same thing applies to any DGS element. All you need to do is find the background property of the element you wish to change. Each DGS element may have a different name for its background. Here's a list of all DGS properties you can change.

Thanks!

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