55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
// Copyright (c) 2022 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#include "SimpleVNScene.hpp"
|
|
#include "prefabs/ui/VisualNovelTextboxPrefab.hpp"
|
|
|
|
using namespace Dawn;
|
|
|
|
SimpleVNScene::SimpleVNScene(DawnGame *game) : Scene(game) {
|
|
|
|
}
|
|
|
|
|
|
std::vector<Asset*> SimpleVNScene::getRequiredAssets() {
|
|
auto assMan = &this->game->assetManager;
|
|
std::vector<Asset*> assets;
|
|
vectorAppend(&assets, VisualNovelTextboxPrefab::getRequiredAssets(assMan));
|
|
return assets;
|
|
}
|
|
|
|
void SimpleVNScene::stage() {
|
|
auto assMan = &this->game->assetManager;
|
|
|
|
// Camera
|
|
this->camera = Camera::create(this);
|
|
// this->camera->item->addComponent<AudioListener>();
|
|
this->camera->transform->lookAtPixelPerfect(
|
|
glm::vec3(0, 0, 0),
|
|
glm::vec3(0, 0, 0),
|
|
this->camera->getRenderTarget()->getHeight(),
|
|
camera->fov
|
|
);
|
|
|
|
// Audio
|
|
auto listenerItem = this->createSceneItem();
|
|
this->audioListener = listenerItem->addComponent<AudioListener>();
|
|
|
|
this->background = SimpleVisualNovelBackground::create(this);
|
|
|
|
// Stage VN Items
|
|
this->vnStage();
|
|
|
|
// UI
|
|
this->canvas = UICanvas::create(this);
|
|
this->textbox = VisualNovelTextboxPrefab::create(this->canvas);
|
|
|
|
// VN Manager
|
|
auto vnManagerItem = this->createSceneItem();
|
|
this->vnManager = vnManagerItem->addComponent<VisualNovelManager>();
|
|
|
|
// Fader (Drawn over the top of everything else)
|
|
this->vnFader = VisualNovelFader::create(canvas);
|
|
} |