Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2017-06-06, 16:21


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Witam. Jak zrobi? animacje dx? Chodzi mi np, ?e wysuwa si? z ekranu, po x czasu si? chowa (wracaj?c sk?d wysz?o). Za pomoc R* :piwo:

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 16:44


Makay

Tryb .lua






Wiek: 26
Na forum: 3287 dni
Posty: 38
Nick w MP: Makay

Piwa: 774

Respekt: 40,5

Ostrzeżeń: 100%
Z tego co pami?tam to chyba tak to si? robi?o.
local xyinterpolateBetween (screenW 0.3493screenH 0.80210,  screenW 0.3493screenH 1.20210, (s-getTickCount())/(( 2000 ) - ), "InQuad")
local xtytzt interpolateBetween (screenW 0.3551screenH 0.82160,screenW 0.3551screenH 1.2216 0, (s-getTickCount())/(( 2000 ) - ), "InQuad")
Nie wiem czy to tak by?o ale jak pomog?em to licze na :piwo: i R* :)

Podpis
Początkowy Programista LUA

[lua]if getElementData(source, "gracz:Makay") then
setPlayerName(source, "Makauś")
else
setPlayerName(source, ".lua")
end[/lua]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 17:21


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Makay, Hmm kto? potrafi?by mi wyt?umaczy? jak wype?ni? interpolateBetween?

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 17:24


Makay

Tryb .lua






Wiek: 26
Na forum: 3287 dni
Posty: 38
Nick w MP: Makay

Piwa: 774

Respekt: 40,5

Ostrzeżeń: 100%
Rookspack, Chodzi Ci o screenW i screenH?

Podpis
Początkowy Programista LUA

[lua]if getElementData(source, "gracz:Makay") then
setPlayerName(source, "Makauś")
else
setPlayerName(source, ".lua")
end[/lua]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 17:26


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Makay, Chodzi mi og?lnie o ca?? funkcje :)

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 17:28


Makay

Tryb .lua






Wiek: 26
Na forum: 3287 dni
Posty: 38
Nick w MP: Makay

Piwa: 774

Respekt: 40,5

Ostrzeżeń: 100%
Mniej wi?cej co? takiego tutaj masz przyk?ad.
function oglo()
x,guiGetScreenSize()
screenW,screenH guiGetScreenSize()
 for k,v in ipairs getElementsByType "object" ) ) do
    if getElementData v"ogloszenie" then
        local tekst getElementData v"textogloszenia" )
        local width dxGetTextWidth(tekst,1,"Arial")
        local now getTickCount()
            local endTime start 6000
        local elapsedTime now start
        local duration endTime start

        local progress elapsedTime duration
        
        if progress and progress 4 then
        if not s then
        s getTickCount()
        end
        local xyinterpolateBetween (screenW 0.3493screenH 0.80210,  screenW 0.3493screenH 1.20210, (s-getTickCount())/(( 2000 ) - ), "InQuad")
        local xtytzt interpolateBetween (screenW 0.3551screenH 0.82160,screenW 0.3551screenH 1.2216 0, (s-getTickCount())/(( 2000 ) - ), "InQuad")
        dxDrawRectangle(xyscreenW 0.2941screenH 0.0859 + (width 0.05), tocolor(l[1], l[2], l[3], 60), false)
        dxDrawText(tekst,xtyt,screenW 0.6382screenH 10.0tocolor(255255255255), 1.00"default""center""top",  falsefalsefalsetruetrue) -- falsetruefalsefalsefalse
        return end
        local pxpypz getElementPosition(localPlayer)
        local xyinterpolateBetween (screenW 0.3493screenH 1.20210,screenW 0.3493screenH 0.8021 0progress"InQuad")
        local xtytzt interpolateBetween (screenW 0.3551screenH 1.22160,screenW 0.3551screenH 0.8216 0progress"InQuad")
        dxDrawRectangle(xyscreenW 0.2941screenH 0.0859 + (width 0.05), tocolor(l[1], l[2], l[3], 60), false)
        dxDrawText(tekst,xtyt,screenW 0.6382screenH 10.0tocolor(255255255255), 1.00"default""center""top"falsefalsefalsetruetrue) -- falsetruefalsefalsefalse
    end
end
end

addEventHandler "onClientElementDataChange"root, function(data,old)
    if getElementType(source) == "object" and data == "ogloszenie" then
        if getElementData(source,"ogloszenie"then
            if isEventHandlerAdded("onClientRender",root,oglothen
                removeEventHandler "onClientRender"rootoglo)
            end
            start getTickCount()
            nil
            addEventHandler "onClientRender"rootoglo)
        else
            removeEventHandler "onClientRender"rootoglo)
            start getTickCount()
            nil
        end
    end
end)
addEventHandler "onClientRender"rootoglo)


Podpis
Początkowy Programista LUA

[lua]if getElementData(source, "gracz:Makay") then
setPlayerName(source, "Makauś")
else
setPlayerName(source, ".lua")
end[/lua]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 17:51


nanKy







Wiek: 22
Na forum: 3866 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

"Makay" napisał/a:

Mniej wi?cej co? takiego tutaj masz przyk?ad.
function oglo()
x,guiGetScreenSize()
screenW,screenH guiGetScreenSize()
 for k,v in ipairs getElementsByType "object" ) ) do
    if getElementData v"ogloszenie" then
        local tekst getElementData v"textogloszenia" )
        local width dxGetTextWidth(tekst,1,"Arial")
        local now getTickCount()
            local endTime start 6000
        local elapsedTime now start
        local duration endTime start

        local progress elapsedTime duration
        
        if progress and progress 4 then
        if not s then
        s getTickCount()
        end
        local xyinterpolateBetween (screenW 0.3493screenH 0.80210,  screenW 0.3493screenH 1.20210, (s-getTickCount())/(( 2000 ) - ), "InQuad")
        local xtytzt interpolateBetween (screenW 0.3551screenH 0.82160,screenW 0.3551screenH 1.2216 0, (s-getTickCount())/(( 2000 ) - ), "InQuad")
        dxDrawRectangle(xyscreenW 0.2941screenH 0.0859 + (width 0.05), tocolor(l[1], l[2], l[3], 60), false)
        dxDrawText(tekst,xtyt,screenW 0.6382screenH 10.0tocolor(255255255255), 1.00"default""center""top",  falsefalsefalsetruetrue) -- falsetruefalsefalsefalse
        return end
        local pxpypz getElementPosition(localPlayer)
        local xyinterpolateBetween (screenW 0.3493screenH 1.20210,screenW 0.3493screenH 0.8021 0progress"InQuad")
        local xtytzt interpolateBetween (screenW 0.3551screenH 1.22160,screenW 0.3551screenH 0.8216 0progress"InQuad")
        dxDrawRectangle(xyscreenW 0.2941screenH 0.0859 + (width 0.05), tocolor(l[1], l[2], l[3], 60), false)
        dxDrawText(tekst,xtyt,screenW 0.6382screenH 10.0tocolor(255255255255), 1.00"default""center""top"falsefalsefalsetruetrue) -- falsetruefalsefalsefalse
    end
end
end

addEventHandler "onClientElementDataChange"root, function(data,old)
    if getElementType(source) == "object" and data == "ogloszenie" then
        if getElementData(source,"ogloszenie"then
            if isEventHandlerAdded("onClientRender",root,oglothen
                removeEventHandler "onClientRender"rootoglo)
            end
            start getTickCount()
            nil
            addEventHandler "onClientRender"rootoglo)
        else
            removeEventHandler "onClientRender"rootoglo)
            start getTickCount()
            nil
        end
    end
end)
addEventHandler "onClientRender"rootoglo)

Pomagasz niezoptymalizowanymi kodami z ogrpg niech kto? mu to wyt?umaczy kto to umie.
Ja si? na tym dok?adnie nie znam ale wiem ze zale?y jaka chcesz zrobi? animacje np przesuniecia DX czy zmian jego koloru co iles?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 17:51


eject

kurdebele






Wiek: 30
Na forum: 3659 dni
Posty: 182
Nick w MP: EjecT

Piwa: 2456

Respekt: 85,8

Ostrzeżeń: 60%
local x,interpolateBetween(skadmawyjsc_x,skadmawyjsc_y,0,gdziemaskonczyc_x,gdziemaskonczyc_y,0)
dxDrawText("Elo",x,y,x,y)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
nanKy
Wysłany: 2017-06-06, 17:51


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

NankY., Przesuni?cie DX.

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 17:58


nanKy







Wiek: 22
Na forum: 3866 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

"eject" napisał/a:

local x,interpolateBetween(skadmawyjsc_x,skadmawyjsc_y,0,gdziemaskonczyc_x,gdziemaskonczyc_y,0)
dxDrawText("Elo",x,y,x,y)

Tak jak up a powracanie na timery(tick)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 18:21


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Panowie mam problem z tickiem. Jak co? takiego zrobi?? ...

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 19:03


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Warto wspomnie?, ?e
Więcej informacji znajdziesz w Wikipedii MTA:

interpolateBetween
ma jeszcze argument rodzaju tej animacji co jest cz?sto przydatne. Co do ticka
Więcej informacji znajdziesz w Wikipedii MTA:

getTickCount
Dzia?a prawie jak timer. Przyk?ad gotowy bodaj?e z tickiem masz nawet na wiki.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 19:19


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

marcin778,



function dx ()
    
    local now getTickCount()
    local endTime start 2000
    local elapsedTime now start
    local duration endTime start
    local progress elapsedTime duration
    local x1,y1z1 screenW 0.7547screenH 0.8991screenW 0.0471
    local x2,y2z2 screenH 0.0574screenH 0.0509screenW 0.9552
    local x,interpolateBetween(x1y1z1x2y2z2progress"OutQuad")
    dxDrawText("Elo",x,y)
        

end

addEvent("gui_pokaz"true)
addEventHandler("gui_pokaz"root,
 function()
    
    start getTickCount()
    guiSetVisible(guitrue)
    showCursor(true)
    addEventHandler("onClientRender"rootdx)

end
)


Takie co??

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 19:32


Dexnes_

Tiger






Wiek: 26
Na forum: 4401 dni
Posty: 620
Nick w MP: Dexnes

Piwa: 1394

Respekt: 390
Respekt: 390Respekt: 390Respekt: 390Respekt: 390

Rookspack, Nie mo?esz sprawdzi? czy dzia?a? Og?lnie je?eli chodzi ci o taki efekt to jest dobrze.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-06, 19:34


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

BlackGamePL, Aktualnie przeinstalowuje MTA i nie mam mo?liwo?ci. Zaraz zobacz? jaki efekt.

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Tagi: animacja
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Animacja dx Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku