Wysłany: 2018-12-07, 20:13
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Mam problem z skalowaniem guiCreateEdit , guiCreateButton
local x , y = guiGetScreenSize ()
oX , oY = 1280 , 720
-- x , y = 1024 , 700
loginedit = guiCreateEdit ( 0.05 / oX * x , 0.6 / oY * y , 0.22 / oX * x , 0.05 / oY * y , "" , true )
hasloedit = guiCreateEdit ( 0.05 / oX * x , 0.7 / oY * y , 0.22 / oX * x , 0.05 / oY * y , "" , true )
zaloguj = guiCreateButton ( 0.05 / oX * x , 0.8 / oY * y , 0.22 / oX * x , 0.05 / oY * y , "Zaloguj" , true )
rejestruj = guiCreateButton ( 0.05 / oX * x , 0.9 / oY * y , 0.22 / oX * x , 0.05 / oY * y , "Rejestruj" , true )
function panel ()
showChat ( false )
local postepZDJ = math . sin (( getTickCount ()/ 360 )* 3 )
dxDrawImage ( 800 / oX * x , 20 / oY * y , 561 / oX * x , 763 / oY * y , "files/4.png" )
dxDrawRectangle ( 0 / oX * x , 0 / oY * y , 400 / oX * x , 720 / oY * y , tocolor ( 0 , 0 , 0 , 130 ))
dxDrawImage ( 3 / oX * x , 20 / oY * y + postepZDJ , 550 / oX * x , 200 / oY * y , "files/logo.png" )
dxDrawText ( "Witam na serwerze ArgonathRPG! Aby zacz??\ngre na naszym serwerze musisz za?o?y? konto.\n Je?li posiadasz ju? konto u nas to zapraszam\ndo wsp?lnej gry :D! Zapraszamy te?\nna naszym portal www.gtao.pl." , 30 / oX * x , 200 / oY * y , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 1 / oX * x , font , "left" , "top" )
dxDrawText ( "Login:" , 185 / oX * x , 400 / oY * y , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 0.8 / oX * x , font2 , "left" , "top" )
dxDrawText ( "Has?o:" , 185 / oX * x , 470 / oY * y , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 0.8 / oX * x , font2 , "left" , "top" )
-- dxDrawText
end
addEventHandler ( "onClientRender" , root , panel )
Wysłany: 2018-12-07, 20:48
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Problemem mo?e by? ?le sformu?owane skalowanie.
Spr?buj:
local x , y = guiGetScreenSize ()
oX , oY = 1280 , 720
-- x , y = 1024 , 700
loginedit = guiCreateEdit ( 0.05 * oX / x , 0.6 * oY / y , 0.22 * oX / x , 0.05 * oY / y , "" , true )
hasloedit = guiCreateEdit ( 0.05 * oX / x , 0.7 * oY / y , 0.22 * oX / x , 0.05 * oY / y , "" , true )
zaloguj = guiCreateButton ( 0.05 * oX / x , 0.8 * oY / y , 0.22 * oX / x , 0.05 * oY / y , "Zaloguj" , true )
rejestruj = guiCreateButton ( 0.05 * oX / x , 0.9 * oY / y , 0.22 * oX / x , 0.05 * oY / y , "Rejestruj" , true )
function panel ()
showChat ( false )
local postepZDJ = math . sin (( getTickCount ()/ 360 )* 3 )
dxDrawImage ( 800 * oX / x , 20 * oY / y , 561 * oX / x , 763 * oY / y , "files/4.png" )
dxDrawRectangle ( 0 * oX / x , 0 * oY / y , 400 * oX / x , 720 * oY / y , tocolor ( 0 , 0 , 0 , 130 ))
dxDrawImage ( 3 * oX / x , 20 * oY / y + postepZDJ , 550 * oX / x , 200 * oY / y , "files/logo.png" )
dxDrawText ( "Witam na serwerze ArgonathRPG! Aby zacz??\ngre na naszym serwerze musisz za?o?y? konto.\n Je?li posiadasz ju? konto u nas to zapraszam\ndo wsp?lnej gry :D! Zapraszamy te?\nna naszym portal www.gtao.pl." , 30 / oX * x , 200 * oY / y , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 1 / oX * x , font , "left" , "top" )
dxDrawText ( "Login:" , 185 * oX / x , 400 * oY / y , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 0.8 * oX / x , font2 , "left" , "top" )
dxDrawText ( "Has?o:" , 185 * oX / x , 470 * oY / y , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 0.8 * oX / x , font2 , "left" , "top" )
-- dxDrawText
end
addEventHandler ( "onClientRender" , root , panel )
Zmieni?em "/oX*x" na "*oX/x".
Więcej szczegółów
Wystawiono 1 piw(a):Vxen
Wysłany: 2018-12-07, 21:10
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Lipa dalej to samo
Wysłany: 2018-12-07, 21:41
Avenged
Młodszy Szkrypter
Wiek: 23 Na forum: 3510 dni Posty: 654
Nick w MP: Avenged
Piwa : 1570
Podpis
LUA, JS, PHP
Zapraszam do skorzystania z moich usług: Klik
Wysłany: 2018-12-08, 12:59
Xrent
-
Wiek: 21 Na forum: 3047 dni Posty: 230
Nick w MP: Pazdam
Piwa : 535
Og?lnie w cegui polecam u?ywa? relative. Skaluj? prawie, ?e idealnie. Skalowanie ci ?le dzia?a bo masz relative w??czone w editBoxie i butonie i chyba co? z wzorem na skalowanie. Polecam w cegui dawa? relative bo dobrze skaluj?. Natomiast na dx'ach tego skalowania co u?y?e?.
Przeczytaj http://gtao.pl/matematyka-w-lua-1-vt116776.htm
[ Dodano : 2018-12-08, 13:01 ]
Cytat z tematu: "Nie przed?u?aj?c, jak wiadomo mamy do dyspozycji bardzo dobry "guieditor", za pomoc? kt?rego mo?emy wiele pro?ciej tworzy? nasze gui ni? mieliby?my robi? to r?cznie. ?w guieditor ma opcj? skalowania "relative" czyli relatywnego, aby by?o to pod ka?d? rozdzielczo??. Jak wiadomo w przypadku element?w gui dzia?a to prawie, ?e doskonale, aczkolwiek w przypadku dxDraw nie do ko?ca si? to sprawdza. Czasem wyskalowane guieditorem dxDraw wygl?da r??nie na r??nych rozdzielczo?ciach, cho? w praktyce wz?r liczenia jest prawie, ?e identyczny. "
Wysłany: 2018-12-08, 15:28
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Mo?e kto? zobaczy w kod i napisze bo serio sam nie dam rady!
local sx , sy = guiGetScreenSize ()
local px , py = ( sx / 1360 ),( sy / 768 )
addEventHandler ( "onClientRender" , root ,function()
showChat ( false )
showCursor ( true )
local postepZDJ = math . sin (( getTickCount ()/ 360 )* 3 )
-- dxDrawImage ( 0 / oX * x , 0 / oY * y , 1280 / oX * x , 720 / oY * y , "files/back.png" )
-- dxDrawImage ( 800 / oX * x , 20 / oY * y , 561 / oX * x , 763 / oY * y , "files/4.png" )
dxDrawRectangle ( 0 * px , 0 * py , 400 * px , 768 * py , tocolor ( 0 , 0 , 0 , 130 ) )
dxDrawImage ( 3 * px , 20 * py + postepZDJ , 425 * px , 100 * py , "files/logo.png" )
dxDrawText ( "Witam na serwerze GalaxY RPG! Aby zacz??\ngre na naszym serwerze musisz za?o?y? konto.\n Je?li posiadasz ju? konto u nas to zapraszam\ndo wsp?lnej gry :D! Zapraszamy te?\nna naszym portal www.gtao.pl." , 200 * px , 150 * py , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 1 * px , font , "center" , "top" )
dxDrawText ( "Login:" , 200 * px , 300 * py , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 0.8 * px , font , "center" , "top" )
dxDrawText ( "Has?o:" , 200 * px , 370 * py , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 0.8 * px , font , "center" , "top" )
end )
-- createEditBox ( id , xS , yS , w , h , widoczny , tekst , zamaskowany , dlugosc , czcionka , spacja , typ , kolor , prostokat , kolorProstokat , skala , clip , ms , tekstBool , tekstPomocniczy , tekstPomocniczyKolor , maZniknac , skalaPomoc , czcionkaPomoc , postGUI , wstawka , kolorWstawki , specjalneZnaki , mozeKliknac )
loginedit = exports . dxEditBox : createEditBox ( "1" , 0.035 * px , 0.42 * py , 0.22 * px , 0.05 * py , true , "" , false , 15 * px , "arial" , false , 0 , { 255 , 255 , 255 , 180 }, true , { 0 , 0 , 0 , 180 }, 2 * px , true , 60 * px , true , "Login" , { 255 , 255 , 255 , 180 }, true , 2 * px , "arial" , true , true , { 0 , 114 , 210 }, false )
hasloedit = exports . dxEditBox : createEditBox ( "2" , 0.035 * px , 0.52 * py , 0.22 * px , 0.05 * py , true , "" , true , 20 * px , "arial" , false , 0 , { 255 , 255 , 255 , 180 }, true , { 0 , 0 , 0 , 180 }, 3 * px , true , 60 * px , true , "Has?o" , { 255 , 255 , 255 , 180 }, true , 2 * px , "arial" , true , true , { 0 , 0 , 0 }, false )
zaloguj = guiCreateButton ( 0.035 * px , 0.65 * py , 0.22 * px , 0.05 * py , "Zaloguj" , true )
rejestruj = guiCreateButton ( 0.035 * px , 0.75 * py , 0.22 * px , 0.05 * py , "Rejestruj" , true )
dx s? git ale Button i Edit nie
Wysłany: 2018-12-08, 16:49
Xrent
-
Wiek: 21 Na forum: 3047 dni Posty: 230
Nick w MP: Pazdam
Piwa : 535
"Vxen" napisał/a :Mo?e kto? zobaczy w kod i napisze bo serio sam nie dam rady!
local sx , sy = guiGetScreenSize ()
local px , py = ( sx / 1360 ),( sy / 768 )
addEventHandler ( "onClientRender" , root ,function()
showChat ( false )
showCursor ( true )
local postepZDJ = math . sin (( getTickCount ()/ 360 )* 3 )
-- dxDrawImage ( 0 / oX * x , 0 / oY * y , 1280 / oX * x , 720 / oY * y , "files/back.png" )
-- dxDrawImage ( 800 / oX * x , 20 / oY * y , 561 / oX * x , 763 / oY * y , "files/4.png" )
dxDrawRectangle ( 0 * px , 0 * py , 400 * px , 768 * py , tocolor ( 0 , 0 , 0 , 130 ) )
dxDrawImage ( 3 * px , 20 * py + postepZDJ , 425 * px , 100 * py , "files/logo.png" )
dxDrawText ( "Witam na serwerze GalaxY RPG! Aby zacz??\ngre na naszym serwerze musisz za?o?y? konto.\n Je?li posiadasz ju? konto u nas to zapraszam\ndo wsp?lnej gry :D! Zapraszamy te?\nna naszym portal www.gtao.pl." , 200 * px , 150 * py , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 1 * px , font , "center" , "top" )
dxDrawText ( "Login:" , 200 * px , 300 * py , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 0.8 * px , font , "center" , "top" )
dxDrawText ( "Has?o:" , 200 * px , 370 * py , _ , _ , tocolor ( 255 , 255 , 255 , 255 ), 0.8 * px , font , "center" , "top" )
end )
-- createEditBox ( id , xS , yS , w , h , widoczny , tekst , zamaskowany , dlugosc , czcionka , spacja , typ , kolor , prostokat , kolorProstokat , skala , clip , ms , tekstBool , tekstPomocniczy , tekstPomocniczyKolor , maZniknac , skalaPomoc , czcionkaPomoc , postGUI , wstawka , kolorWstawki , specjalneZnaki , mozeKliknac )
loginedit = exports . dxEditBox : createEditBox ( "1" , 0.035 * px , 0.42 * py , 0.22 * px , 0.05 * py , true , "" , false , 15 * px , "arial" , false , 0 , { 255 , 255 , 255 , 180 }, true , { 0 , 0 , 0 , 180 }, 2 * px , true , 60 * px , true , "Login" , { 255 , 255 , 255 , 180 }, true , 2 * px , "arial" , true , true , { 0 , 114 , 210 }, false )
hasloedit = exports . dxEditBox : createEditBox ( "2" , 0.035 * px , 0.52 * py , 0.22 * px , 0.05 * py , true , "" , true , 20 * px , "arial" , false , 0 , { 255 , 255 , 255 , 180 }, true , { 0 , 0 , 0 , 180 }, 3 * px , true , 60 * px , true , "Has?o" , { 255 , 255 , 255 , 180 }, true , 2 * px , "arial" , true , true , { 0 , 0 , 0 }, false )
zaloguj = guiCreateButton ( 0.035 * px , 0.65 * py , 0.22 * px , 0.05 * py , "Zaloguj" , true )
rejestruj = guiCreateButton ( 0.035 * px , 0.75 * py , 0.22 * px , 0.05 * py , "Rejestruj" , true )
dx s? git ale Button i Edit nie
Usu? *px, *py z button?w, editbox?w t?umaczylem ci przecie?, ?e jak maj? relative zaznaczone to nie dziala. Usu? przecie? masz relative na true i skaluje ci to. W cegui relative dobrze skaluje.
Tagi: skalowanie :: guicreateedit :: guicreatebutton
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: