axmol/samples/TestCpp/Classes/LabelTest/LabelTest.h

297 lines
5.6 KiB
C
Raw Normal View History

2010-09-07 11:47:54 +08:00
#ifndef _ATLAS_TEST_H_
#define _ATLAS_TEST_H_
#include "../testBasic.h"
class AtlasDemo : public CCLayer
{
protected:
2010-09-07 11:47:54 +08:00
public:
AtlasDemo(void);
~AtlasDemo(void);
virtual std::string title();
virtual std::string subtitle();
virtual void onEnter();
void restartCallback(CCObject* pSender);
void nextCallback(CCObject* pSender);
void backCallback(CCObject* pSender);
2010-09-07 11:47:54 +08:00
};
class Atlas1 : public AtlasDemo
{
CCTextureAtlas* m_textureAtlas;
public:
Atlas1();
~Atlas1();
virtual std::string title();
virtual std::string subtitle();
virtual void draw();
2010-09-07 11:47:54 +08:00
};
class LabelAtlasTest : public AtlasDemo
{
2012-06-08 13:55:28 +08:00
float m_time;
public:
LabelAtlasTest();
2010-09-07 11:47:54 +08:00
2012-06-08 13:55:28 +08:00
virtual void step(float dt);
2010-09-07 11:47:54 +08:00
virtual std::string title();
virtual std::string subtitle();
2010-09-07 11:47:54 +08:00
};
class LabelAtlasColorTest : public AtlasDemo
{
2012-06-08 13:55:28 +08:00
float m_time;
public:
LabelAtlasColorTest();
2012-06-08 13:55:28 +08:00
virtual void step(float dt);
virtual std::string title();
virtual std::string subtitle();
};
2010-09-07 11:47:54 +08:00
class LabelTTFAlignment : public AtlasDemo
{
public:
LabelTTFAlignment();
virtual std::string title();
virtual std::string subtitle();
};
2010-09-07 11:47:54 +08:00
class Atlas3 : public AtlasDemo
{
2012-06-08 13:55:28 +08:00
float m_time;
public:
Atlas3();
2010-09-07 11:47:54 +08:00
2012-06-08 13:55:28 +08:00
virtual void step(float dt);
2010-09-07 11:47:54 +08:00
virtual std::string title();
virtual std::string subtitle();
2010-09-07 11:47:54 +08:00
};
class Atlas4 : public AtlasDemo
{
2012-06-08 13:55:28 +08:00
float m_time;
public:
Atlas4();
2012-06-08 13:55:28 +08:00
virtual void step(float dt);
virtual void draw();
2010-09-07 11:47:54 +08:00
virtual std::string title();
virtual std::string subtitle();
2010-09-07 11:47:54 +08:00
};
class Atlas5 : public AtlasDemo
{
public:
Atlas5();
virtual std::string title();
virtual std::string subtitle();
2010-09-07 11:47:54 +08:00
};
class Atlas6 : public AtlasDemo
{
public:
Atlas6();
virtual std::string title();
virtual std::string subtitle();
2010-09-07 11:47:54 +08:00
};
class AtlasBitmapColor : public AtlasDemo
2010-09-07 11:47:54 +08:00
{
public:
AtlasBitmapColor();
virtual std::string title();
2010-09-07 11:47:54 +08:00
virtual std::string subtitle();
2010-09-07 11:47:54 +08:00
};
class AtlasFastBitmap : public AtlasDemo
{
public:
AtlasFastBitmap();
virtual std::string title();
virtual std::string subtitle();
2010-09-07 11:47:54 +08:00
};
2011-02-23 16:47:25 +08:00
class BitmapFontMultiLine : public AtlasDemo
{
public:
BitmapFontMultiLine();
virtual std::string title();
virtual std::string subtitle();
};
class LabelsEmpty : public AtlasDemo
{
public:
LabelsEmpty();
2012-06-08 13:55:28 +08:00
void updateStrings(float dt);
2011-02-23 16:47:25 +08:00
virtual std::string title();
virtual std::string subtitle();
private:
bool setEmpty;
};
class LabelBMFontHD : public AtlasDemo
{
public:
LabelBMFontHD();
virtual std::string title();
virtual std::string subtitle();
};
class LabelAtlasHD : public AtlasDemo
{
public:
LabelAtlasHD();
virtual std::string title();
virtual std::string subtitle();
};
class LabelGlyphDesigner : public AtlasDemo
{
public:
LabelGlyphDesigner();
virtual std::string title();
virtual std::string subtitle();
};
2010-09-07 11:47:54 +08:00
class AtlasTestScene : public TestScene
{
public:
virtual void runThisTest();
};
2011-07-06 14:56:05 +08:00
class LabelTTFTest : public AtlasDemo
{
public:
LabelTTFTest();
virtual ~LabelTTFTest();
virtual std::string title();
virtual std::string subtitle();
private:
void setAlignmentLeft(CCObject* pSender);
void setAlignmentCenter(CCObject* pSender);
void setAlignmentRight(CCObject* pSender);
void setAlignmentTop(CCObject* pSender);
void setAlignmentMiddle(CCObject* pSender);
void setAlignmentBottom(CCObject* pSender);
void updateAlignment();
const char* getCurrentAlignment();
private:
CCLabelTTF* m_plabel;
CCTextAlignment m_eHorizAlign;
CCVerticalTextAlignment m_eVertAlign;
2011-07-06 14:56:05 +08:00
};
class LabelTTFMultiline : public AtlasDemo
{
public:
LabelTTFMultiline();
virtual std::string title();
virtual std::string subtitle();
2011-07-06 14:56:05 +08:00
};
class LabelTTFChinese : public AtlasDemo
{
public:
LabelTTFChinese();
virtual std::string title();
};
class LabelBMFontChinese : public AtlasDemo
{
public:
LabelBMFontChinese();
virtual std::string title();
};
2012-03-22 09:40:32 +08:00
class BitmapFontMultiLineAlignment : public AtlasDemo
{
public:
BitmapFontMultiLineAlignment();
~BitmapFontMultiLineAlignment();
2012-03-22 09:40:32 +08:00
void snapArrowsToEdge();
virtual std::string title();
virtual std::string subtitle();
void stringChanged(CCObject *sender);
void alignmentChanged(CCObject *sender);
virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent);
2012-03-22 09:40:32 +08:00
public:
CCLabelBMFont *m_pLabelShouldRetain;
CCSprite *m_pArrowsBarShouldRetain;
CCSprite *m_pArrowsShouldRetain;
CCMenuItemFont *m_pLastSentenceItem, *m_pLastAlignmentItem;
bool m_drag;
2012-03-22 09:40:32 +08:00
};
2012-03-22 11:48:37 +08:00
class LabelTTFA8Test : public AtlasDemo
{
public:
LabelTTFA8Test();
2012-03-22 11:48:37 +08:00
virtual std::string title();
virtual std::string subtitle();
2012-03-22 11:48:37 +08:00
};
class BMFontOneAtlas : public AtlasDemo
{
public:
BMFontOneAtlas();
2012-03-22 11:48:37 +08:00
virtual std::string title();
virtual std::string subtitle();
2012-03-22 11:48:37 +08:00
};
class BMFontUnicode : public AtlasDemo
{
public:
BMFontUnicode();
2012-03-22 11:48:37 +08:00
virtual std::string title();
virtual std::string subtitle();
2012-03-22 11:48:37 +08:00
};
class BMFontInit : public AtlasDemo
{
public:
BMFontInit();
virtual std::string title();
virtual std::string subtitle();
};
class TTFFontInit : public AtlasDemo
{
public:
TTFFontInit();
virtual std::string title();
virtual std::string subtitle();
};
class Issue1343 : public AtlasDemo
{
public:
Issue1343();
virtual std::string title();
virtual std::string subtitle();
};
2011-07-06 14:56:05 +08:00
// we don't support linebreak mode
2010-09-07 11:47:54 +08:00
#endif