OnDgsStopAniming

From Multi Theft Auto: Wiki
Revision as of 09:59, 6 June 2020 by Thisdp (talk | contribs) (Created page with "{{Client event}} __NOTOC__ This event is triggered when a dgs element stops the aninimation which was started by dgsAnimTo ==Parameters== <syntaxhighlight lang="lua"> e...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is triggered when a dgs element stops the aninimation which was started by dgsAnimTo

Parameters

element theElement

Source

The source of this event is the dgs element which stopped its animation.

Example

DGS = exports.dgs

if not DGS:dgsEasingFunctionExists("colorChange") then
	DGS:dgsAddEasingFunction("colorChange",[[
	--Predefined variable
	-- progress: from 0 to 1 , indicates the progress of the whole animation
	-- setting: a table {propertyName,targetValue,initialValue}
	-- self: the dgs element
	-- propertyTable: property table of the dgs element
		local _b,_g,_r,_a = bitExtract(setting[3],0,8),bitExtract(setting[3],8,8),bitExtract(setting[3],16,8),bitExtract(setting[3],24,8)
		local b,g,r,a = bitExtract(setting[2],0,8),bitExtract(setting[2],8,8),bitExtract(setting[2],16,8),bitExtract(setting[2],24,8)
		return tocolor(_r+(r-_r)*progress,_g+(g-_g)*progress,_b+(b-_b)*progress,_a+(a-_a)*progress)
	]])
end

image = DGS:dgsCreateImage(200,100,400,400,_,false,_,tocolor(0,0,0,255))
DGS:dgsAnimTo(image,"color",tocolor(200,100,50,255),"colorChange",5000)
addEventHandler("onDgsStopAniming", image, function(propertyName) 
   outputChatBox("Window has stopped animing, property:"..propertyName)
end)

See Also

DGS events

General

Check Box

Combo Box

Drag'N Drop

Edit

Grid List

Menu

Selector

Mouse

Radio Button

Switch Button

Tab

Animation

Plugin

Media

Color Picker

QRCode

Remote Image

Client event functions