mirror of https://github.com/axmolengine/axmol.git
fix label not appear on the screen
This commit is contained in:
parent
e017609fc4
commit
b14999a7a7
|
@ -500,7 +500,7 @@ void Label::setFontSize(int fontSize)
|
|||
Node::setScale(1.0f*_fontSize/DISTANCEFIELD_ATLAS_FONTSIZE);
|
||||
}
|
||||
|
||||
void Label::draw()
|
||||
void Label::onDraw()
|
||||
{
|
||||
CC_PROFILER_START("CCSpriteBatchNode - draw");
|
||||
|
||||
|
@ -527,6 +527,13 @@ void Label::draw()
|
|||
CC_PROFILER_STOP("CCSpriteBatchNode - draw");
|
||||
}
|
||||
|
||||
void Label::draw()
|
||||
{
|
||||
_customCommand.init(0, _vertexZ);
|
||||
_customCommand.func = CC_CALLBACK_0(Label::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(&_customCommand);
|
||||
}
|
||||
|
||||
///// PROTOCOL STUFF
|
||||
|
||||
Sprite * Label::getLetter(int ID)
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "CCSpriteBatchNode.h"
|
||||
#include "CCLabelTextFormatProtocol.h"
|
||||
#include "ccTypes.h"
|
||||
#include "renderer/CCCustomCommand.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -119,6 +120,7 @@ public:
|
|||
|
||||
virtual std::string getDescription() const override;
|
||||
virtual void draw(void) override;
|
||||
virtual void onDraw();
|
||||
|
||||
private:
|
||||
/**
|
||||
|
@ -172,7 +174,8 @@ private:
|
|||
Color3B _effectColor;
|
||||
|
||||
GLuint _uniformEffectColor;
|
||||
|
||||
|
||||
CustomCommand _customCommand;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue