Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rayzor
Visitor

Grid Screen

Hello,

I'm new to developing a channel, no experience on programming but can pick up examples quick from the SDK download. I developed a channel from the samples and changed the images. I uploaded the video file to Roku box and the source file to the server. Im able to see the channel on Roku box but I dont like the way the layout grid looks after clicking on the channel button. Can i get the code that will make the grid screen look like the Netflix layout screen and let me know where to add it to.

Thanks
0 Kudos
31 REPLIES 31
socantra
Visitor

Re: Grid Screen

Try the developers forum

viewforum.php?f=34
Please attempt to maintain a thin veneer of civility.
Remember, you are speaking to strangers on the internet,
not your own family at home.
0 Kudos
destruk
Binge Watcher

Re: Grid Screen

SetGridStyle(String style)
Sets the style or theme for displaying images in the grid screen. This allows different appearances of the overall grid for different sized images:
* flat-movie – movie posters as seen in the Netflix channel (Default)
Image sizes: SD 110x150 HD 210x270
SD 5 posters across, by 2 rows
HD 5 posters across, by 2 rows

Search your brs files for "SetGridStyle" and take it from there if you find it.
You'll want to set it with something like
screen.SetGridStyle("Flat-Movie") to make it look like Netflix's choice.
0 Kudos
rayzor
Visitor

Re: Grid Screen

Thanks for the response but a little confused. I looked through all the .brs in the source folder and can't find it. HELP!!
0 Kudos
destruk
Binge Watcher

Re: Grid Screen

Simplegrid\source\SimpleGrid.brs

Sub Main()

'initialize theme attributes like titles, logos and overhang color
initTheme()

gridstyle = "Flat-Movie"

'set to go, time to get started
while gridstyle <> ""
print "starting grid style= ";gridstyle
screen=preShowGridScreen(gridstyle)
gridstyle = showGridScreen(screen, gridstyle)
end while

End Sub

I merged the new files from the current sdk into my existing sdk work folder - so I'm not sure if the simplegrid example in the current SDK is the same as what I have.

The actual setting of the style is here:
Function preShowGridScreen(style as string) As Object
m.port=CreateObject("roMessagePort")
screen = CreateObject("roGridScreen")
screen.SetMessagePort(m.port)
screen.SetDisplayMode("scale-to-fill")
screen.SetGridStyle(style)
return screen
End Function
0 Kudos
rayzor
Visitor

Re: Grid Screen

What I used is the example of the videoplayer zip file and source file. I uploaded the zip file to roku box and source to my server. I replaced the logos and have it connected to the server. I actually got the channel working but I liked the simplegrid look. I found the simplegrid.brs and looked at ur responce but I notice that my source file has multiple .brs files. Do i take the simplegrid.brs and replace a .brs file and rename it or copy to a certain .brs file or start from scratch (something i dont wanna do). Thanks again for your responce and being patient with me.
0 Kudos
destruk
Binge Watcher

Re: Grid Screen

You'd need to merge the line(s) you need into your own source.
Before you show your grid screen, to make it look like netflix 5 columns with 2 rows, you use screen.SetGridStyle("Flat-Movie") where screen is the handle to the CreateObject("roGridScreen") you are trying to display.
If your gridscreen was working before, then that single adjustment should be all that you need.
0 Kudos
rayzor
Visitor

Re: Grid Screen

I have in my source file:

appDetailScreen.brs
appHameScreen.brs
appMain.brs
appPosterScreen.brs
appVideoScreen.brs
catagoryFeed.brs
deviceInfo.brs
generalDlgs.brs
generalUtils.brs
showFeed.brs
urlUtils.brs

Do I merge the simpleGrid.brs in the appDetailScreen.brs and if I merge in a .brs file do i copy and paste?
0 Kudos
destruk
Binge Watcher

Re: Grid Screen

Which of those files has your gridscreen code in it? Put the line or two for SetGridStyle into whatever file has the grid setup.
0 Kudos
rayzor
Visitor

Re: Grid Screen

I noticed that the Simple Grid Screen Demonstration App (SimpleGrid.brs) has the "Sub Main ()" like my source file "appMain.brs" but different body code:

SimpleGrid.brs

Sub Main()

'initialize theme attributes like titles, logos and overhang color
initTheme()

gridstyle = "Flat-Movie"

'set to go, time to get started
while gridstyle <> ""
print "starting grid style= ";gridstyle
screen=preShowGridScreen(gridstyle)
gridstyle = showGridScreen(screen, gridstyle)
end while

End Sub

appMain.brs

Sub Main()

'initialize theme attributes like titles, logos and overhang color
initTheme()

'prepare the screen for display and get ready to begin
screen=preShowHomeScreen("", "")
if screen=invalid then
print "unexpected error in preShowHomeScreen"
return
end if

'set to go, time to get started
showHomeScreen(screen)

End Sub

Do I merge certain code from SimpleGrid.brs into my source file appMain.brs? Thanks again for responding
0 Kudos