簡體   English   中英

最后一個場景出現黑色背景

[英]Black background appears on the last scene

我有一個問題,一旦熱氣球降落到地面,就會出現黑色背景。

在此處輸入圖片說明

// a switch case based on state with appropriate calls
switch (state) {
// scene 1
case 1:     
    drawBackground1(); // the first background to appear
    drawSlogan1(); // display the first slogan
    break;
// scene 2
case 2:     
    drawBackground2(); // the second background to appear
    drawSlogan2(); // display the second slogan
    break;
// scene 3
case 3:     
    drawBackground1(); // the third background to appear
    drawSlogan3(); // display the last slogan
    break;
}

我在這里顯示此代碼是因為這是我更改的唯一代碼,使黑色背景出現。

點擊這里查看完整代碼

當零件序號到達最終位置時, state為0。如果state == 0 ,也必須繪制背景:

switch (state) {
case 0: 
    drawBackground1(); // the third background to appear
    break;
case 1:     
    drawBackground1(); // the first background to appear
    drawSlogan1(); // display the first slogan
    break;
case 2:     
    drawBackground2(); // the second background to appear
    drawSlogan2(); // display the second slogan
    break;
case 3:     
    drawBackground1(); // the third background to appear
    drawSlogan3(); // display the last slogan
    break;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM