Quantcast

Jump to content

» «
Photo

Display string variable on screen

4 replies to this topic
Wiebrendh
  • Wiebrendh

    C# Programmer

  • Members
  • Joined: 22 Mar 2014
  • Netherlands

#1

Posted 23 March 2014 - 06:50 PM

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


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#2

Posted 24 March 2014 - 04:17 AM

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


Wiebrendh
  • Wiebrendh

    C# Programmer

  • Members
  • Joined: 22 Mar 2014
  • Netherlands

#3

Posted 24 March 2014 - 07:51 AM Edited by Wiebrendh, 24 March 2014 - 07:53 AM.

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.


pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#4

Posted 25 March 2014 - 03:49 PM

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.


Wiebrendh
  • Wiebrendh

    C# Programmer

  • Members
  • Joined: 22 Mar 2014
  • Netherlands

#5

Posted 25 March 2014 - 04:53 PM

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users