SceneContinueFunc <- // 何を追加してもいいが Finalize() で関数のみになること { IsDone = 0, // ロードできたか CountStart = 0, Timer = 9, Count = 0, CountEnd = 0, CountEndInit = 0, SceneEnd = 0, }; // はじまり function SceneContinueFunc::Initialize() { local p = SceneContinueFunc; p.IsDone = 1; // とりあえず成功にしておく p.Timer = 9; // 0の瞬間に終了なので 実際は8.99秒 小数以下を切り上げて表示 p.CountStart = 60; // 表示からカウント開始までのフレーム p.CountEndInit = 0; // p.CountEnd = 0; // p.SceneEnd = 0; // local prio = 500; // 全体プライオリティ // 枠生成 p.PA_Bg <- tPAni.CDat(); p.PA_Manager <- tPAni.CAniManager(); // マネージャ生成 // PAniデータ読み込み local sFilePath = "./grpdat/Continue"; local sPcFile; local ret=0; sPcFile = format( "%s/gameover00.pat", sFilePath ); // BG if( p.PA_Bg.Load( sPcFile ) == 0 ) { print( format( "\n >> %s Load error.", sFilePath ) ); p.IsDone = 0; } if( p.IsDone != 0 ) { // 中心表示位置設定 local cx = 1280/2; local cy = 720/2; p.PA_Bg.SetPosition( cx, cy ); // local framestep = 1.0/60; // 1フレーム local fWait = 0.0; local fr = 0; // フレーム登録 // fWait = framestep * 8; fr = p.PA_Manager.Add( p.PA_Bg, "BG" ); for( local i=0; i<=4; i++ ) { local s = format( "con_logo0%02d", i ); fr.AddFrame( s, fWait ); } fr.AddJump( -1 ); fr.SetPrio( prio+0 ); //fr.SetView( 0 ); fWait = framestep * 15; fr = p.PA_Manager.Add( p.PA_Bg, "Word" ); fr.AddSe( 160 ); // ※仮SE for( local i=0; i<=45; i++ ) { local s = format( "con_font0%02d", i ); fr.AddFrame( s, framestep * 1 ); } fr.AddJump( -1 ); fr.SetPrio( prio+1 ); fr.SetStartWait( framestep * 30 ); // 数字 for( local num=0; num<=9; num++ ) { local sNum = format( "%0d", num ); fWait = framestep * 15; fr = p.PA_Manager.Add( p.PA_Bg, sNum ); local s = format( "con_count0%s", sNum ); fr.AddFrame( s, 999 ); fr.AddJump( -1 ); fr.SetPrio( prio+1 ); fr.SetStartWait( framestep * p.CountStart ); } } print("\nSceneContinueFunc::Initialize()" + " " ); //btl_debCheckTable( Scene_WinDemoFunc ); } // 終了処理 function SceneContinueFunc::Finalize() { local p = SceneContinueFunc; // アニメマネージャの解放、登録した中身も全部消える if( "PA_Manager" in p ) // Initialize()を通らない場合がある { delete p.PA_Manager; print("\ndelete PA_Manager"); } // PAniオブジェクトの解放 if( "PA_Bg" in p ) // Initialize()を通らない場合がある { delete p.PA_Bg; print("\ndelete PA_Bg"); } print("\nSceneContinueFunc::Finalize()"); //btl_debCheckTable( Scene_VsScreenFunc ); delete SceneContinueFunc; } // 現在表示する数字を取得 // Exeからも使う、0だったら終わり判定? function SceneContinueFunc::GetCount() { local p = SceneContinueFunc; local viewnum = (p.Timer / 60) + 1; if( p.Timer == 0 ) viewnum = 0; return viewnum; } function SceneContinueFunc::SetCount( cnt ) { local p = SceneContinueFunc; p.Timer = cnt; } function SceneContinueFunc::SetCountEnd() { local p = SceneContinueFunc; if( p.CountEndInit == 0 ) { p.CountEnd = 60; p.CountEndInit = 1; } } function SceneContinueFunc::GetSceneEnd() { local p = SceneContinueFunc; return ( p.SceneEnd != 0 )? 1: 0; } function SceneContinueFunc::IsCountStart() { local p = SceneContinueFunc; return ( p.CountStart <= p.Count )? 1: 0; } // function SceneContinueFunc::Update() { local p = SceneContinueFunc; local fr; // 毎回表示設定 local viewnum = p.Timer; if( viewnum < 0 ) viewnum = 0; if( viewnum > 9 ) viewnum = 9; // 現在の数字以外を非表示 for( local num=0; num<=9; num++ ) { local sNum = format( "%0d", num ); fr = p.PA_Manager.GetCAnime( sNum ); // if( num == viewnum ) { fr.SetView(1); } else { fr.SetView(0); } } if( p.CountEnd > 0 ) { p.CountEnd--; if( p.CountEnd == 0 ) { p.SceneEnd = 1; } } //print( "\n" + viewnum + "," + p.CountEnd + "," + p.SceneEnd ); p.PA_Manager.Update(); p.Count++; } // function SceneContinueFunc::Render() { local p = SceneContinueFunc; p.PA_Manager.Render(); //print( format( "\n[Count:%d]", p.Count ) ); } print("\n\ncontinue.txt Running!!!");