修改游戏底层矩阵相关
This commit is contained in:
@@ -22,23 +22,19 @@ void Scene_Loading_UI::Enter()
|
||||
RefPtr<Sprite> BackGroundSp = new Sprite("ImagePacks2/Loading1.png");
|
||||
actor->AddComponent(BackGroundSp);
|
||||
RefPtr<Sprite> BackGround2Sp = new Sprite("ImagePacks2/Loading0.png");
|
||||
BackGround2Sp->SetPos(VecFPos{0, 686});
|
||||
BackGround2Sp->SetPos(Vec2{0, 686});
|
||||
actor->AddComponent(BackGround2Sp);
|
||||
RefPtr<Sprite> LoadCircleSp = new Sprite("ImagePacks2/Loading2.png");
|
||||
LoadCircleSp->SetName("LoadCircle");
|
||||
LoadCircleSp->SetPos(VecFPos{1280 - 60, 686 - 60});
|
||||
LoadCircleSp->SetPos(Vec2{1280 - 60, 686 - 60});
|
||||
LoadCircleSp->SetBlendMode(LINEARDODGE);
|
||||
LoadCircleSp->SetAnchor(VecFPos{0.5f, 0.5f});
|
||||
LoadCircleSp->SetAnchor(Vec2{0.5f, 0.5f});
|
||||
actor->AddComponent(LoadCircleSp);
|
||||
|
||||
actor->SetCallbackOnUpdate([LoadCircleSp](float deltaTime) mutable
|
||||
{
|
||||
float angle = LoadCircleSp->GetRotation();
|
||||
LoadCircleSp->SetRotation(angle + 180.0f * deltaTime); });
|
||||
|
||||
// 文字测试
|
||||
// RefPtr<Text> text = new Text("测试文字加载中...", Global_Game::GetInstance().Fonts[0], SDL_Color{255, 255, 255, 255}, SDL_Color{0, 0, 0, 255}, 4);
|
||||
// actor->AddComponent(text);
|
||||
}
|
||||
|
||||
void Scene_Loading_UI::Update(float deltaTime)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
void Scene_MainUi::Enter()
|
||||
{
|
||||
Scene::Enter();
|
||||
|
||||
HSQUIRRELVM v = SquirrelEx::GetInstance().GetSquirrelVM();
|
||||
SQInteger top = sq_gettop(v);
|
||||
sq_pushroottable(v);
|
||||
|
||||
@@ -16,41 +16,42 @@ Scene_Test::~Scene_Test()
|
||||
|
||||
void Scene_Test::Enter()
|
||||
{
|
||||
SetScale(VecFPos(1.2f, 1.2f));
|
||||
map = new GameMap;
|
||||
map->LoadMap("map/cataclysm/town/elvengard/new_elvengard.map");
|
||||
map->LoadMap("map/cataclysm/town/elvengard/new_d_elvengard_l.map");
|
||||
map->Enter(this);
|
||||
|
||||
RefPtr<CharacterObject> obj = new CharacterObject();
|
||||
obj->SetPosition({1000, 300, 0});
|
||||
obj->Construction(0);
|
||||
|
||||
map->AddObject(obj);
|
||||
|
||||
RefPtr<MonsterObject> monster = new MonsterObject();
|
||||
monster->SetPosition({1200, 301, 0});
|
||||
monster->Construction(1);
|
||||
monster->SetDirection(1);
|
||||
|
||||
map->AddObject(obj);
|
||||
map->AddObject(monster);
|
||||
|
||||
_camera = new GameMapCamera;
|
||||
_camera->SetFromActor(obj.Get());
|
||||
|
||||
return;
|
||||
|
||||
// // SDL_Log("Scene_Test::进入测试场景!");
|
||||
RefPtr<Actor> actor = new Actor;
|
||||
AddChild(actor);
|
||||
|
||||
RefPtr<Sprite> sprite = new Sprite("ImagePacks2/test_white_background.png");
|
||||
// RefPtr<Sprite> sprite = new Sprite("ImagePacks2/test_white_background.png");
|
||||
|
||||
RefPtr<Sprite> chr = new Sprite("sprite/interface2/hud/hud.img", 0);
|
||||
// chr->SetPos(VecFPos{200, 100});
|
||||
chr->SetPos(Vec2{200, 100});
|
||||
// chr->SetAlpha(0.5);
|
||||
// chr->SetShadow();
|
||||
actor->AddComponent(chr);
|
||||
// actor->AddComponent(chr);
|
||||
|
||||
// RefPtr<Canvas> canvas = new Canvas(VecSize{1280, 720});
|
||||
// actor->AddChild(canvas);
|
||||
RefPtr<Canvas> canvas = new Canvas(VecSize{250, 720});
|
||||
actor->AddChild(canvas);
|
||||
canvas->DrawImg("sprite/interface2/hud/hud.img", 0, Vec2{0, 0});
|
||||
|
||||
// canvas->AddChild(chr);
|
||||
|
||||
@@ -58,21 +59,16 @@ void Scene_Test::Enter()
|
||||
// RefPtr<Animation> ani4 = new Animation("map/cataclysm/town/hendonmyre/animation/object/gateall_02.ani");
|
||||
// Am->AddAnimation(ani4);
|
||||
|
||||
// // Am->SetPos(VecFPos{200, 100});
|
||||
// // Am->SetPos(Vec2{200, 100});
|
||||
// actor->AddChild(Am);
|
||||
|
||||
// RefPtr<Text> text = new Text();
|
||||
// text->Init("测试文本", Global_Game::GetInstance().Fonts[0], SDL_Color{255, 255, 255, 255});
|
||||
// text->SetPos(VecFPos{200, 100});
|
||||
// actor->AddChild(text);
|
||||
|
||||
// // sprite2->UnsetClipRect();
|
||||
|
||||
// RefPtr<Actor> actor2 = new Actor;
|
||||
// actor->AddChild(actor2);
|
||||
|
||||
// RefPtr<Animation> ani4 = new Animation("map/cataclysm/town/hendonmyre/animation/object/gateall_02.ani");
|
||||
// // ani4->SetScale(VecFPos{-1.0, 1.0});
|
||||
// // ani4->SetScale(Vec2{-1.0, 1.0});
|
||||
// actor->AddChild(ani4);
|
||||
|
||||
// RefPtr<Animation> ani3 = new Animation("map/cataclysm/town/elvengard/animation/obj/serialight01_right.ani");
|
||||
|
||||
Reference in New Issue
Block a user