Jump to content

[HELP]DxDrawImage


spoty

Recommended Posts

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

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
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
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
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

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
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
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 :D

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...