25 lines
762 B
C++
25 lines
762 B
C++
// Copyright (c) 2023 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "prefab/UIPrefab.hpp"
|
|
#include "ui/UIBorder.hpp"
|
|
|
|
namespace Dawn {
|
|
class UIBorderPrefab : public UIPrefab<UIBorder, UIBorderPrefab> {
|
|
public:
|
|
static std::vector<Asset*> prefabAssets(AssetManager *man) {
|
|
std::vector<Asset*> assets;
|
|
assets.push_back(man->get<TextureAsset>("texture_test"));
|
|
return assets;
|
|
}
|
|
|
|
static void prefabApply(AssetManager *man, UIBorder *border) {
|
|
auto text = man->get<TextureAsset>("texture_test");
|
|
border->texture = &text->texture;
|
|
border->setBorderSize(glm::vec2(4, 4));
|
|
}
|
|
};
|
|
} |