cancel
Showing results for 
Search instead for 
Did you mean: 

Marquee text character from left to write

I have big text which I need to scroll left to right in loop with touch gfx. When I read more on it and found about scrollableContainer but kinda unsure how to combine it with my text object widget.

I added below code

  scrollableTripAdviceParameterText_II.setPosition(509, 353, 282, 57);

  scrollableTripAdviceParameterText_II.enableHorizontalScroll(true);

  scrollableTripAdviceParameterText_II.setScrollbarsColor(touchgfx::Color::getColorFrom24BitRGB(240, 235, 235));

// below code is added by me

 scrollableTripAdviceParameterText_II.add(tripAdviceParameterText_II);

scrollableTripAdviceParameterText_II is Scrollable Container widget and tripAdviceParameterText_II is text widget

Is there any other way to add Scrollable Container for my application? I read few blogs on it but unable to figure it out.

Thanks

13 REPLIES 13
  1. Create a new empty container
  2. Position and size the container to the area in which you want the text to show. Anything outside the container will not be visible, so text will be cropped
  3. Place textArea1 inside the container, and make it a child of the container in the sidebar
  4. Use the same code above but change the start position from 800 to container1.getWidth() (obviously use the name of your actual container)

Because the X position of the text is referenced relative to it's parent (the container), the end position can stay -textArea.getWidth(). Behind the scenes, the textArea itself is much wider (and scales to wildcard size). But because it is inside a small container, and elements are not visible in areas outside their parent containers, you only see a few characters at a time.

See attached video.

@Chandan Bhatia​ Any luck with this solution?

@Michael K​  Hi, Missed your response. I tried adding text to empty container but in touchgfx I can't find any option to make textArea1  as a child.

0693W000006EmQ9QAK.png 

In the left sidebar with all the screens listed, and all the objects on the screens, just ​drag the text area item on top of the container item