"NewManLiving" wrote:
While never having tried it, theoretically and according to documentation as I understand it, if you open your channel with an imagecanvas on the bottom and then open a roScreen on top you should be OK. I do this with a paragraph screen and an rovideoscreen. I don't Think there will be any difference with an imagecanvas, may be. The only thing is once the roScreen is open you have to get rid of it by setting the variable to invalid to get back to your imagecanvas. There is no close. And you cannot open an imagecanvas or anything else non-roScreen over it. So in your case for a keyboard it should be ok
"NewManLiving" wrote:
It believe it means that once created you cannot mix the two and once closed you can begin to use the other components. There are only two screen stacks roScreen and everything else. If I can open a roScreen over an roParagraph then there is no reason that you cannot do the same with an image canvas. However you can't create anything else on top of the roScreen but another roScreen and you cannot resume using the image canvas until you close your roScreen. Just give it a try. You don't have to put anything on the screens. Just open an roimagecanvas in one color then sleep a second, open a roScreen and clear it in another color don't forget to call swapbuffers or finish depending on the type of roScreen, and sleep a second then invalidate the roScreen which should return you to your image canvas
Sub Main()
backL = 0
helloL = 1
back = { Color:"#262626", CompositionMode: "Source" }
hello = {
Text:"Press Ok To show a blue roScreen for 2 seconds, Back To Exit"
TextAttrs:{Color:"#FFFFFFFF", Font:"Medium",
HAlign:"HCenter", VAlign:"VCenter",
Direction:"LeftToRight"}
TargetRect:{x:0,y:0,w:1280,h:720}
}
canvas = CreateObject( "roImageCanvas" )
port = CreateObject( "roMessagePort" )
canvas.SetMessagePort(port)
canvas.SetLayer( backL , back )
canvas.SetLayer( helloL, hello )
canvas.Show()
roScreen = Invalid
while(true)
msg = wait(0,port)
if type(msg) = "roImageCanvasEvent" then
if (msg.isRemoteKeyPressed()) then
i = msg.GetIndex()
if (i = 0) then
canvas.close()
else if i = 6 and roScreen = Invalid
roScreen = CreateObject( "roScreen", True, 1280, 720 )
roScreen.Clear( &h15247CFF )
roScreen.SwapBuffers()
sleep( 2000 )
roScreen = Invalid
end if
else if (msg.isScreenClosed()) then
return
end if
end if
end while
End Sub
Library "v30/bslDefender.brs"
Sub Main()
backL = 0
helloL = 1
back = { url:"pkg:/locale/default/images/background1.jpg", CompositionMode: "Source" }
hello = {
Text:"Press Ok To show a blue roScreen for 2 seconds, Back To Exit"
TextAttrs:{Color:"#FFFFFFFF", Font:"Medium",
HAlign:"HCenter", VAlign:"VCenter",
Direction:"LeftToRight"}
TargetRect:{x:0,y:0,w:1280,h:720}
}
canvas = CreateObject( "roImageCanvas" )
port = CreateObject( "roMessagePort" )
canvas.SetMessagePort(port)
canvas.SetLayer( backL , back )
canvas.SetLayer( helloL, hello )
canvas.Show()
info= canvas.GetCanvasRect()
roScreen = Invalid
while(true)
msg = wait(0,port)
if type(msg) = "roImageCanvasEvent" then
if (msg.isRemoteKeyPressed()) then
i = msg.GetIndex()
if (i = 0) then
canvas.close()
else if i = 6 and roScreen = Invalid
roScreen = CreateObject( "roScreen", True, 1920, 1200 )
roScreen.Clear( &h15247CFF )
img= createObject("roBitmap","pkg:/locale/default/images/background2.jpg")
roScreen.drawObject(0,0,img)
roScreen.SwapBuffers()
sleep( 4000 )
roScreen = Invalid
end if
else if (msg.isScreenClosed()) then
return
end if
end if
end while
End Sub