推
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "Scene/Scene_Loading_UI.h"
|
||||
#include "Scene/Scene_MainUi.h"
|
||||
#include "Scene/Scene_Test.h"
|
||||
#include "Actor/Map/GameWorld.h"
|
||||
#include "Scene_Loading_UI.h"
|
||||
#include "EngineFrame/Component/Sprite.h"
|
||||
#include "EngineFrame/Component/Text.h"
|
||||
@@ -15,6 +15,10 @@ void Scene_Loading_UI::Enter()
|
||||
{
|
||||
Mix_PlayMusic(music, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Mix_LoadMUS: %s\n", Mix_GetError());
|
||||
}
|
||||
|
||||
RefPtr<Actor> actor = new Actor;
|
||||
AddChild(actor);
|
||||
@@ -22,19 +26,19 @@ void Scene_Loading_UI::Enter()
|
||||
RefPtr<Sprite> BackGroundSp = new Sprite("ImagePacks2/Loading1.png");
|
||||
actor->AddChild(BackGroundSp);
|
||||
RefPtr<Sprite> BackGround2Sp = new Sprite("ImagePacks2/Loading0.png");
|
||||
BackGround2Sp->SetPos(Vec2{0, 686});
|
||||
BackGround2Sp->SetPosition(0, 686);
|
||||
actor->AddChild(BackGround2Sp);
|
||||
RefPtr<Sprite> LoadCircleSp = new Sprite("ImagePacks2/Loading2.png");
|
||||
LoadCircleSp->SetName("LoadCircle");
|
||||
LoadCircleSp->SetPos(Vec2{1280 - 60, 686 - 60});
|
||||
LoadCircleSp->SetPosition(1280 - 60, 686 - 60);
|
||||
LoadCircleSp->SetBlendMode(LINEARDODGE);
|
||||
LoadCircleSp->SetAnchor(Vec2{0.5f, 0.5f});
|
||||
LoadCircleSp->SetAnchor(0.5f, 0.5f);
|
||||
actor->AddChild(LoadCircleSp);
|
||||
|
||||
actor->SetCallbackOnUpdate("Rotate", [LoadCircleSp](float deltaTime) mutable
|
||||
{
|
||||
{
|
||||
float angle = LoadCircleSp->GetRotation();
|
||||
LoadCircleSp->SetRotation(angle + 180.0f * deltaTime); });
|
||||
LoadCircleSp->SetRotation(angle - 180.0f * deltaTime); });
|
||||
}
|
||||
|
||||
void Scene_Loading_UI::Update(float deltaTime)
|
||||
@@ -43,7 +47,7 @@ void Scene_Loading_UI::Update(float deltaTime)
|
||||
if (Global_Game::GetInstance().InitFlag)
|
||||
{
|
||||
// 设定游戏层场景
|
||||
RefPtr<Scene_Test> scene = new Scene_Test;
|
||||
RefPtr<GameWorld> scene = new GameWorld;
|
||||
Game::GetInstance().ChangeScene(scene);
|
||||
// 设定UI层场景
|
||||
RefPtr<Scene_MainUi> sceneUI = new Scene_MainUi;
|
||||
|
||||
Reference in New Issue
Block a user