Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 9

refresh scrollabletext


I've looked and tried to achieve this but no go.

Here's what I'm trying to do. After a user moves the text within a scrollabletext node via the remote inputs and another event occurs (eg. a timeout from a timer control), I want the text to refresh back so that the beginning of the text is back at the top. I understand I could destroy the node and recreate the node so it will reinitialize. Is this the only way or am I missing something?


0 Kudos
1 Reply

Re: refresh scrollabletext



I'm sorry to be a bit late but my solution was to delete and create again the scrollabletext. Here is my sample:


sub init()
m.description ="description")"visible", "setScrollbarThumbBitmapUri")
' my component logic
end sub

sub setScrollbarThumbBitmapUri()
		m.description.scrollbarThumbBitmapUri = "pkg:/images/scroll/scrollbarThumbBitmapUriFocus.9.png"
		m.description.scrollbarThumbBitmapUri = "pkg:/images/scroll/scrollbarThumbBitmapUri.9.png"
	end if
end sub

sub resetScrollText()
	m.description = createObject("roSGNode", "ScrollableText")
	m.description.font.size = 20
	m.description.font.uri = "pkg:/source/NanumGothic/NanumGothic-Regular.ttf" = "description" 
	m.description.translation = [270,262]
	m.description.color = "0xFFFFFF" 
	m.description.visible = true 
	m.description.width = 740
	m.description.height = 380
	m.description.text = "" 
	m.description.scrollbarThumbBitmapUri = "pkg:/images/scroll/scrollbarThumbBitmapUri.9.png"
end sub

Hope it will be usefull for someone with the same problem as me.

0 Kudos