cancel
Showing results for 
Search instead for 
Did you mean: 

How can I do scrolling text?

Yunus ARI
Senior

Hi,

I want to do a scrolling text. I think, I can use "scrollable container". But how can I scroll automatically don't know.  Is there any example about this type of usage for scrollable container? 

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Is the only function of this text to scroll automatically? Then just have textarea and a move animator with a container to act as a viewport

  1. Drag in a container through the designer and resize it to your needs.
  2. Dump a TextArea inside the container and move it to its starting position
  3. Create an interaction that movies it

Is that too simple? Not really sure what this thing is supposed to do 🙂

/Martin

View solution in original post

5 REPLIES 5
Martin KJELDSEN
Chief III

Is the only function of this text to scroll automatically? Then just have textarea and a move animator with a container to act as a viewport

  1. Drag in a container through the designer and resize it to your needs.
  2. Dump a TextArea inside the container and move it to its starting position
  3. Create an interaction that movies it

Is that too simple? Not really sure what this thing is supposed to do 🙂

/Martin

KMili
Associate III

It that is about ScrollableContainer, you can explicitly call smth like this:

const GestureEvent evt(GestureEvent::SWIPE_VERTICAL, -10, 0, 0);
scrollCont.handleGestureEvent(evt);

Or implement derived class of ScrollableContainer and implement your methods. For example, I have:

bool AdvancedScrollableContainer::scroll(int16_t deltaX, int16_t deltaY)
{
    return doScroll(deltaX, deltaY);
}
 
void AdvancedScrollableContainer::moveRelative(int16_t deltaX, int16_t deltaY)
{
    scrolledXDistance += deltaX;
    scrolledYDistance += deltaY;
    moveChildrenRelative(deltaX, deltaY);
 
    invalidateScrollbars();
}

Hi Martin,

I noticed that I don't know how to use move animation class when you said that it's too simple 😅 I did some research and find an example which use move animation class. Now I did like you said, used a text with move animation in a container.

It's really too simple, thank you for advice. 😁 

I tried GestureEvent but can't run it. Move animation fixed the problem. Thank you for reply.

Glad you were able to work it out! 🙂

/Martin