Mateito14 Posted October 14, 2015 Share Posted October 14, 2015 Hola estoy creando mi primer panel DX y me fue bien, configure para que se vea bien en todas las resoluciones pero al probar el panel en otra resolución se ve mal. Les dejo unas fotos 1366x768 resolución donde cree el panel 1024x768 resolución donde probé el panel Acá les dejo una parte del script function window () scX, scY = guiGetScreenSize() local screenX = 1366 local screenY = 768 local sx = 1/screenX local sy = 1/screenY xdDrawAnimWindow("Panel de armas", scX * (345*sx), scY * (364*sy), tocolor(51, 51, 51, 200),"default-bold","OutBack") end --botones function gui() local ancho, alto = guiGetScreenSize () alphaQuit = 200 alphaKnife = 200 alphaKatana = 200 alphaPistola = 200 alphaPistolaS = 200 alphaDeagle = 200 alphaTec = 200 alphaMP5 = 200 quit = guiCreateButton(0.615*ancho, 0.256*alto, 0.017*ancho, 0.031*alto, "", false) addEventHandler("onClientGUIClick",quit,onClickQuit) addEventHandler( "onClientMouseEnter",quit,onEnterQuit) addEventHandler("onClientMouseLeave",quit,onLeaveQuit) knife = guiCreateButton(531, 242, 126, 20, "", false) addEventHandler("onClientGUIClick",knife,onClickknife) addEventHandler( "onClientMouseEnter",knife,onEnterknife) addEventHandler("onClientMouseLeave",knife,onLeaveknife) guiSetAlpha(quit, 0) guiSetAlpha(knife, 0) end --botones dx function dxgui() scX, scY = guiGetScreenSize() local screenX = 1366 local screenY = 768 local sx = 1/screenX local sy = 1/screenY dxDrawRectangle(scX * (841*sx), scY * (194*sy), scX * (24*sx), scY * (24*sy), tocolor(255, 0, 0, alphaQuit)) dxDrawText("X", scX * (841*sx), scY * (194*sy), scX * (865*sx), scY * (221*sy), tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center") dxDrawRectangle(scX * (531*sx), scY * (242*sy), scX * (126*sx), scY * (20*sy), tocolor(255, 255, 255, alphaKnife)) --KNIFE dxDrawText("Knife LVL:1", scX * (534*sx), scY * (242*sy), scX * (653*sx), scY *(261*sy), tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center") end function onClickQuit() cerrarTodo() end function onEnterQuit() alphaQuit = 255 end function onLeaveQuit() alphaQuit = 200 end function onEnterknife() alphaKnife = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveknife() alphaKnife = 200 end function main(key, keyState) showCursor(true) removeEventHandler("onClientRender", getRootElement(), dxgui) removeEventHandler("onClientRender", getRootElement(), window) start = getTickCount() addEventHandler("onClientRender", getRootElement(), window) setTimer ( function() local sound = playSound("open.wav") setSoundVolume(sound, 1.0) end, 800, 1 ) setTimer ( function() guiContenido() addEventHandler ( "onClientRender", getRootElement(), dxgui ) end, 1500, 1 ) end bindKey ( "F2", "down", main ) function cerrarTodo() showCursor(false) removeEventHandler("onClientRender", getRootElement(), dxgui) removeEventHandler("onClientRender", getRootElement(), window) start2 = getTickCount() addEventHandler ( "onClientRender", getRootElement(), cerrar ) setTimer ( function() removeEventHandler("onClientRender", getRootElement(), cerrar) end, 1500, 1 ) end function xdDrawAnimWindow(text,alto,ancho,color,font,anim) local x, y = guiGetScreenSize() btAncho = ancho btAlto = alto/20 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, anim) local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btAncho, btAlto, btAlto/11, progress, anim) posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawRectangle ( posx, posy-y2, x2, y2, color ) dxDrawRectangle ( posx, posy, x1, y1, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( text, 0, -(y1)-y2, x, y, tocolor ( 255, 255, 255, 255 ), z2, font,"center","center") end function cerrar() ancho = 345 alto = 364 local now2 = getTickCount() local elapsedTime2 = now2 - start2 local endTime2 = start2 + 1500 local duration2 = endTime2 - start2 local progress2 = elapsedTime2 / duration2 local x3, y3, z3 = interpolateBetween ( ancho, alto, 0, 0, 0, 0, progress2, "OutBack") posx = (x/2)-(x3/2) posy = (y/2)-(y3/2) dxDrawRectangle ( posx, posy, x3, y3, tocolor ( 0, 0, 0, 200 ) ) end Que mas tengo que configurar para que se vea bien? Link to comment
Enargy, Posted October 14, 2015 Share Posted October 14, 2015 En lugar de hacer toda la aritmética en cada argumento, reescribe la función. local _dxDrawRectangle = dxDrawRectangle local _dxDrawText = dxDrawText function dxDrawRectangle( x, y, w, h, color, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx/ 1024 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawRectangle( x, y, w, h, color, postGUI ); end function dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx / 1024 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI); end Sintaxis: bool dxDrawText ( string text, float left, float top [, float right=left, float bottom=top, int color=white, float scale=1, mixed font="default", string alignX="left", string alignY="top", bool clip=false, bool wordBreak=false, bool postGUI=false, bool colorCoded=false, bool subPixelPositioning=false, float fRotation=0, float fRotationCenterX=0, float fRotationCenterY=0 ], bool relative=false ) bool dxDrawRectangle ( float startX, float startY, float width, float height [, int color = white, bool postGUI = false, bool subPixelPositioning = false ], bool relative=false ) Al usar el código no hace falta hacer ningún calculo. local _dxDrawRectangle = dxDrawRectangle local _dxDrawText = dxDrawText function dxDrawRectangle( x, y, w, h, color, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx/ 1024 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawRectangle( x, y, w, h, color, postGUI ); end function dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx / 1024 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI); end function window () scX, scY = guiGetScreenSize() local screenX = 1366 local screenY = 768 local sx = scX/screenX local sy = scY/screenY xdDrawAnimWindow("Panel de armas", 345*sx, 364*sy, tocolor(51, 51, 51, 200),"default-bold","OutBack") end function dxgui() dxDrawRectangle(841, 194, 24, 24, tocolor(255, 0, 0, alphaQuit), false, true) dxDrawText("X", 841, 194, 865, 221, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 242, 126, 20, tocolor(255, 255, 255, alphaKnife), false, true) --KNIFE dxDrawText("Knife LVL:1", 534, 242, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) end EDIT: quit = guiCreateButton(0.615*ancho, 0.256*alto, 0.017*ancho, 0.031*alto, "", false) Si cambias false por true, no hace falta hacer la aritmética en sí. Link to comment
Mateito14 Posted October 14, 2015 Author Share Posted October 14, 2015 En lugar de hacer toda la aritmética en cada argumento, reescribe la función. local _dxDrawRectangle = dxDrawRectangle local _dxDrawText = dxDrawText function dxDrawRectangle( x, y, w, h, color, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx/ 1024 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawRectangle( x, y, w, h, color, postGUI ); end function dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx / 1024 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI); end Sintaxis: bool dxDrawText ( string text, float left, float top [, float right=left, float bottom=top, int color=white, float scale=1, mixed font="default", string alignX="left", string alignY="top", bool clip=false, bool wordBreak=false, bool postGUI=false, bool colorCoded=false, bool subPixelPositioning=false, float fRotation=0, float fRotationCenterX=0, float fRotationCenterY=0 ], bool relative=false ) bool dxDrawRectangle ( float startX, float startY, float width, float height [, int color = white, bool postGUI = false, bool subPixelPositioning = false ], bool relative=false ) Al usar el código no hace falta hacer ningún calculo. local _dxDrawRectangle = dxDrawRectangle local _dxDrawText = dxDrawText function dxDrawRectangle( x, y, w, h, color, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx/ 1024 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawRectangle( x, y, w, h, color, postGUI ); end function dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx / 1024 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI); end function window () scX, scY = guiGetScreenSize() local screenX = 1366 local screenY = 768 local sx = scX/screenX local sy = scY/screenY xdDrawAnimWindow("Panel de armas", 345*sx, 364*sy, tocolor(51, 51, 51, 200),"default-bold","OutBack") end function dxgui() dxDrawRectangle(841, 194, 24, 24, tocolor(255, 0, 0, alphaQuit), false, true) dxDrawText("X", 841, 194, 865, 221, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 242, 126, 20, tocolor(255, 255, 255, alphaKnife), false, true) --KNIFE dxDrawText("Knife LVL:1", 534, 242, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) end EDIT: quit = guiCreateButton(0.615*ancho, 0.256*alto, 0.017*ancho, 0.031*alto, "", false) Si cambias false por true, no hace falta hacer la aritmética en sí. Cambie todo pero se sigue viendo así Link to comment
Mateito14 Posted October 14, 2015 Author Share Posted October 14, 2015 Postea lo que hiciste. Es como que se ajusta todo menos el dxDrawRectangle principal que tiene la animación. function window () scX, scY = guiGetScreenSize() local screenX = 1366 local screenY = 768 local sx = 1/screenX local sy = 1/screenY xdDrawAnimWindow("Panel de armas", scX * (345*sx), scY * (364*sy), tocolor(51, 51, 51, 200),"default-bold","OutBack") end function gui() alphaQuit = 200 alphaKnife = 200 alphaKatana = 200 alphaPistola = 200 alphaPistolaS = 200 alphaDeagle = 200 alphaTec = 200 alphaMP5 = 200 quit = guiCreateButton(0.615, 0.256, 0.017, 0.031, "", true) addEventHandler("onClientGUIClick",quit,onClickQuit) addEventHandler( "onClientMouseEnter",quit,onEnterQuit) addEventHandler("onClientMouseLeave",quit,onLeaveQuit) knife = guiCreateButton(531, 242, 126, 20, "", false) addEventHandler("onClientGUIClick",knife,onClickknife) addEventHandler( "onClientMouseEnter",knife,onEnterknife) addEventHandler("onClientMouseLeave",knife,onLeaveknife) katana = guiCreateButton(531, 272, 126, 20, "", false) addEventHandler("onClientGUIClick",katana,onClickKatana) addEventHandler( "onClientMouseEnter",katana,onEnterKatana) addEventHandler("onClientMouseLeave",katana,onLeaveKatana) pistola = guiCreateButton(531, 302, 126, 20, "", false) addEventHandler("onClientGUIClick",pistola,onClickPistola) addEventHandler( "onClientMouseEnter",pistola,onEnterPistola) addEventHandler("onClientMouseLeave",pistola,onLeavePistola) pistolas = guiCreateButton(531, 332, 126, 20, "", false) addEventHandler("onClientGUIClick",pistolas,onClickPistolaS) addEventHandler( "onClientMouseEnter",pistolas,onEnterPistolaS) addEventHandler("onClientMouseLeave",pistolas,onLeavePistolaS) deagle = guiCreateButton(531, 362, 126, 20, "", false) addEventHandler("onClientGUIClick",deagle,onClickDeagle) addEventHandler( "onClientMouseEnter",deagle,onEnterDeagle) addEventHandler("onClientMouseLeave",deagle,onLeaveDeagle) tec = guiCreateButton(531, 392, 126, 20, "", false) addEventHandler("onClientGUIClick",tec,onClickTec) addEventHandler( "onClientMouseEnter",tec,onEnterTec) addEventHandler("onClientMouseLeave",tec,onLeaveTec) mp5 = guiCreateButton(531, 422, 126, 20, "", false) addEventHandler("onClientGUIClick",mp5,onClickMP5) addEventHandler( "onClientMouseEnter",mp5,onEnterMP5) addEventHandler("onClientMouseLeave",mp5,onLeaveMP5) uzi = guiCreateButton(710, 242, 126, 20, "", false) addEventHandler("onClientGUIClick",uzi,onClickUzi) addEventHandler( "onClientMouseEnter",uzi,onEnterUzi) addEventHandler("onClientMouseLeave",uzi,onLeaveUzi) shotgun = guiCreateButton(710, 272, 126, 20, "", false) addEventHandler("onClientGUIClick",shotgun,onClickSht) addEventHandler( "onClientMouseEnter",shotgun,onEnterSht) addEventHandler("onClientMouseLeave",shotgun,onLeaveSht) spaz = guiCreateButton(710, 302, 126, 20, "", false) addEventHandler("onClientGUIClick",spaz,onClickSpaz) addEventHandler( "onClientMouseEnter",spaz,onEnterSpaz) addEventHandler("onClientMouseLeave",spaz,onLeaveSpaz) recortada = guiCreateButton(710, 332, 126, 20, "", false) addEventHandler("onClientGUIClick",recortada,onClickRec) addEventHandler( "onClientMouseEnter",recortada,onEnterRec) addEventHandler("onClientMouseLeave",recortada,onLeaveRec) m4 = guiCreateButton(710, 362, 126, 20, "", false) addEventHandler("onClientGUIClick",m4,onClickM4) addEventHandler( "onClientMouseEnter",m4,onEnterM4) addEventHandler("onClientMouseLeave",m4,onLeaveM4) ak = guiCreateButton(710, 392, 126, 20, "", false) addEventHandler("onClientGUIClick",ak,onClickAK) addEventHandler( "onClientMouseEnter",ak,onEnterAK) addEventHandler("onClientMouseLeave",ak,onLeaveAK) sniper = guiCreateButton(710, 422, 126, 20, "", false) addEventHandler("onClientGUIClick",sniper,onClickSnp) addEventHandler( "onClientMouseEnter",sniper,onEnterSnp) addEventHandler("onClientMouseLeave",ak,onLeaveSnp) guiSetAlpha(quit, 0) guiSetAlpha(knife, 0) guiSetAlpha(katana, 0) guiSetAlpha(pistola, 0) guiSetAlpha(pistolas, 0) guiSetAlpha(deagle, 0) guiSetAlpha(tec, 0) guiSetAlpha(mp5, 0) guiSetAlpha(uzi, 0) guiSetAlpha(shotgun, 0) guiSetAlpha(spaz, 0) guiSetAlpha(recortada, 0) guiSetAlpha(m4, 0) guiSetAlpha(ak, 0) guiSetAlpha(sniper, 0) end local _dxDrawRectangle = dxDrawRectangle local _dxDrawText = dxDrawText function dxDrawRectangle( x, y, w, h, color, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx/ 1366 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawRectangle( x, y, w, h, color, postGUI ); end function dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI, relative ) if ( relative ) then sx, sy = guiGetScreenSize() pX, pY = ( sx / 1366 ), ( sy / 768 ) x, y, w, h = pX*x, pY*y, pX*w, pY*h end _dxDrawText( txt, x, y, w, h, color, size, font, align, bottom, clip, wordwrap, colorCode, postGUI); end function dxgui() dxDrawRectangle(841, 194, 24, 24, tocolor(255, 0, 0, alphaQuit), false, true) dxDrawText("X", 841, 194, 865, 221, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, true) --botones --izquierda dxDrawRectangle(531, 242, 126, 20, tocolor(255, 255, 255, alphaKnife), false, true) --KNIFE dxDrawText("Knife LVL:1", 534, 242, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 272, 126, 20, tocolor(255, 255, 255, alphaKatana), false, true) --katana dxDrawText("Katana LVL:1", 534, 302, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 302, 126, 20, tocolor(255, 255, 255, alphaPistola), false, true) --pistola dxDrawText("Pistola LVL:1", 534, 362, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 332, 126, 20, tocolor(255, 255, 255, alphaPistolaS), false, true) --pistolaS dxDrawText("Pistola S LVL:1", 534, 422, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 362, 126, 20, tocolor(255, 255, 255, alphaDeagle), false, true) --Deagle dxDrawText("Deagle LVL:1", 534, 482, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 392, 126, 20, tocolor(255, 255, 255, alphaTec), false, true) --Tec dxDrawText("Tec-9 LVL:1", 534, 542, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(531, 422, 126, 20, tocolor(255, 255, 255, alphaMP5), false, true) --MP5 dxDrawText("MP5 LVL:1", 534, 602, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) --derecha dxDrawRectangle(710, 242, 126, 20, tocolor(255, 255, 255, alphaUzi), false, true)--Uzi dxDrawText("Uzi LVL:1", 892, 242, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 272, 126, 20, tocolor(255, 255, 255, alphaSht), false, true) --Shotgun dxDrawText("Shotgun LVL:1", 892, 302, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 302, 126, 20, tocolor(255, 255, 255, alphaSpz), false, true) --Spaz dxDrawText("Spaz LVL:1", 892, 362, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 332, 126, 20, tocolor(255, 255, 255, alphaRec), false, true) --Recortada dxDrawText("Recortada LVL:1", 892, 422, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 362, 126, 20, tocolor(255, 255, 255, alphaM4), false, true) --M4 dxDrawText("M4 LVL:1", 892, 482, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 392, 126, 20, tocolor(255, 255, 255, alphaAk), false, true) --ak47 dxDrawText("AK-47 LVL:1", 892, 542, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) dxDrawRectangle(710, 422, 126, 20, tocolor(255, 255, 255, alphaSnp), false, true) --Sniper dxDrawText("Sniper LVL:1", 892, 602, 653, 261, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center", false, false, false, false, true) end --botones function onClickQuit() hideAll() end function onEnterQuit() alphaQuit = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveQuit() alphaQuit = 200 end function onEnterknife() alphaKnife = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveknife() alphaKnife = 200 end function onEnterKatana() alphaKatana = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveKatana() alphaKatana = 200 end function onEnterPistola() alphaPistola = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeavePistola() alphaPistola = 200 end function onEnterPistolaS() alphaPistolaS = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeavePistolaS() alphaPistolaS = 200 end function onEnterDeagle() alphaDeagle = 255 local sound = playSound("seleccionar.wav") setSoundVolume(sound, 1.0) end function onLeaveDeagle() alphaDeagle = 200 end function onEnterTec() alphaTec = 255 Link to comment
Enargy, Posted October 14, 2015 Share Posted October 14, 2015 Prueba function xdDrawAnimWindow(text,alto,ancho,color,font,anim) btAncho = ancho btAlto = alto/20 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, anim) local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btAncho, btAlto, btAlto/11, progress, anim) dxDrawRectangle ( x1, y2 * 15, x1 - 50, y2 * 15 / 8, color ) dxDrawRectangle ( x1, y2 * 15, x1 - 50, y1, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( text, x1 * 3 - 50, y2 * 15 * 2 + 30, 0, 0, tocolor ( 255, 255, 255, 255 ), z2, font,"center","center") end Link to comment
Mateito14 Posted October 14, 2015 Author Share Posted October 14, 2015 Prueba function xdDrawAnimWindow(text,alto,ancho,color,font,anim) btAncho = ancho btAlto = alto/20 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, anim) local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btAncho, btAlto, btAlto/11, progress, anim) dxDrawRectangle ( x1, y2 * 15, x1 - 50, y2 * 15 / 8, color ) dxDrawRectangle ( x1, y2 * 15, x1 - 50, y1, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( text, x1 * 3 - 50, y2 * 15 * 2 + 30, 0, 0, tocolor ( 255, 255, 255, 255 ), z2, font,"center","center") end Probé y mas o menos se ajusto en la resolución 1024x768 solo que que el botón de cerrar no quedo en la esquina como yo quería y en la resolución 1366x768 quedo todo mal 1366x768 1024x768 Link to comment
Enargy, Posted October 14, 2015 Share Posted October 14, 2015 El error esta en el interpolate, el calculo que haces esta malo. Link to comment
Mateito14 Posted October 14, 2015 Author Share Posted October 14, 2015 El error esta en el interpolate, el calculo que haces esta malo. La verdad es que no entiendo mucho esto de interpolate, logre hacer esto por el video de Bc. Voy a hacer el panel sin la animación, Gracias por la ayuda . Link to comment
Recommended Posts