DgsImageSetImage: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 16: Line 16:


==Example==  
==Example==  
<section name="Client-side script (example.lua)" class="client" show="true">
<section name="Client-side script" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
[lua]
DGS = exports.dgs
DGS = exports.dgs
local texture = dxCreateTexture("text.png") -- You need to add a texture yourself.
local texture = dxCreateTexture("text.png") -- You need to add a texture yourself.
local myImage = DGS:dgsDxCreateStaticImage ( 0.45, 0.48, 0.2, 0.5, _, true )
local myImage = DGS:dgsDxCreateStaticImage ( 0.45, 0.48, 0.2, 0.5, _, true )
setTimer ( DGS:dgsDxImageLoadImage, 10000, 1, myImage, texture )
setTimer ( DGS:dgsDxImageLoadImage, 10000, 1, myImage, texture )

Revision as of 15:02, 4 October 2017

This function allows you to change the image in DGS image element to another one.

Syntax

bool dgsDxImageLoadImage ( element theElement, element texture )

Required Arguments

  • theElement: The image element to be changed.
  • texture: A texture/shader/render target/screen source element that you want to set.

Returns

Returns true if the the image in the image element was successfully changed, false otherwise.

Example

Click to collapse [-]
Client-side script
DGS = exports.dgs
local texture = dxCreateTexture("text.png")  -- You need to add a texture yourself.
local myImage = DGS:dgsDxCreateStaticImage ( 0.45, 0.48, 0.2, 0.5, _, true )
setTimer ( DGS:dgsDxImageLoadImage, 10000, 1, myImage, texture )

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