12#ifndef ZOAPPNINESLICE_H
13#define ZOAPPNINESLICE_H
16#include <nlohmann/json.hpp>
19#include "toymaker/shader_program.hpp"
20#include "toymaker/core/resource_database.hpp"
21#include "toymaker/texture.hpp"
56 std::shared_ptr<ToyMaker::Texture> baseTexture,
57 SDL_FRect contentRegionUV
79 std::shared_ptr<ToyMaker::Texture>
generateTexture(glm::uvec2 contentDimensions)
const;
177 std::shared_ptr<ToyMaker::IResource>
createResource(
const nlohmann::json& methodParameters)
override;
182 {NineSlicePanel::ScaleMode::STRETCH,
"stretch"},
183 {NineSlicePanel::ScaleMode::TILE,
"tile"},
NineSlicePanelFromDescription()
creates an instance of this constructor.
Definition nine_slice_panel.hpp:162
std::shared_ptr< ToyMaker::IResource > createResource(const nlohmann::json &methodParameters) override
Creates a NineSlicePanel resource from its JSON description.
Definition nine_slice_panel.cpp:163
static std::string getResourceConstructorName()
Gets the resource constructor type string associated with this class.
Definition nine_slice_panel.hpp:169
Resource responsible for resizing a texture using the 9-slice technique, for use in UI elements.
Definition nine_slice_panel.hpp:38
std::shared_ptr< ToyMaker::Texture > generateTexture(glm::uvec2 contentDimensions) const
Generates a new texture based on this panel resource, where the dimensions of the central region of t...
Definition nine_slice_panel.cpp:61
uint32_t getOffsetPixelBottom() const
Gets the height, in pixels, of the panel slices on the bottom side of this resource's base texture.
Definition nine_slice_panel.cpp:147
GLuint mVertexArrayObject
The vertex array object used by this resource's panel shader.
Definition nine_slice_panel.hpp:132
ScaleMode
The type of texture sampling to be used on the resizable regions of the base texture.
Definition nine_slice_panel.hpp:44
SDL_FRect mContentRegion
The central region of the texture, resized to fit any content placed within a panel generated from th...
Definition nine_slice_panel.hpp:120
static std::string getResourceTypeName()
Gets the resource type string associated with this class.
Definition nine_slice_panel.hpp:71
std::shared_ptr< ToyMaker::Texture > mTexture
The base texture used to generate new textures.
Definition nine_slice_panel.hpp:114
uint32_t getOffsetPixelTop() const
Gets the height, in pixels, of the panel slices on the top side of this resource's base texture.
Definition nine_slice_panel.cpp:153
std::shared_ptr< ToyMaker::ShaderProgram > mShaderHandle
The shader responsible for producing panell textures from a base texture.
Definition nine_slice_panel.hpp:126
uint32_t getOffsetPixelRight() const
Gets the width, in pixels, of the panel slices on the right hand side of this resource's base texture...
Definition nine_slice_panel.cpp:138
~NineSlicePanel()
Destroys the NineSlicePanel object.
Definition nine_slice_panel.cpp:55
NineSlicePanel(std::shared_ptr< ToyMaker::Texture > baseTexture, SDL_FRect contentRegionUV)
Constructs a new NineSlicePanel aspect.
Definition nine_slice_panel.cpp:8
uint32_t getOffsetPixelLeft() const
Gets the width, in pixels, of the panel slices on the left hand side of this resource's base texture.
Definition nine_slice_panel.cpp:132
An object representing one method for creating a resource of a given kind.
Definition resource_database.hpp:474
ResourceConstructor(int explicitlyInitializeMe)
Definition resource_database.hpp:491
The base class for any type whose creation and storage should be managed by the ResourceDatabase.
Definition resource_database.hpp:372
Namespace containing all class definitions and functions related to the ToyMaker engine.
Definition camera_system.hpp:20