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: 
lock_4815162342
Channel Surfer

Button focusBitmapUri is stretching/shrinking to about 35% wider than iconUri

I have a button at the top of a grid screen. When I move focus to the button the focusBitmapUri image(focus image) is always about 35% wider(not sure exactly how much) than the iconUri(button image). This happens whether the focus image is larger, smaller or exactly the same size of the button image. :shock: I have tried setting the minWidth and maxWidth properties. They can allow me to make the width larger but not smaller than about 35% wider than the button image. However, I am able to change the height using the height property. I have no code referencing the button other than to change focus to it if up button is pressed. I want focusBitmapUri image to keep its width and not be stretched or shrunk.

All the code that references my button:
m.search = m.top.findNode("searchButton")
...
Function OnKeyEvent(key, press) as Boolean
...
   else if key = "up"
       m.search.setFocus(true)
...
End Function



This is my button:
<Button
   id="searchButton"       
    iconUri="pkg:/images/square.jpg"
    focusBitmapUri="pkg:/images/square2.png"
   translation="[40, 40]"
   minWidth="100"
   height="100"
/>



I have tried with focusFootprint=false, with no translation set, and with many other combinations of properties. I have also tried using the button group.

How can I prevent the focusBitmapUri image from stretching or shrinking?  :?:
Is this just an intended feature that I am just misunderstanding?  :?:
How can I make the focusBitmapUri image and the iconUri image be the same width?  :?:

Thank you very much for taking the time to read this. Any information, no matter how small will be very appreciated. 🙂
   
   
0 Kudos
1 REPLY 1
joetesta
Roku Guru

Re: Button focusBitmapUri is stretching/shrinking to about 35% wider than iconUri

I think you may be confused about the intent of the iconUri - it's not the button background image but a small icon that should appear next to the text on your button, like a dot (the default is a circular bullet-type dot)


> How can I make the focusBitmapUri image and the iconUri image be the same width?


Don't think that's possible.  Try getting rid of iconUri completely by setting it = " " (notice the space!)
i think you want to use focusFootprintBitmapUri instead of iconUri and "showFocusFootprint = true" so it appears even when the button is not in focus.
aspiring
0 Kudos
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.