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: 
spradhan7656
Reel Rookie

how to rounded button created in roku

Jump to solution

i design to crate a sing in button in corner are rounded but i have face this kind of issue how to fixing.

 

 

0 Kudos
2 Solutions

Accepted Solutions

Re: how to rounded button created in roku

Jump to solution

You'll have to use a mask group and then put the poster inside. Here is the documentation -> https://developer.roku.com/en-gb/docs/references/scenegraph/control-nodes/maskgroup.md

View solution in original post

TwitchBronBron
Streaming Star

Re: how to rounded button created in roku

Jump to solution

You can do this by using 9patch images. Here's a sample project showing how to do it.

https://github.com/rokucommunity/sample-projects/tree/master/rounded-corners

rounded-corners.png

A few things to consider:

- Roku supports both 720p and 1080p UI display sizings, so you need to produce both HD and FHD versions of these 9patch files, and pick the correct version depending on UI resolution (otherwise one of them will scale too large or small on the opposite resolution). I've handled this in my example by defining uri_resolution_autosub=$$RES$$,SD,HD,FHD in my manifest and then using $$RES$$ in my image uri.

-  try to make your 9patch images pixel-perfect when possible. If the images are too large for your size, they'll do weird things (like cropping or inverting the image). If the images smaller than your button size, you'll end up with flat edges where the repeating zones are.  

 

View solution in original post

5 REPLIES 5

Re: how to rounded button created in roku

Jump to solution

You'll have to use a mask group and then put the poster inside. Here is the documentation -> https://developer.roku.com/en-gb/docs/references/scenegraph/control-nodes/maskgroup.md

TwitchBronBron
Streaming Star

Re: how to rounded button created in roku

Jump to solution

You can do this by using 9patch images. Here's a sample project showing how to do it.

https://github.com/rokucommunity/sample-projects/tree/master/rounded-corners

rounded-corners.png

A few things to consider:

- Roku supports both 720p and 1080p UI display sizings, so you need to produce both HD and FHD versions of these 9patch files, and pick the correct version depending on UI resolution (otherwise one of them will scale too large or small on the opposite resolution). I've handled this in my example by defining uri_resolution_autosub=$$RES$$,SD,HD,FHD in my manifest and then using $$RES$$ in my image uri.

-  try to make your 9patch images pixel-perfect when possible. If the images are too large for your size, they'll do weird things (like cropping or inverting the image). If the images smaller than your button size, you'll end up with flat edges where the repeating zones are.  

 

renojim
Community Streaming Expert

Re: how to rounded button created in roku

Jump to solution

You should be able to set ui_resolutions=fhd in the manifest and only have one size for your 9-patches and rely on Roku to resize your images for the different devices, but I've found that you better check them because strange things can happen.

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
Chris-DP
Binge Watcher

Re: how to rounded button created in roku

Jump to solution

When it comes to 9 patch’s you do have to have one per actual resolution. 9 patch images are pixel perfect to the ui resolution. If you only have one designed for FHD it will look broken when the device renders in HD. 

0 Kudos
renojim
Community Streaming Expert

Re: how to rounded button created in roku

Jump to solution

@Chris-DP, that's not my experience, but I have had to play with the dimensions to get them to look right on both FHD and HD devices.

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.