Jump to content

Display string variable on screen


Wiebrendh

Recommended Posts

Hey, i am working on a mod at the moment, and i really want to know how to display a string variable in the bottom right of the screen.. can someone tell me how to get this! Am a starting mod maker :D

Link to comment
Share on other sites

you can use per frame drawing event to draw text on screen where you want.

 

this small script shows a example:

 

http://pastebin.com/ZrqB5fEB

 

Thanks, but when i do

e.Graphics.DrawText("simple text", 10, 60, Color.White); 

the .Graphics. is under a red line.. Which reference do i have to import for this? I already imported System.Drawing.

Edited by Wiebrendh
Link to comment
Share on other sites

You to have e.Graphics... in the PerFrameDrawing event, has shown in the pastebin.

 

The Graphics class you should use is actually GTA.Graphics.

 

What I think the problem is, is actually with the e variable, it must be of type GraphicsEventArgs, please confirm that.

Link to comment
Share on other sites

You to have e.Graphics... in the PerFrameDrawing event, has shown in the pastebin.

 

The Graphics class you should use is actually GTA.Graphics.

 

What I think the problem is, is actually with the e variable, it must be of type GraphicsEventArgs, please confirm that.

 

Yep that was the problem, i used the wrong event :D

Link to comment
Share on other sites

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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.