Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 10

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.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
Level 10

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


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