Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Komag
Level 9

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
Komag
Level 9

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