cancel
Showing results for 
Search instead for 
Did you mean: 

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?

Ghofm.1
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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.

View solution in original post

4 REPLIES 4
Peter BENSCH
ST Employee

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
Associate III

It worked! Thank you very much!

Peter BENSCH
ST Employee

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

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.