Dgs3DInterfaceProcessLineOfSight

From Multi Theft Auto: Wiki
Revision as of 16:24, 5 October 2024 by Thisdp (talk | contribs) (→‎Examples)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function casts a ray through two points to the dgs 3d interface, and tells you information about the point that was hit, if any.

Syntax

Return values labelled for ease of reference.

bool               -- hit
float float float  -- hitX, hitY, hitZ
float float        -- hitInterfaceX, hitInterfaceY
                  dgs3DInterfaceProcessLineOfSight ( dgs-3dinterface interface,
                                       float startX, float startY, float startZ, 
                                       float endX, float endY, float endZ )

Required Arguments

  • startX: The start x position
  • startY: The start y position
  • startZ: The start z position
  • endX: The end x position
  • endY: The end y position
  • endZ: The end z position

Returns

  • hit: true if there is a collision with dgs 3d interface, false otherwise
  • hitX, hitY, hitZ: collision position
  • hitInterfaceX, hitInterfaceY: the position on 3d interface

Examples

DGS = exports.dgs

dgs3dPanel = DGS:dgsCreate3DInterface(0,0,3,2,2,400,400,tocolor(255,255,255,255),0,1,0)
DGS:dgsCreateImage(0,0,1,1,_,true,dgs3dPanel) -- Background

local hit, hitX, hitY, hitZ, hitInterfaceX, hitInterfaceY = DGS:dgs3DInterfaceProcessLineOfSight ( 10, 10, 3, 0, 0, 3 )
outputChatBox ( "Hit " .. tostring(hit) .. ", " .. tostring(hitInterfaceX) .. ", " ..  tostring(hitInterfaceY) )

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