Removed UI and restored debugGrid
This commit is contained in:
4
.github/workflows/build-helloworld-vita.yml
vendored
4
.github/workflows/build-helloworld-vita.yml
vendored
@ -5,9 +5,6 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
VITASDK: /usr/local/vitasdk
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -26,6 +23,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Game
|
- name: Build Game
|
||||||
run: |
|
run: |
|
||||||
|
export VITASDK=/usr/local/vitasdk
|
||||||
export PATH=$VITASDK/bin:$PATH
|
export PATH=$VITASDK/bin:$PATH
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
@ -28,7 +28,7 @@ void Scene::update() {
|
|||||||
this->itemsNotInitialized.clear();
|
this->itemsNotInitialized.clear();
|
||||||
|
|
||||||
#if DAWN_DEBUG_BUILD
|
#if DAWN_DEBUG_BUILD
|
||||||
// this->debugGrid();
|
this->debugGrid();
|
||||||
this->debugOrigin();
|
this->debugOrigin();
|
||||||
this->debugHitboxes();
|
this->debugHitboxes();
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,56 +6,23 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "scene/Scene.hpp"
|
#include "scene/Scene.hpp"
|
||||||
#include "prefabs/SimpleSpinningCubePrefab.hpp"
|
#include "prefabs/SimpleSpinningCubePrefab.hpp"
|
||||||
#include "scene/components/ui/UILabel.hpp"
|
|
||||||
#include "scene/components/ui/UIImage.hpp"
|
|
||||||
#include "display/font/BitmapFont.hpp"
|
|
||||||
|
|
||||||
namespace Dawn {
|
namespace Dawn {
|
||||||
class HelloWorldScene : public Scene {
|
class HelloWorldScene : public Scene {
|
||||||
protected:
|
protected:
|
||||||
Camera *camera;
|
Camera *camera;
|
||||||
SimpleSpinningCubePrefab *cube;
|
SimpleSpinningCubePrefab *cube;
|
||||||
UICanvas *canvas;
|
|
||||||
UILabel *label;
|
|
||||||
UIImage *image;
|
|
||||||
BitmapFont font;
|
|
||||||
|
|
||||||
void stage() override {
|
void stage() override {
|
||||||
camera = Camera::create(this);
|
camera = Camera::create(this);
|
||||||
camera->transform->lookAt(glm::vec3(0, 0, 8), glm::vec3(0, 0, 0));
|
camera->transform->lookAt(glm::vec3(3, 3, 3), glm::vec3(0, 0, 0));
|
||||||
|
|
||||||
cube = SimpleSpinningCubePrefab::create(this);
|
cube = SimpleSpinningCubePrefab::create(this);
|
||||||
|
|
||||||
canvas = UICanvas::create(this);
|
|
||||||
|
|
||||||
auto imageItem = this->createSceneItem();
|
|
||||||
image = imageItem->addComponent<UIImage>();
|
|
||||||
image->color = COLOR_BLACK;
|
|
||||||
imageItem->transform.setParent(canvas->transform);
|
|
||||||
|
|
||||||
auto labelItem = this->createSceneItem();
|
|
||||||
label = labelItem->addComponent<UILabel>();
|
|
||||||
labelItem->transform.setParent(canvas->transform);
|
|
||||||
|
|
||||||
auto assMan = &this->game->assetManager;
|
|
||||||
auto texture = assMan->get<TextureAsset>("testbitmap_texture");
|
|
||||||
auto tileset = assMan->get<TilesetAsset>("testbitmap_tileset");
|
|
||||||
this->font.texture = &texture->texture;
|
|
||||||
this->font.tileset = &tileset->tileset;
|
|
||||||
|
|
||||||
label->text = "Hello World, how are you today? I hope you are doing well. I really like the fact I can ramble in my text for once.";
|
|
||||||
label->font = &font;
|
|
||||||
label->maxWidth = 220;
|
|
||||||
|
|
||||||
image->alignment = glm::vec4(0, 0, label->getContentWidth(), label->getContentHeight());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Asset*> getRequiredAssets() override {
|
std::vector<Asset*> getRequiredAssets() override {
|
||||||
auto assMan = &this->game->assetManager;
|
auto assMan = &this->game->assetManager;
|
||||||
std::vector<Asset*> assets;
|
std::vector<Asset*> assets;
|
||||||
vectorAppend(&assets, SimpleSpinningCubePrefab::getRequiredAssets(assMan));
|
vectorAppend(&assets, SimpleSpinningCubePrefab::getRequiredAssets(assMan));
|
||||||
assets.push_back(assMan->get<TextureAsset>("testbitmap_texture"));
|
|
||||||
assets.push_back(assMan->get<TilesetAsset>("testbitmap_tileset"));
|
|
||||||
return assets;
|
return assets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user