Recent

Author Topic: How to put read number to the graphics window?  (Read 3554 times)

luxer14

  • Newbie
  • Posts: 2
How to put read number to the graphics window?
« on: January 25, 2015, 08:07:37 pm »
Hello!

Im learning with Free Pascal graphics and I have got one problem, so I would like some help from you guys.

1) Can I put the read number to the graphics window?
For example i write to console number 123, can i write the read number to the graphics window? If yes, how?
2) Can I write text or number right to the graphics window without writing it to the console?

Thank you!  :)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to put read number to the graphics window?
« Reply #1 on: January 26, 2015, 06:37:34 pm »
Before answering any of your question: what kind of "graphics" are you learning? graph? lcl? fpgui? winapi? opengl?

Windsurfer

  • Sr. Member
  • ****
  • Posts: 368
    • Windsurfer
Re: How to put read number to the graphics window?
« Reply #2 on: January 26, 2015, 09:56:01 pm »
Textout may do what you want - certainly wen using LCL.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: How to put read number to the graphics window?
« Reply #3 on: January 26, 2015, 11:57:13 pm »
So you read text in console with readln(), and then want to show it on TForm? Easiest way to display a single line of text is to use TLabel. You can do label1.caption:=s;

Or for multiple lines there is a TMemo, which you can append with memo1.lines.Add(s);

luxer14

  • Newbie
  • Posts: 2
Re: How to put read number to the graphics window?
« Reply #4 on: January 30, 2015, 04:29:49 pm »
Before answering any of your question: what kind of "graphics" are you learning? graph? lcl? fpgui? winapi? opengl?

I use graph right now, i tried with outtext, but it can only be used with string type, when i need to read the variable and write it on the graph window :(

djzepi

  • New Member
  • *
  • Posts: 36

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to put read number to the graphics window?
« Reply #6 on: January 30, 2015, 05:32:02 pm »
Forgot to mention something: look at the demos, especially gravwars. It uses graph unit and it uses keyboard to input.

 

TinyPortal © 2005-2018