function setupBufferScreen(adIface)
displaySize = CreateObject("roDeviceInfo").getDisplaySize()
cW = displaySize.w
cH = displaySize.h
bg = getSpinnerBG(cW, cH)
spinner = getSpinnerLayer(cW, cH)
adIface.setAdBufferScreenLayer(0, bg)
adIface.setAdBufferScreenLayer(1, spinner)
adIface.setAdBufferRenderCallback(bufferScreenCallback, {}, 0)
end function
function bufferScreenCallback(state as Dynamic, eventType as String, ctx as Dynamic)
if eventType = "Progress"
ctx.canvasLayers[1].TargetRotation = ctx.progress
? "TARGET ROTATION: "; ctx.canvasLayers[1].TargetRotation
end if
end function
function getSpinnerBG(cW, cH)
spinnerBGSize = 125
spinnerBGLayout = {
x : Int((cW / 2) - (spinnerBGSize / 2))
y : Int((cH / 2) - (spinnerBGSize / 2))
w : spinnerBGSize
h : spinnerBGSize
}
return {
Color: "#101010"
CompositionMode: "Source"
TargetRect: spinnerBGLayout
}
end function
function getSpinnerLayer(cW, cH)
spinnerSize = 100
spinnerX = Int((cW / 2) - (spinnerSize / 2))
spinnerY = Int((cH / 2) - (spinnerSize / 2))
spinnerTargetRect = {
x: spinnerX,
y: spinnerY,
w: spinnerSize,
h: spinnerSize
}
return {
url: "pkg://images/spinner.png",
TargetRect: spinnerTargetRect,
TargetTranslation: { x: spinnerX, y: spinnerY },
TargetRotation: 90,
CompositionMode: "Source"
}
end function
rafrndr-renderTypeChanged() - client-inserted
added child: Rectangle id: 1 subtype: Rectangle
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 0
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 6
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 13
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 19
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 26
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 33
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 6
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 13
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 19
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 26
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 33
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 33
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 99
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 99
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
TARGET ROTATION: 100
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
added child: Rectangle id: 0 subtype: Rectangle
added child: Poster id: 1 subtype: Poster
check layer: 1 visible: true
check layer: 0 visible: true
? createObject("roDeviceInfo").GetGraphicsPlatform()
"RokuNB" wrote:
Does this work when you do it outside RAF API?
Some models do not support object rotation. Try? createObject("roDeviceInfo").GetGraphicsPlatform()
if "opengl" - can rotate, if "directfb" - can't.
"Veeta" wrote:
Have you tried calling adIface.setAdBufferScreenLayer() after you change the TargetRotation?
I notice in the roImageCanvas documentation that: "The screen is redrawn when SetLayer()is called." Most likely you are changing the inputs but aren't triggering any rendering.
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
Thanks for your patience — we’re excited to share what’s next!