Jump to content

dxDrawImage cut images, not resize


Noneatme

Recommended Posts

Hello there,

I'm currently stuck in one problem.

I want to create nametags, but the problem is the following:

This is my nametag-bar.

bar10jsgu.png

When I change the width of the nametag images, this happens:

bar2p5six.png

The image resizes, and gets squeezed.

But I want that this happens:

bar338s7m.png

(Same size, but the image gets cut instead of squeezed)

I hope somebody understand what I mean.

If somebody have an idea, that would be great.

I know that this is possible with the dxDrawImageSection function, but I have no idea how to apply 8 params to this function.

Greetings

Link to comment
Thanks for the reply
I know that this is possible with the dxDrawImageSection function, but I have no idea how to apply 8 params to this function.

Oh, sorry, i guess i should have read the whole message... But here would be an example:

--bool dxDrawImageSection ( float posX, float posY, float width, float height, float u, float v, float usize, float vsize, mixed image ) 
dxDrawImageSection ( 0, 0, 500, 100, 50, 50, 50, 50, "picture.png" )--I think this would wok lolz 
  

Link to comment

Thanks, I got it.

dxDrawImageSection ( sx-width/2, sy-height/2, width/100*getElementHealth(ped), height, 0, 0, 256/100*getElementHealth(ped), 128, "files/images/hud_healthbar_healthfull.png", 0, 0, 0, color ) 
             

That was crazy 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...