|
|
| (One intermediate revision by the same user not shown) |
| Line 1: |
Line 1: |
| {{PL/Useful Function}}
| |
| <lowercasetitle/>
| |
| __NOTOC__
| |
| Funkcja rysuje skaczący element dxDraw a konkretnie [[dxDrawRectangle]] w podanych współrzędnych, trzeba użyć [[onClientRender]] do poprawnego działania.
| |
|
| |
|
| ==Składnia==
| |
| <syntaxhighlight lang="lua">bool dxDrawJumpedRectangle(posX,posY,width,height [color = white, postGUI = false] )</syntaxhighlight>
| |
|
| |
| ===Wymagane argumenty===
| |
| * '''posX''': Liczba reprezentująca absolutną pozycję X na ekranie.
| |
| * '''posY''': Liczba reprezentująca absolutną pozycję Y na ekranie.
| |
| * '''widht''': Liczba reprezentująca szerokość elementu.
| |
| * '''height''': Liczba reprezentująca wysokość elementu.
| |
|
| |
| ===Opcjonalne argumenty===
| |
| {{PL/OptionalArg}}
| |
| * '''color''': Liczba reprezentująca kolor R,G,B,A.
| |
| * '''postGUI''': Argument odpowiadający za to, że element jest zawsze na wierzchu.
| |
|
| |
| ===Wynik===
| |
| Zwraca ''true'' jeśli element został stworzony prawidłowo, lub ''false'' jeśli wystąpił jakiś problem.
| |
|
| |
| ==Źródło==
| |
| <section name="Client" class="client" show="true">
| |
| <syntaxhighlight lang="lua">
| |
| function dxDrawJumpedRectangle(posX,posY,width,height,color,postGUI)
| |
| if ( type( posX ) ~= "number" ) or ( type( posY ) ~= "number" ) or ( type( width ) ~= "number" ) or ( type( height ) ~= "number" ) then
| |
| return false
| |
| end
| |
| color = color or tocolor(255,255,255,255)
| |
| postGUI = type(postGUI) == "boolean" and postGUI or false
| |
| local sinus = math.sin(getTickCount()/500)*3
| |
| dxDrawRectangle(posX,posY+sinus,width,heigt,color,postGUI)
| |
| return true
| |
| end
| |
| </syntaxhighlight>
| |
| </section>
| |
| <br />'''Autor:''Tararysz12
| |
| <br />
| |
| ==Przykład==
| |
| <section name="Client" class="client" show="true">
| |
| <syntaxhighlight lang="lua">
| |
| addEventHandler("onClientRender",root,function()
| |
| dxDrawJumpedRectangle(200,200,300,400,tocolor(255,255,0,200),false)
| |
| end)
| |
| </syntaxhighlight>
| |
| </section>
| |
|
| |
| ==Zobacz również==
| |
| {{Useful_Functions}}
| |