12#ifndef ZOAPPNINESLICE_H
13#define ZOAPPNINESLICE_H
16#include <nlohmann/json.hpp>
58 std::shared_ptr<ToyMaker::Texture> baseTexture,
59 SDL_FRect contentRegionUV
81 std::shared_ptr<ToyMaker::Texture>
generateTexture(glm::uvec2 contentDimensions)
const;
179 std::shared_ptr<ToyMaker::IResource>
createResource(
const nlohmann::json& methodParameters)
override;
184 {NineSlicePanel::ScaleMode::STRETCH,
"stretch"},
185 {NineSlicePanel::ScaleMode::TILE,
"tile"},
static std::string getResourceConstructorName()
Gets the resource constructor type string associated with this class.
Definition nine_slice_panel.hpp:171
std::shared_ptr< ToyMaker::IResource > createResource(const nlohmann::json &methodParameters) override
Creates a NineSlicePanel resource from its JSON description.
Definition nine_slice_panel.cpp:165
NineSlicePanelFromDescription()
creates an instance of this constructor.
Definition nine_slice_panel.hpp:164
Resource responsible for resizing a texture using the 9-slice technique, for use in UI elements.
Definition nine_slice_panel.hpp:40
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:63
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:149
ScaleMode
The type of texture sampling to be used on the resizable regions of the base texture.
Definition nine_slice_panel.hpp:46
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:122
std::shared_ptr< ToyMaker::ShaderProgram > mShaderHandle
The shader responsible for producing panell textures from a base texture.
Definition nine_slice_panel.hpp:128
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:155
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:140
~NineSlicePanel()
Destroys the NineSlicePanel object.
Definition nine_slice_panel.cpp:57
NineSlicePanel(std::shared_ptr< ToyMaker::Texture > baseTexture, SDL_FRect contentRegionUV)
Constructs a new NineSlicePanel aspect.
Definition nine_slice_panel.cpp:10
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:134
std::shared_ptr< ToyMaker::Texture > mTexture
The base texture used to generate new textures.
Definition nine_slice_panel.hpp:116
static std::string getResourceTypeName()
Gets the resource type string associated with this class.
Definition nine_slice_panel.hpp:73
GLuint mVertexArrayObject
The vertex array object used by this resource's panel shader.
Definition nine_slice_panel.hpp:134
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 application.hpp:24
Headers relating to resources and their management for a given project.
A file containing class definitions for wrappers over OpenGL shader programs.
Header containing definitions of classes and functions related to loading and using Texture resources...