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: 
Komag
Roku Guru

Can't get region Offset() or SetPrestranslation() to work

I'm trying to write text and rectangles to a region and offset or translate the region depending on circumstance, but I can't get anything to work

	textR = CreateObject("roRegion", screen, 96, 40, 1088, 640) ' Draws to screen, smaller than mainR
textR.SetAlphaEnable(TRUE)
'textR.SetPretranslation(0, 300)
'textR.Offset(0, 300, 0, 0)

I've tried both the SetPretranslation() and the Offset() tests above, but in both cases the rectangles and text I later draw (with DrawRect() and DrawText() are still in the exact same position as when these two lines are both commented out like they are now. I want to move them up or down as desired, so my tests only affect the Y position.

Are Offset() and SetPretranslation() only for DrawObject, DrawRotatedObject, and DrawScaledObject as mentioned for SetPretranslation() reference material?

region.Set() doesn't seem to help either, if I set up some region "fakeR" with the Y offset I want, then do textR.Set(fakeR), no effect.
0 Kudos
1 REPLY 1
Komag
Roku Guru

Re: Can't get region Offset() or SetPrestranslation() to wor

SOLVED!

Regions can't extend past the bitmap!

I was offsetting only Y, but the same Height was pushing the region out of bounds (300 + 640 is beyond the screen 720 height), so it simply didn't do anything (as opposed to crashing with an error)
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.