I tried to use ComponentController to navigate from Main Scene to ViewA, then I found two problem
- The button in ViewA does not respond to remote events. (button.setFocus(true))
- The font:LargeBoldSystemFont/font:MediumBoldSystemFont does not work normally
I am new to Roku development. Any hint is appreciated.
Update:
I figured out the solution for 1
I was not supposed to setFocus in init() function.
I have to add
m.top.observeField("focusedChild","onChildFocused")
to init()
Then setFocus in onChildFocused
sub onChildFocused()
print "child focused"
if m.top.isInFocusChain() and not m.button.hasFocus() then
m.button.setFocus(true)
end if
end sub
I still don't know why the fonts don't work normally.