Barely progress on tilesets

This commit is contained in:
2022-12-04 21:25:13 -08:00
parent b5d7c927c5
commit bcdb0742f3
23 changed files with 330 additions and 23 deletions

View File

@ -17,5 +17,23 @@ target_include_directories(${DAWN_TARGET_NAME}
# Subdirs
add_subdirectory(game)
add_subdirectory(prefabs)
add_subdirectory(ui)
add_subdirectory(visualnovel)
add_subdirectory(visualnovel)
# Assets
tool_texture(texture_test texture_test.png)
tool_texture(texture_penny characters/penny/penny-blink.png)
tool_truetype(truetype_ark
ark-pixel.ttf
truetype_ark
96
96
10
)
add_dependencies(${DAWN_TARGET_NAME}
texture_test
texture_penny
truetype_ark
)

View File

@ -7,8 +7,4 @@
target_sources(${DAWN_TARGET_NAME}
PRIVATE
DawnGame.cpp
)
tool_texture(texture_test texture_test.png texture_test)
add_dependencies(${DAWN_TARGET_NAME} texture_test)
)

View File

@ -0,0 +1,10 @@
# Copyright (c) 2022 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
# target_sources(${DAWN_TARGET_NAME}
# PRIVATE
# VNPlayer.cpp
# )

View File

@ -0,0 +1,33 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "asset/AssetManager.hpp"
#include "asset/Asset.hpp"
#include "poker/PokerPlayer.hpp"
#include "scene/components/Components.hpp"
namespace Dawn {
class VNPenny {
public:
static std::vector<Asset*> getAssets(AssetManager *assMan) {
return std::vector<Asset*>{
assMan->get<TextureAsset>("texture_penny")
};
}
static SceneItem * create(Scene *scene) {
auto item = scene->createSceneItem();
auto meshRenderer = item->addComponent<MeshRenderer>();
auto material = item->addComponent<Material>();
auto meshHost = item->addComponent<MeshHost>();
auto tiledSprite = item->addComponent<TiledSprite>();
auto pokerPlayer = item->addComponent<PokerPlayer>();
return item;
}
};
}

View File

@ -16,6 +16,7 @@
#include "visualnovel/events/PokerInitialEvent.hpp"
#include "visualnovel/events/SimpleLoopEvent.hpp"
#include "ui/PokerPlayerDisplay.hpp"
#include "prefabs/VNPenny.hpp"
namespace Dawn {
class TestScene : public Scene {
@ -30,6 +31,7 @@ namespace Dawn {
vectorAppend(&assets, &PokerGameTextbox::getAssets(assMan));
vectorAppend(&assets, &PokerPlayerDisplay::getAssets(assMan));
vectorAppend(&assets, &VNPenny::getAssets(assMan));
return assets;
}
@ -52,12 +54,11 @@ namespace Dawn {
auto pokerGame = pokerGameItem->addComponent<PokerGame>();
for(int32_t i = 0; i < 5; i++) {
auto pokerPlayerInstance = this->createSceneItem();
auto pokerPlayer = pokerPlayerInstance->addComponent<PokerPlayer>();
auto player = VNPenny::create(this);
auto uiPlayer = canvas->addElement<PokerPlayerDisplay>();
uiPlayer->setTransform(UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_STRETCH, glm::vec4(i * 220, 0, 0, 0), 0);
uiPlayer->setPlayer(pokerPlayer);
uiPlayer->setPlayer(player->getComponent<PokerPlayer>());
}
auto betting = vnManager

View File

@ -3,5 +3,11 @@
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DAWN_TARGET_NAME}
PRIVATE
VNPlayer.cpp
)
# Subdirs
add_subdirectory(events)

View File

@ -0,0 +1,12 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "VNPlayer.hpp"
using namespace Dawn;
VNPlayer::VNPlayer(SceneItem *item) : SceneItemComponent(item) {
}

View File

@ -0,0 +1,18 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "dawnlibs.hpp"
#include "scene/SceneItemComponent.hpp"
namespace Dawn {
class VNPlayer : public SceneItemComponent {
protected:
public:
VNPlayer(SceneItem *item);
};
}