DgsCreate3DImage: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} This function creates a 3d image in the world ( such as nametag ). ==Syntax== <syntaxhighlight lang="lua"> element dgsCreate3DImage( float x, f...")
 
 
Line 29: Line 29:
DGS = exports.dgs
DGS = exports.dgs


local image = DGS:dgsCreate3DImage(0,0,4,_,tocolor(0,128,255,128))
local rectangle = DGS:dgsCreate3DImage(0,0,4,_,tocolor(0,128,255,128))
DGS:dgsSetProperty(image,"fadeDistance",20)
DGS:dgsSetProperty(rectangle,"fadeDistance",20)
DGS:dgsSetProperty(image,"outline",{"out",1,tocolor(255,255,255,255)})
DGS:dgsSetProperty(rectangle,"outline",{"out",1,tocolor(255,255,255,255)})
DGS:dgs3DImageAttachToElement(image,localPlayer,0,5)
DGS:dgs3DImageAttachToElement(rectangle,localPlayer,0,5)
 
local texture = dxCreateTexture("test.png")
local imageWithDx = DGS:dgsCreate3DImage(10,0,4,texture,tocolor(0,128,255,128))
 
local imageWithPath = DGS:dgsCreate3DImage(10,10,4,"test.png",tocolor(0,128,255,128))
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{DGSFUNCTIONS}}
{{DGSFUNCTIONS}}

Latest revision as of 06:07, 19 April 2021

This function creates a 3d image in the world ( such as nametag ).

Syntax

element dgsCreate3DImage( float x, float y, float z, string/texture/nil image[, int color = 0xFFFFFFFF, float scaleX = 1, float scaleY = 1, float maxDistance = 80 ] )

Required Arguments

File:DGS 3D Image Example.gif
Example DGS 3D Image.
  • x: A float of the 3D x position of the DGS 3D Image in the world.
  • y: A float of the 3D y position of the DGS 3D Image in the world.
  • z: A float of the 3D z position of the DGS 3D Image in the world.
  • image: A string/texture/nil of the image of DGS 3D Image.

Optional Arguments

  • color: An integer of the color of the DGS 3D Image.
  • font: A dx-font element or a string of the DGS 3D Image.
  • scaleX : A float of the 2D X size of the DGS 3D Image ( Width in pixels on screen at the distance of 50 unit in game ).
  • scaleY : A float of the 2D Y size of the DGS 3D Image ( Height in pixels on screen at the distance of 50 unit in game ).
  • maxDistance : A float of the 3D distance within which we can see the DGS 3D Image

Returns

Returns a dgs-3dimage element if it was successfully created, false otherwise.

Example

DGS = exports.dgs

local rectangle = DGS:dgsCreate3DImage(0,0,4,_,tocolor(0,128,255,128))
DGS:dgsSetProperty(rectangle,"fadeDistance",20)
DGS:dgsSetProperty(rectangle,"outline",{"out",1,tocolor(255,255,255,255)})
DGS:dgs3DImageAttachToElement(rectangle,localPlayer,0,5)

local texture = dxCreateTexture("test.png")
local imageWithDx = DGS:dgsCreate3DImage(10,0,4,texture,tocolor(0,128,255,128))

local imageWithPath = DGS:dgsCreate3DImage(10,10,4,"test.png",tocolor(0,128,255,128))

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips