Jump to content

Crosshair editor


Lachuks

Recommended Posts

Hello Emix,

  • you could use the MTA community freecam resource to let the user see for himself how the rendered image looks on all kinds of game texture background. Just let him move the camera around and see if he likes the crosshair!
  • crosshairs are typically drawn in the center of the game screen, the image itself being centered. I recommend you to use the dxDrawImage function to draw the crosshair along with the dxCreateTexture function to load the image into game memory.
  • use the guiGetScreenSize function to get the size of the game screen. The middle of the screen is the halfed screen size. To get the centered-image-position just subtract the halfed image size from the centered image position. You can obtain the image size using the dxGetMaterialSize function.
Edited by The_GTA
  • Thanks 1
Link to comment
10 minutes ago, Emix said:

Crosshair is not really centered but I'll take ur idea about hiding crosshair and overdrawing with image or dxDraw stuff.

Thank you buddy! :) 

Oh, haha! I agree with you! This is a nice example how you can draw it at a different place than the game screen center. But make sure that the crosshair does really point at the location that the bullet will fly to. Not sure about the math but you will figure it out I guess, in the worst case using trial & error.

You're welcome!

Edited by The_GTA
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...