spoty Posted May 8, 2015 Share Posted May 8, 2015 hi i wanted to edit this line from my script so it shows a image inplace of text but i dont know how to edit this because this shows a dxDrawText from x1 to x5 but i wanne replace it with images that shows x1 to x5 can someone help me? or explain me how to do it local temp2 = string.format("Factor: X%d\n%s",mult,mult~=5 and string.format("Gain X%d with %d",mult+1,tablamult[mult]) or "MAX") dxDrawText(temp2, 20,195,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) Link to comment
xXMADEXx Posted May 8, 2015 Share Posted May 8, 2015 What do you mean? You just want to draw images instead of text? Link to comment
spoty Posted May 8, 2015 Author Share Posted May 8, 2015 yeah because right now it says in game X1 gain 350 to get X2 and i wanne just change it all to a image that i already have maded so it shows the X1 image when i gained x1 and when i gain x2 it needs to show to x2 image Link to comment
Walid Posted May 9, 2015 Share Posted May 9, 2015 can you explaine your problem better. Link to comment
spoty Posted May 9, 2015 Author Share Posted May 9, 2015 can you explaine your problem better. i wanne make this line thats crrently showing dxDrawText x1, x2, x3, x4, x5, but i wanne make it showing image's inplace of dxDrawText i have 5 images so how can i make it exact like the line from topic ? Link to comment
Walid Posted May 9, 2015 Share Posted May 9, 2015 can you explaine your problem better. i wanne make this line thats crrently showing dxDrawText x1, x2, x3, x4, x5, but i wanne make it showing image's inplace of dxDrawText i have 5 images so how can i make it exact like the line from topic ? one by one use dxDrawImage() Link to comment
spoty Posted May 9, 2015 Author Share Posted May 9, 2015 can you explaine your problem better. i wanne make this line thats crrently showing dxDrawText x1, x2, x3, x4, x5, but i wanne make it showing image's inplace of dxDrawText i have 5 images so how can i make it exact like the line from topic ? one by one use dxDrawImage() i have this no error's but it isnt working local temp2 = string.format(mult,mult~=5 and string.format(mult+1,tablamult[mult])) dxDrawImage (temp2, 20,195,screenWidth,screenHeight, 'x1.png', false,true,false) Link to comment
Walid Posted May 9, 2015 Share Posted May 9, 2015 dxDrawImage must be like this. local screenWidth, screenHeight = guiGetScreenSize ( ) dxDrawImage (screenWidth*(20/1366),screenHeight*(195/768),screenWidth*(1366/1366),screenHeight*(768/768), 'x1.png',0,0,0, tocolor(255, 255, 255, 255), false) Link to comment
Moderators IIYAMA Posted May 10, 2015 Moderators Share Posted May 10, 2015 local screenWidth, screenHeight = guiGetScreenSize ( ) ----------------------------------------------------------------------------------- -- function -- for i=1,5 do local imageWidth = screenWidth*(1366/1366) dxDrawImage (screenWidth*(20/1366)+((i-1)*imageWidth) ,screenHeight*(195/768),imageWidth,screenHeight*(768/768), 'x' .. i .. '.png',0,0,0, tocolor(255, 255, 255, 255), false) end You image width and height is too BIG/LARGE/Or what ever. You have to fill that in correctly! But this is how you create images next to each other in a line. Link to comment
spoty Posted May 11, 2015 Author Share Posted May 11, 2015 local screenWidth, screenHeight = guiGetScreenSize ( ) ----------------------------------------------------------------------------------- -- function -- for i=1,5 do local imageWidth = screenWidth*(1366/1366) dxDrawImage (screenWidth*(20/1366)+((i-1)*imageWidth) ,screenHeight*(195/768),imageWidth,screenHeight*(768/768), 'x' .. i .. '.png',0,0,0, tocolor(255, 255, 255, 255), false) end You image width and height is too BIG/LARGE/Or what ever. You have to fill that in correctly! But this is how you create images next to each other in a line. ok thnx this is what i needed thnx alot 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