Otto Posted October 29, 2011 Posted October 29, 2011 (edited) Bueno, el logo es el tipico de el DKR que aparece abajo a la derecha, y el script que tengo hasta ahora, es este: local sw, sh = guiGetScreenSize ( ) local width, height = 200, 31 guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, "fgislogo.png", false ) function checkResolutionOnStart ( theResource ) if theResource ~= getThisResource() then return end local x,y = guiGetScreenSize() if ( x <= 640 ) and ( y <= 480 ) then outputChatBox ( "Wait! You are running this game with a low resolution. Some things would not appear on your screen. Turn resolution more than 640x480 if you can." ) end end addEventHandler ( "onClientResourceStart", getRootElement(), checkResolutionOnStart ) La imagen es esta: Y se va a llamar "fgislogo.png" Bueno, ahora dos cosas: 1) ¿Esta bien el script? 2) ¿Que hago en el meta.xml para que LUA reconosca a fgislogo.png como "theElement"? Desde ya gracias. Edited October 29, 2011 by Guest Ingame name: Otto State: Inactive Web designer. Playing MTA:SA since 2008.
Castillo Posted October 29, 2011 Posted October 29, 2011 Simple, no lo haces, cuando Benxamix te dio el codigo se equivoco, no es el 'image path' lo que necesitas, sino el elemento GUI del que queres extraer el tamaño. local sw, sh = guiGetScreenSize ( ) local width, height = 20, 30 guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, "fgislogo.png", false ) function checkResolutionOnStart ( theResource ) if theResource ~= getThisResource() then return end local x,y = guiGetScreenSize() if ( x <= 640 ) and ( y <= 480 ) then outputChatBox ( "Wait! You are running this game with a low resolution. Some things would not appear on your screen. Turn resolution more than 640x480 if you can." ) end end addEventHandler ( "onClientResourceStart", getRootElement(), checkResolutionOnStart ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Otto Posted October 29, 2011 Author Posted October 29, 2011 local width, height = 20, 30 guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, "fgislogo.png", false ) El local width, height = 20, 30 es donde va a estar en la pantalla y el ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, (etc..) el tamaño de la imagen? Ingame name: Otto State: Inactive Web designer. Playing MTA:SA since 2008.
Castillo Posted October 29, 2011 Posted October 29, 2011 Lo hiciste todo alrevez... width, height = tamaño. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Otto Posted October 29, 2011 Author Posted October 29, 2011 Lo hiciste todo alrevez... width, height = tamaño. Pero no me respondes a la pregunta, a lo que me refiero es cual es cual. Si el segundo es para la imagen y si el 1 es para la posicion en la pantalla. Ingame name: Otto State: Inactive Web designer. Playing MTA:SA since 2008.
Castillo Posted October 29, 2011 Posted October 29, 2011 Creo que ya responde a la pregunta, el width y height es el tamaño, y el otro se responde por si solo, yo diria. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Otto Posted October 29, 2011 Author Posted October 29, 2011 Lo hiciste todo alrevez... width, height = tamaño. Pero no me respondes a la pregunta, a lo que me refiero es cual es cual. Si el segundo es para la imagen y si el 1 es para la posicion en la pantalla. guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, "fgislogo.png", false ) es para la imagen local width, height = 20, 30 es para la poseción en la pantalla entonces. Ingame name: Otto State: Inactive Web designer. Playing MTA:SA since 2008.
12p Posted October 29, 2011 Posted October 29, 2011 No. width, height = tamaño de la imagen sw, sh = tamaño de la pantalla El script que te di es para que tu logo quepa justo en la posicion inferior derecha de la pantalla, sin pixeles de mas o de menos. Puedes modificar esto en los primeros 2 argumentos de guiCreateStaticPosition, usando "- valor" ejemplo: sw - ( width / 2 ) - 15 Para tirar el logo 15 pixeles mas a la izquierda
Otto Posted October 29, 2011 Author Posted October 29, 2011 Algo así? local sw, sh = guiGetScreenSize ( ) local width, height = 200, 31 guiCreateStaticImage ( sw - 15 ( width / 2 ), sh - ( height / 2 ) , width, height, "fgislogo.png", false ) function checkResolutionOnStart ( theResource ) if theResource ~= getThisResource() then return end local x,y = guiGetScreenSize() if ( x <= 640 ) and ( y <= 480 ) then outputChatBox ( "Wait! You are running this game with a low resolution. Some things would not appear on your screen. Turn resolution more than 640x480 if you can." ) end end addEventHandler ( "onClientResourceStart", getRootElement(), checkResolutionOnStart ) Ingame name: Otto State: Inactive Web designer. Playing MTA:SA since 2008.
Castillo Posted October 29, 2011 Posted October 29, 2011 En lugar de preguntar porque no lo pruebas? es mas rapido y mas informativo. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Otto Posted October 29, 2011 Author Posted October 29, 2011 En lugar de preguntar porque no lo pruebas? es mas rapido y mas informativo. Donde pongo el script? En MTA:SA FOLDER > Server > Mods > Deathmatch > resources ? Ingame name: Otto State: Inactive Web designer. Playing MTA:SA since 2008.
Castillo Posted October 30, 2011 Posted October 30, 2011 Si, leete esto para aprender como funciona el sistema de recursos: https://wiki.multitheftauto.com/wiki/ES/Resources San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Otto Posted October 30, 2011 Author Posted October 30, 2011 Gracias capo. Cuando termine esto abro un post por el meta, exitos! Ingame name: Otto State: Inactive Web designer. Playing MTA:SA since 2008.
Recommended Posts