Just breaking stuff
This commit is contained in:
32
archive/dawntictactoe/prefabs/SimpleLabel.hpp
Normal file
32
archive/dawntictactoe/prefabs/SimpleLabel.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "prefab/SceneItemPrefab.hpp"
|
||||
#include "scene/components/ui/UILabel.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class SimpleLabel : public SceneItemPrefab<SimpleLabel> {
|
||||
public:
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *ass) {
|
||||
return { ass->get<TrueTypeAsset>("truetype_bizudp") };
|
||||
}
|
||||
|
||||
//
|
||||
UILabel *label;
|
||||
|
||||
SimpleLabel(Scene *s, sceneitemid_t i) :
|
||||
SceneItemPrefab<SimpleLabel>(s, i)
|
||||
{
|
||||
}
|
||||
|
||||
void prefabInit(AssetManager *man) override {
|
||||
auto font = man->get<TrueTypeAsset>("truetype_bizudp");
|
||||
|
||||
label = this->addComponent<UILabel>();
|
||||
label->font = &font->font;
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user