Skip to main content
Ghofm.1
Associate II
February 7, 2022
Solved

In TouchGFX, under shapes, there is a object called LINE; I would try to use it as an horizontal separation line, but is always a diagonal line, and I'm not able to change this. What I'm making wrong?

  • February 7, 2022
  • 4 replies
  • 1448 views

..

This topic has been closed for replies.
Best answer by Peter BENSCH

The line object is drawn with preset coordinates, which you must of course adjust (lower half of the Properties panel):

Start Position: X=5, Y=5

End Position: X=95, Y=45

If you set the End Position to e.g. Y=5, you will get a horizontal line whose centre line runs on the vertical offset 5.

Please consider that the line also has a Cap Style and a Line Width (default 10).

Good luck!

Regards

/Peter

4 replies

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
February 7, 2022

The line object is drawn with preset coordinates, which you must of course adjust (lower half of the Properties panel):

Start Position: X=5, Y=5

End Position: X=95, Y=45

If you set the End Position to e.g. Y=5, you will get a horizontal line whose centre line runs on the vertical offset 5.

Please consider that the line also has a Cap Style and a Line Width (default 10).

Good luck!

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Ghofm.1
Ghofm.1Author
Associate II
February 7, 2022

It worked! Thank you very much!

Peter BENSCH
Technical Moderator
February 7, 2022

If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
AndrewM
Associate III
April 13, 2022

I would also point out that if all you want to do is have a horizontal separator, I wouldn't use touchgfx::Line since it needs its own canvas so it's expensive. I would just use touchgfx::Box and set the width as desired and set the height to eg 1 or 2 pixels.