Lachuks Posted November 22, 2021 Share Posted November 22, 2021 Hey there! Want to make ingame crosshair editor like ones for csgo ( like here ) but have no clue how. Any tips, examples, lifehacks etc.? Thank you in advance Link to comment
The_GTA Posted November 22, 2021 Share Posted November 22, 2021 (edited) 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 November 22, 2021 by The_GTA 1 Link to comment
Lachuks Posted November 22, 2021 Author Share Posted November 22, 2021 Crosshair is not really centered but I'll take ur idea about hiding crosshair and overdrawing with image or dxDraw stuff. Thank you buddy! Link to comment
The_GTA Posted November 22, 2021 Share Posted November 22, 2021 (edited) 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 November 22, 2021 by The_GTA 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