2016-10-18 2 views
0

나는 roku setup을 하나의 기본 hello world 프로그램에도 사용했다.Roku Basic App Creation

다음으로 로고가있는 레이아웃 맞춤을 만들고 싶습니다. 그것의 소스를 검색하는 것은 매우 어렵다. 누구든지이 문제를 해결하기 위해 나를 도와 줄 수 있습니까?

+0

수 너는 c를 게시한다. _basic 안녕하세요 세계 프로그램의 ode도? – Shashanth

답변

1

자세한 내용이 없으면 답할만한 질문이 아닙니다. 그렇게하는 데는 여러 가지 방법이 있습니다. 가장 간단한 방법은 로 설명한 내용은 roScreen 또는 roImagecanvas를 사용하는 것이지만, 각 선택 항목에 더 많은 질문이 필요합니다. Roku SDK의 예제를 살펴보십시오. 흥미로운 것으로 보이거나 소스 코드를 훑어 보면 많은 해답을 찾을 수 있습니다.

0

먼저이 파일을 만듭니다 : 소스 폴더에 main.brs이 LayoutTop.xml는, LayoutTop.brs는 HomeScene.xml 및 components.Then에 HomeScene.brs 해당 파일이 코드를 추가 main.brs 파일 :

sub Main() 
    showSGScreen() 
end sub 

sub showSGScreen() 
    screen = CreateObject("roSGScreen") 
    m.port = CreateObject("roMessagePort") 
    screen.setMessagePort(m.port) 
    m.scene = screen.CreateScene("HomeScene") 
    screen.show() 

    while(true) 
     msg = wait(0, m.port) 
    msgType = type(msg) 
     if msgType = "roSGScreenEvent" 
      if msg.isScreenClosed() then return 
     end if 
    end while 
end sub 

LayoutTop.xml :

<?xml version="1.0" encoding="UTF-8"?> 
<component name="layoutTop" extends="Group" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd"> 

<script type="text/brightscript" uri="pkg:/components/LayoutTop.brs"/> 
<children> 
    <Poster 
     id="backgroundPoster" 
     uri="pkg:/images/backgroundTop.jpg" 
     width="1920" 
     height="150" 
     translation="[0, 0]" 
    /> 


    <Poster 
     id="icon" 
     uri="pkg:/images/html5.png" 
     width="128" 
     height="128" 
     translation="[10, 10]" 
    /> 

</children> 

</component> 

LayoutTop.brs :

sub init() 

end sub 

HomeScene.xml :

<?xml version="1.0" encoding="UTF-8"?> 
<component name = "HomeScene" extends = "Scene" > 
<script type="text/brightscript" uri="pkg:/components/HomeScene.brs"/> 
<children> 
    <Poster 
     id="background" 
     uri="pkg:/images/background.jpg" 
     width="1920" 
     height="1080" 
     translation="[0, 0]" 
    /> 

    <Group > 
     <layoutTop 
      translation="[0, 0]" 
     /> 

    </Group> 

    </children> 
</component> 

HomeScene.brs :

sub init() 

end sub 

당신이 당신의 로쿠에이 화면을 얻을합니다 모든 후 : enter image description here