Otto Posted October 28, 2011 Share Posted October 28, 2011 (edited) Ok, I think most of the people here has played on DKR, or checked out it. (Sorry for bad english) What I mean here is that, I wanna make a logo on some corner of the screen, that appears all the time since you connect, up you disconnect. I'll do the image, based on the DKR one: I think you have seen it. How can I script something for showing this logo? (The one I'll photoshop with the same sizes). Edited October 30, 2011 by Guest Link to comment
Castillo Posted October 28, 2011 Share Posted October 28, 2011 You can use one of these functions: guiCreateStaticImage dxDrawImage Link to comment
Otto Posted October 28, 2011 Author Share Posted October 28, 2011 You can use one of these functions: guiCreateStaticImage dxDrawImage So, the name of the image will be fgislogo.png How can I add it to the script? Link to comment
12p Posted October 28, 2011 Share Posted October 28, 2011 Click the names of those functions. Also, check this: https://wiki.multitheftauto.com/wiki/Scr ... troduction Then, check this: https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI Link to comment
Otto Posted October 28, 2011 Author Share Posted October 28, 2011 Click the names of those functions.Also, check this: https://wiki.multitheftauto.com/wiki/Scr ... troduction Then, check this: https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI I did, but I don't understand, that's why I'm asking. Link to comment
Castillo Posted October 28, 2011 Share Posted October 28, 2011 (edited) What don't you understand? is really easy to create a simple logo in the screen. Edited October 29, 2011 by Guest Link to comment
12p Posted October 28, 2011 Share Posted October 28, 2011 What you don't understand? is really easy to create a simple logo in the screen. It's probably one of the simplest scripting tasks, as far as I know. The easiest is creating announces in the chat BTW, Castillo, it's "What DON'T YOU", not "what you don't". Link to comment
Maurize Posted October 29, 2011 Share Posted October 29, 2011 -.- addEventHandler( "onClientRender", getLocalPlayer(), function() dxDrawImage( ... ) end ) Thats all. ( Do it for ur self. it is only the syntax. ) Link to comment
CapY Posted October 29, 2011 Share Posted October 29, 2011 Ok, I think most of the people here has played on DKR, or checked out it. (Sorry for bad english) What I mean here is that, I wanna make a logo on some corner of the screen, that appears all the time since you connect, up you disconnect. I'll do the image, based on the DKR one: I think you have seen it. How can I script something for showing this logo? (The one I'll photoshop with the same sizes). Wiki, start with basics first. Link to comment
12p Posted October 29, 2011 Share Posted October 29, 2011 -.-addEventHandler( "onClientRender", getLocalPlayer(), function() dxDrawImage( ... ) end ) Thats all. ( Do it for ur self. it is only the syntax. ) Easier. Just add this code to any client script: sw, sh = guiGetScreenSize ( ) width, height = guiGetSize ( IMAGEPATH ) --IMAGEPATH is the path of the logo (e.g. "logo.png") guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, false ) and create a meta.xml that includes that file. Link to comment
Otto Posted October 29, 2011 Author Share Posted October 29, 2011 Let me see: sw, sh = guiGetScreenSize ( ) width, height = guiGetSize ( fgislogo.png ) guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, 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 ) Something like that? Link to comment
Castillo Posted October 29, 2011 Share Posted October 29, 2011 "width, height = guiGetSize ( fgislogo.png )" ? what is that? you can't get the size from a image file.. you need a valid GUI element. Link to comment
Otto Posted October 29, 2011 Author Share Posted October 29, 2011 "width, height = guiGetSize ( fgislogo.png )" ? what is that? you can't get the size from a image file.. you need a valid GUI element. sw, sh = guiGetScreenSize ( ) width, height = guiGetSize ( theElement ) guiCreateStaticImage ( sw - ( width / 2 ), sh - ( height / 2 ) , width, height, 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 ) Like.. Have you got Skype? So I changed it to "theElement". How can the program know that "theElement" is "fgislogo.png" ? Link to comment
Castillo Posted October 29, 2011 Share Posted October 29, 2011 It can't detect because is not a ELEMENT! try something like this: 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 ) the width and height had to be configured by yourself. Link to comment
Callum Posted October 30, 2011 Share Posted October 30, 2011 You may find resources created for this purpose on the MTA Community Website. Link to comment
Otto Posted October 30, 2011 Author Share Posted October 30, 2011 Ok guys, thanks for attention, I have finished it. Then I'll upload it to MTA Communiry site once it's finished. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now