Jump to content

wanna help move bar


iiv03

Recommended Posts

hey i make dxdrawimage and wanna move this and my friend tell me use dxGetTextWidth  and i not understand dxGetTextWidth just want try to make it move

 

function interface ()
    local alpha = race.alpha/255
	setElementData(localPlayer,"xAlpha",alpha)
	r,g,b = unpack(race.color)
    -- notification
	if race.notState then
		local tick = getTickCount() - race.tick
		if tick <= 5000 then
	        local moveProgress = math.min(1,tick/500)
	        race.notPos,race.notAlpha = interpolateBetween ( race.notPos, race.notAlpha, 0, y*0.65, 1, 0, moveProgress ,"Linear")
		elseif tick > 5000 and tick <= 5500 then
	        local moveProgress = math.min(1,(tick-5000)/500)
	        race.notPos,race.notAlpha = interpolateBetween ( race.notPos, race.notAlpha, 0, y*0.4, 0, 0, moveProgress ,"Linear")
		else
			race.notState = false
		end
	    _dxDrawRectangle(s*0.005,race.notPos,race.notWidth+s*0.01,y*0.03,race.notColorR,race.notColorG,race.notColorB,race.notAlpha)
		_dxText(race.notTitle.." "..race.notInfo,s*0.005,race.notPos+y*0.003,s*0.005+race.notWidth+s*0.01,y,race.notColorR,race.notColorG,race.notColorB,255*race.notAlpha,resY(1),fonts["normal"][3],"center","top",true,false,false,false)
	end
	if not getElementData(localPlayer,"login") then return end
    -- map & next
    if race.nextMap then 
	    local MapNameNow = getTickCount() - race.mapNameTick
		local luck = math.random(1,2) if luck == 2 then race.mapNameTick = race.mapNameTick + 22 end
		local progress = (MapNameNow/2000)
	    local _progress = math.floor(getEasingValue(progress,"Linear")*race.mapName:len())
		if ( _progress > race.mapName:len()) then
	        _progress = race.mapName:len()
		end
		local _MapName = race.mapName:sub(1,_progress)
		if race.redo then
        dxDrawText(_MapName.."  #00FF00- Redo", 24, 699, 874, 710, tocolor(255, 255, 255, 255), 0.80, "default-bold", "left", "top", true, true, true, true, true)
        dxDrawImage(6*sx, 695*sy, 16*sx, 17*sy, ":guieditor/images/map.png", 0, 0, 0, tocolor(0, 254, 114, 255), true)
		else
        dxDrawText(_MapName, 24, 699, 874, 710, tocolor(255, 255, 255, 255), 0.80, "default-bold", "left", "top", true, true, true, true, true)
        dxDrawImage(6*sx, 695*sy, 16*sx, 17*sy, ":guieditor/images/map.png", 0, 0, 0, tocolor(0, 254, 114, 255), true)
		end
		local nextMapNow = getTickCount() - race.nextMapTick
		local luck = math.random(1,2) if luck == 2 then race.nextMapTick = race.nextMapTick + 22 end
		local progress = (nextMapNow/2000)
		local _progress = math.floor(getEasingValue(progress,"Linear")*race.nextMap:len())
		if ( _progress > race.nextMap:len()) then
			_progress = race.nextMap:len()
		end
		local _NextMap = race.nextMap:sub(1,_progress)
        dxDrawText("".._NextMap,24*sx, 672*sy, 874*sx, 689*sy, tocolor(255, 255, 255, 255), 0.80, "default-bold", "left", "top", true, true, true, true, true)
        dxDrawImage(0*sx, 669*sy, 159*sx, 20*sy, ":guieditor/images/namebar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) -- bar nextmap
        dxDrawImage(6*sx, 695*sy, 16*sx, 17*sy, ":guieditor/images/map.png", 0, 0, 0, tocolor(0, 254, 114, 255), true)
        dxDrawImage(0*sx, 695*sy, 133*sx, 19*sy, ":guieditor/images/namebar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) -- bar mapname
        dxDrawImage(6*sx, 672*sy, 14*sx, 13*sy, ":guieditor/images/reset.png", 0, 0, 0, tocolor(0, 254, 114, 255), true)
	else
	    local MapNameNow = getTickCount() - race.mapNameTick
		local luck = math.random(1,2) if luck == 2 then race.mapNameTick = race.mapNameTick + 22 end
		local progress = (MapNameNow/2000)
	    local _progress = math.floor(getEasingValue(progress,"Linear")*race.mapName:len())
		if ( _progress > race.mapName:len()) then
	        _progress = race.mapName:len()
		end
		local _MapName = race.mapName:sub(1,_progress)
		if race.redo then
        dxDrawText(_MapName.."  #00FF00- Redo", 24, 699, 874, 710, tocolor(255, 255, 255, 255), 0.80, "default-bold", "left", "top", true, true, true, true, true)
        dxDrawImage(6*sx, 695*sy, 16*sx, 17*sy, ":guieditor/images/map.png", 0, 0, 0, tocolor(0, 254, 114, 255), true) --mapname
        dxDrawImage(0*sx, 695*sy, 133*sx, 19*sy, ":guieditor/images/namebar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
		else
        dxDrawText(_MapName, 24, 699, 874, 710, tocolor(255, 255, 255, 255), 0.80, "default-bold", "left", "top", true, true, true, true, true)
        dxDrawImage(6*sx, 695*sy, 16*sx, 17*sy, ":guieditor/images/map.png", 0, 0, 0, tocolor(0, 254, 114, 255), true) --mapname
        dxDrawImage(0*sx, 695*sy, 133*sx, 19*sy, ":guieditor/images/namebar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
		end
    end

i need solved to move the bar please i need help

 

 

to understand look my video problem*

 

https://www.youtube.com/watch?v=Z0blYPKrN6g

Edited by liwahadri
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...