axmol/tests/live2d-tests/Source/LAppSprite.hpp

77 lines
1.7 KiB
C++
Raw Normal View History

/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
#pragma once
2022-10-01 16:24:52 +08:00
#include "Rendering/axmol/CubismRenderer_Cocos2dx.hpp"
#include "Rendering/axmol/CubismCommandBuffer_Cocos2dx.hpp"
#include "cocos2d.h"
USING_NS_AX;
/**
* @brief
*
* IDRectの管理
*
*/
class LAppSprite
{
public:
/**
* @brief Rect
*/
struct Rect
{
public:
float left; ///< 左辺
float right; ///< 右辺
float up; ///< 上辺
float down; ///< 下辺
};
/**
* @brief
*
* @param[in] x x座標
* @param[in] y y座標
* @param[in] width
* @param[in] height
* @param[in] textureId ID
* @param[in] programId ID
*/
LAppSprite(backend::Program* program);
/**
* @brief
*/
~LAppSprite();
/**
* @brief IDを指定して描画する
*
*/
void RenderImmidiate(Csm::Rendering::CubismCommandBuffer_Cocos2dx* commandBuffer, backend::TextureBackend* texture, float uvVertex[8]) const;
/**
* @brief
*
* @param[in] r (0.0~1.0)
* @param[in] g (0.0~1.0)
* @param[in] b (0.0~1.0)
* @param[in] a (0.0~1.0)
*/
void SetColor(float r, float g, float b, float a);
private:
float _spriteColor[4]; ///< 表示カラー
2022-10-18 19:17:36 +08:00
ax::backend::Program* _program;
};