receive vector of colors

This commit is contained in:
jrkb 2023-06-27 17:16:15 +02:00
parent 106db1462c
commit 6946f49b34
2 changed files with 3 additions and 2 deletions

View file

@ -316,7 +316,7 @@ void MsdfLayer::setBoundingBox(const Layer::BoundingBox & boundingBox){
bool MsdfLayer::collectCharacter(const char character,
vector <ofNode> & nodes,
const ofCamera & camera,
glm::vec4 color,
const vector <glm::vec4> & colors,
ofxVariableLab::FontVariation fontVariation){
OFX_PROFILER_FUNCTION()
@ -372,6 +372,7 @@ bool MsdfLayer::collectCharacter(const char character,
glm::vec2 uv3_b = glm::vec2(scale_b.x, 0) + translation_b;
for(int i = 0; i < nodes.size(); i++){
const glm::vec4 & color = colors[i];
ofNode & node = nodes[i];
glm::vec4 p0 = node.getGlobalTransformMatrix() * glm::vec4(0, 0, 0, 1);
glm::vec4 p1 = node.getGlobalTransformMatrix() * glm::vec4(0, h, 0, 1);

View file

@ -59,7 +59,7 @@ class MsdfLayer : public Layer {
bool collectCharacter(const char character,
vector <ofNode> & nodes,
const ofCamera & camera,
glm::vec4 color = glm::vec4(1, 1, 1, 1),
const vector <glm::vec4> & colors,
ofxVariableLab::FontVariation fontVariation = ofxVariableLab::FontVariation());
void setAtlas(shared_ptr <ofxMsdfgen::Atlas> _atlas);