Jump to content

Center image?


Yue
 Share

Go to solution Solved by mdgunn,

Recommended Posts

I'm trying to find the coordinates of the center of the screen to position an image on the lower right side, but this doesn't seem to work, starting with the image not being in the middle of the screen with the following code. 

 

context:DrawImage(hudPlayer, context:GetWidth()/2,context:GetHeight()/2,128,128)

Any suggestions?

image.png.0142799821f6691b7a3efcd08997d3c1.png

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

8 hours ago, mdgunn said:

Is it just that you need to adjust for size of your image because image is placed according to top left corner so minus half the height and width of image to position? 

Ok,  Thanks You.
 

context:DrawImage(hudPlayer,context:GetWidth()-128-15,context:GetHeight()-128,128,128)

image.png.f26ec43bf09ad986fce3aa342abc2902.png

  • Like 1

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...