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: 
johnmarsden
Visitor

What's the proper way to scale down an app from HD to SD?

If you're designing your app on the basis of HD dimensions, what's the recommended way of reducing it down for SD (Roku 2 XS / 4:3, 16:9)?

Is there a setting that will automatically try to convert it.. or should I convert the widths / heights of objects based on the resolution? Currently it just looks like it's zoomed in x5.
0 Kudos
9 REPLIES 9
johnmarsden
Visitor

Re: What's the proper way to scale down an app from HD to SD?

Solved: This is because of the `ui_resolutions=` in the manifest.

If you specify all of them like `ui_resolutions=sd,hd,fhd` then it will separate them in the app (not scale it). If you want just one, you can mark it as `ui_resolutions=hd` and it will automatically scale that version for sd + fhd.

Basically, if you want an app that works in all, only specify one.
0 Kudos
RokuNB
Roku Guru

Re: What's the proper way to scale down an app from HD to SD?

"johnmarsden" wrote:
Basically, if you want an app that works in all, only specify one.

Close enough! 8-)

If you want to take advantage of RSG auto-scaling, spec only one resolution, size for that - and let RSG take care of the other display sizes. If OTOH you want it pixel-perfect - then at the expense of additional coding - spec the resolutions you'll take care of (say "hd,fhd"), provide different image sizes etc. RSG would still take care of resolutions unmentioned (e.g. "sd" in this case).

But, if you are a small shop - pick only HD or FHD and go with that. HD is a solid choice for now because of model distribution in the field (pre-4k players do HD UI) and lower memory reqs./bundle size. If want to "future-proof" the app though and have absolutely no intent of releasing updates during the next year or two, go with FHD instead.
0 Kudos
destruk
Binge Watcher

Re: What's the proper way to scale down an app from HD to SD?

That would be cool if it worked that way.
If I have 'fhd' only in the manifest then it doesn't automatically scale to HD for overlays like the mini keyboard graphic.
Specifically --
For the rowlist component, the border highlight graphic is a 9-patch image looks different on roku3 and roku4.
The minikeyboard layout graphic requires an HD and an FHD image.

So it's still bugged/broken depending on what device you are running.
0 Kudos
destruk
Binge Watcher

Re: What's the proper way to scale down an app from HD to SD?

For clarification -- if I have 'fhd' only in the manifest and use the image from the wiki pages for HD for the keyboard it looks fine at HD, but is entirely wrong at FHD.
https://sdkdocs.roku.com/download/attac ... 000&api=v2

If you have a roku3 at 1080p and a roku4 at 1080p - the problem exists, as it looks different on roku3 and roku4 using the same image.  That is probably a closer description of the issue.  Roku will need to fix that.  For now we swap in the 1080p fhd image if it's determined to be a roku4, but then it means we have to have both images in the package file to do that.

By your description it ought to scale it for me and it obviously doesn't do that.
0 Kudos
RokuNB
Roku Guru

Re: What's the proper way to scale down an app from HD to SD?

"destruk" wrote:
By your description it ought to scale it for me and it obviously doesn't do that.

Yes, it should and this sounds like a bug. Can your provide screenshots/min.code sample?
As a reminder, Roku 3 does its UI in HD, even if output signal set to 1080 (video would FHD)
0 Kudos
destruk
Binge Watcher

Re: What's the proper way to scale down an app from HD to SD?

<?xml version = "1.0" encoding = "utf-8" ?>
<!--********** Copyright 2016 Roku Corp.  All Rights Reserved. **********-->

<component name="SearchScreen" extends="Group">
<children>
<Rectangle/>
<Button id="Search"/>
<MiniKeyboard id="MK"/>
</children>
</component>


Homescene child
		<!-- Search screen -->
<SearchScreen
id="MK"
visible="FALSE"/>



Homescene init
	'SearchScreen Node

m.SearchScreen=m.top.findNode("MK")



Display Search Screen
	If m.gridscreen.focusedContent.Title="Search" 'Search
m.global.lastsearchterm=m.global.searchterm
'Destroy and Recreate Search Screen to reset focus to "a"
m.searchscreen.removeChildIndex(2) 'destroy minikeyboard
m.searchscreen.removeChildIndex(1) 'destroy button
m.searchscreen.removeChildIndex(0) 'destroy rectangle
m.searchscreen.createChild("Rectangle")
m.searchscreen.createChild("Button")
m.searchscreen.createChild("MiniKeyboard")

m.r1=m.searchscreen.getChild(0)
m.r1.width=558'228
m.r1.height=759'76
m.r1.color="0x0F0F0FFF"
m.r1.translation=[14,0]

m.b1=m.searchscreen.getChild(1)
m.b1.id="search"
m.b1.text="Search"
m.b1.showFocusFootprint=FALSE
m.b1.minWidth=240
m.b1.maxWidth=1000
m.b1.translation=[164,670]
m.b1.observeField("buttonSelected","SearchActivated")

m.searchscreen.translation=[668,170]

m.SearchScreen.GetChild(2).keyboardBitmapUri="pkg:/images/search.png"


m.searchscreen.GetChild(2).texteditbox.maxTextLength=20
m.searchscreen.GetChild(2).texteditbox.backgroundUri="pkg:/images/searchtext.png"
m.searchscreen.getchild(2).text=""
If m.popup.visible m.popup.visible=FALSE
m.searchscreen.visible=TRUE

m.searchscreen.getchild(2).SetFocus(TRUE) 'Set Focus to the mini keyboard keys


manifest file --
ui_resolutions=fhd
If I don't check the device model number then it doesn't scale at all.
0 Kudos
destruk
Binge Watcher

Re: What's the proper way to scale down an app from HD to SD?

Roku3 looks fine with the hd minikeyboard graphic at 1080p
http://imgur.com/a/te3B0

Roku4 doesn't look right as it isn't scaling the image at all at 1080p
http://imgur.com/a/Y0PMu

So I have to check the device model number and manually force in the required image I need instead of letting it scale.
BTW - not that it makes any difference, but I did post about this in the Summer Beta Test as a bug report, and I guess nobody read anything there.
0 Kudos
destruk
Binge Watcher

Re: What's the proper way to scale down an app from HD to SD?

Just for Kicks, to see if downscaling when needed works - I told it to load the searchfhd (582x627) graphic, same size as the one on the wiki page.  And then on roku3 it looks like this - not scaling down.

http://imgur.com/a/MgH98
0 Kudos
destruk
Binge Watcher

Re: What's the proper way to scale down an app from HD to SD?

What the firmware ought to be doing, is for the keyboard URI bitmaps, it should probably look for the resolution of the graphic to verify what it is, compare against the sample images on the wki and if it finds an exact match between the HD/FHD/SD size then scale it based on what it needs on the particular device - otherwise it should allow use of the nonstandard size without scaling?

SD minikeyboard overlay: 218x235
HD minikeyboard overlay: 388x418
FHD minikeyboard overlay: 582x627
0 Kudos