Evaldas101 Posted February 28, 2014 Posted February 28, 2014 Hi all, I'm new at MTA, P.S I'm did't know good english language, sorry for this, My question was this: How to do that photo was for these figures? ( Forest, Industry..); I'm want to make a picture like this: guiCreateStaticImage( 0, 0, 1920, 1200, "login_bg.jpeg", false ) It's my code: -- SELECTION DRAW -- -- IMAGES -- --EXAMPLE -- -- bool dxDrawImage ( float posX, float posY, float width, float height, mixed image [, float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, int color = tocolor(255,255,255), bool postGUI = false ] ) -- local sx, sy = guiGetScreenSize() dxDrawImage(sx/2-(275/599*sx), sy/2-(200/576*sy), 309/1600*sx, 174/900*sy, "data/img/selection_forest.jpg", 0, 0, 0, tocolor(255, 255, 255, alpha_selection["forest"])) dxDrawImage(sx/2-(275/599*sx), sy/2-(80/900*sy), 309/1600*sx, 174/900*sy, "data/img/selection_industry.jpg", 0, 0, 0, tocolor(255, 255, 255, alpha_selection["industry"])) --dxDrawImage(sx/2-(275/1600*sx), sy/2-(-40/900*sy), 501/1600*sx, 103/900*sy, "data/img/selection_forest.jpg", 0, 0, 0, tocolor(255, 255, 255, alpha_selection["forestas"]))-- dxDrawImage(sx/2-(275/599*sx), sy/2-(-170/900*sy), 309/1600*sx, 174/900*sy, "data/img/selection_forest.jpg", 0, 0, 0, tocolor(255, 255, 255, alpha_selection["forestass"])) -- TEXT -- local scale = 0.5/1600*sx dxDrawText("CHOOSE A MAP", sx/2-(200/1600*sx), sy/2-(300/900*sy), sx/2, sy/2, tocolor(255, 255, 255), scale, slender_font) scale = 0.3/1600*sx dxDrawText("FOREST", sx/2-(270/1600*sx), sy/2-(125/900*sy), sx/2, sy/2, tocolor(255, 255, 255, alpha_selection["forest"]), scale, slender_font) dxDrawText("INDUSTRY", sx/2-(270/1600*sx), sy/2-(5/900*sy), sx/2, sy/2, tocolor(255, 255, 255, alpha_selection["forest"]), scale, slender_font) dxDrawText("FOREST", sx/2-(270/1600*sx), sy/2-(-115/900*sy), sx/2, sy/2, tocolor(255, 255, 255, alpha_selection["forest"]), scale, slender_font) end end me goes like this: But I'want to make like this: And again sorry for my bad english.
Evaldas101 Posted February 28, 2014 Author Posted February 28, 2014 Now I get this: Russian: Я хочу наставить ето как background, ( хочу, чтоб ето был фоновои рисунок )
Karuzo Posted February 28, 2014 Posted February 28, 2014 You did it like this ? guiCreateStaticImage( 0, 0, 1920, 1080, "login_bg.jpeg", false )
WhoAmI Posted February 28, 2014 Posted February 28, 2014 Its better to do local x,y = guiGetScreenSize() guiCreateStaticImage( 0, 0, x, y, "login_bg.jpeg", false ) But whatever...
Karuzo Posted February 28, 2014 Posted February 28, 2014 As far as i know the max - resolution in MTA is 1920x1080 so i think it's the same.
Moderators Citizen Posted February 28, 2014 Moderators Posted February 28, 2014 As far as i know the max - resolution in MTA is 1920x1080 so i think it's the same. So if a player comes with a resoultion of 800 x 600, what will happen ? Yeah, it will draw the image at 1920 x 1080. To make the image filling the screen perfectly, use the WhoAmI's code. @Evaldas101: can you upload your login_bg.jpeg on an image hoster like imgur.com ? To know what we are trying to deal with.
Evaldas101 Posted March 1, 2014 Author Posted March 1, 2014 http://imgur.com/oBFSSEg , You do not understand me. I want to be the background for the pictures, RUS : Вы меня не понимаете. Я хочу чтоб ето был фон за теми фотографиами.. POLISH: Wy mnie nie rozumiecie, chcę by ten background (fon) byl za tymi zdjęciami, (listitem te zdęcia) (Forest, Industry, gdzie MAP wybierac)
WhoAmI Posted March 1, 2014 Posted March 1, 2014 local x,y = guiGetScreenSize() local image = guiCreateStaticImage( 0, 0, x, y, "login_bg.jpeg", false ) guiMoveToBack(image)
Evaldas101 Posted March 1, 2014 Author Posted March 1, 2014 Now I get this in MTA: http://imgur.com/Via3y2p , -- BACKGROUND -- local x,y = guiGetScreenSize() local backgroundas = guiCreateStaticImage( 0, 0, x, y, "login_bg.jpeg", false ) guiMoveToBack(backgroundas) But I want to make like this: http://imgur.com/7YrYyTH
Evaldas101 Posted March 1, 2014 Author Posted March 1, 2014 Now I get this in MTA: http://imgur.com/Via3y2p , -- BACKGROUND -- local x,y = guiGetScreenSize() local backgroundas = guiCreateStaticImage( 0, 0, x, y, "login_bg.jpeg", false ) guiMoveToBack(backgroundas) But I want to make like this: http://imgur.com/7YrYyTH Help please.
pa3ck Posted March 1, 2014 Posted March 1, 2014 Use guiCreateStaticImage and set the selection pictures to the parent of the background.
Evaldas101 Posted March 1, 2014 Author Posted March 1, 2014 I'm new at MTA scripting, can you make the code for me? Plzz.
WASSIm. Posted March 1, 2014 Posted March 1, 2014 I'm new at MTA scripting, can you make the code for me? Plzz. just use GUI Editor is better and esay
Moderators Citizen Posted March 1, 2014 Moderators Posted March 1, 2014 Or just set the postGUI argument to true ... -- SELECTION DRAW -- -- IMAGES -- --EXAMPLE -- -- bool dxDrawImage ( float posX, float posY, float width, float height, mixed image [, float rotation = 0, float rotationCenterOffsetX = 0, float rotationCenterOffsetY = 0, int color = tocolor(255,255,255), bool postGUI = false ] ) -- local sx, sy = guiGetScreenSize() dxDrawImage(sx/2-(275/599*sx), sy/2-(200/576*sy), 309/1600*sx, 174/900*sy, "data/img/selection_forest.jpg", 0, 0, 0, tocolor(255, 255, 255, alpha_selection["forest"]), true) dxDrawImage(sx/2-(275/599*sx), sy/2-(80/900*sy), 309/1600*sx, 174/900*sy, "data/img/selection_industry.jpg", 0, 0, 0, tocolor(255, 255, 255, alpha_selection["industry"]), true) --dxDrawImage(sx/2-(275/1600*sx), sy/2-(-40/900*sy), 501/1600*sx, 103/900*sy, "data/img/selection_forest.jpg", 0, 0, 0, tocolor(255, 255, 255, alpha_selection["forestas"]), true)-- dxDrawImage(sx/2-(275/599*sx), sy/2-(-170/900*sy), 309/1600*sx, 174/900*sy, "data/img/selection_forest.jpg", 0, 0, 0, tocolor(255, 255, 255, alpha_selection["forestass"]), true) -- TEXT -- local scale = 0.5/1600*sx dxDrawText("CHOOSE A MAP", sx/2-(200/1600*sx), sy/2-(300/900*sy), sx/2, sy/2, tocolor(255, 255, 255), scale, slender_font, "left", "top", false, false, true) scale = 0.3/1600*sx dxDrawText("FOREST", sx/2-(270/1600*sx), sy/2-(125/900*sy), sx/2, sy/2, tocolor(255, 255, 255, alpha_selection["forest"]), scale, slender_font, "left", "top", false, false, true) dxDrawText("INDUSTRY", sx/2-(270/1600*sx), sy/2-(5/900*sy), sx/2, sy/2, tocolor(255, 255, 255, alpha_selection["forest"]), scale, slender_font, "left", "top", false, false, true) dxDrawText("FOREST", sx/2-(270/1600*sx), sy/2-(-115/900*sy), sx/2, sy/2, tocolor(255, 255, 255, alpha_selection["forest"]), scale, slender_font, "left", "top", false, false, true) end end
pa3ck Posted March 1, 2014 Posted March 1, 2014 Why would you use dxDrawImage if you could use GUI? Its much handier, you don't need onClientRender or any events like that and you could easily use onClientGUIClick to spawn the player at the right place according to the image. But, you can choose the hard way.
Moderators Citizen Posted March 1, 2014 Moderators Posted March 1, 2014 Why would you use dxDrawImage if you could use GUI? Its much handier, you don't need onClientRender or any events like that and you could easily use onClientGUIClick to spawn the player at the right place according to the image. But, you can choose the hard way. It wasn't my choice, that was how this script was initially made. Didn't want him to think he couldn't do that with dx functions.
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