2019-11-11 03:06 AM
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?
Solved! Go to Solution.
2019-11-11 04:01 AM
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
Is that too simple? Not really sure what this thing is supposed to do :)
/Martin
2019-11-11 04:01 AM
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
Is that too simple? Not really sure what this thing is supposed to do :)
/Martin
2019-11-11 02:12 PM
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();
}
2019-11-12 04:04 AM
Hi Martin,
I noticed that I don't know how to use move animation class when you said that it's too simple :grinning_face_with_sweat: 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. :beaming_face_with_smiling_eyes:
2019-11-12 04:07 AM
I tried GestureEvent but can't run it. Move animation fixed the problem. Thank you for reply.
2019-11-12 04:14 AM
Glad you were able to work it out! :)
/Martin