2010-09-07 11:47:54 +08:00
|
|
|
#ifndef _ATLAS_TEST_H_
|
|
|
|
#define _ATLAS_TEST_H_
|
|
|
|
|
|
|
|
#include "../testBasic.h"
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2010-09-07 11:47:54 +08:00
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
class AtlasDemo : public BaseTest
|
2010-09-07 11:47:54 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
protected:
|
2010-09-07 11:47:54 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
|
|
|
AtlasDemo(void);
|
|
|
|
~AtlasDemo(void);
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void restartCallback(Object* pSender);
|
|
|
|
void nextCallback(Object* pSender);
|
|
|
|
void backCallback(Object* pSender);
|
2010-09-07 11:47:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class Atlas1 : public AtlasDemo
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
TextureAtlas* _textureAtlas;
|
2012-04-19 14:35:52 +08:00
|
|
|
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
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
float _time;
|
2012-04-19 14:35:52 +08:00
|
|
|
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
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2010-09-07 11:47:54 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class LabelAtlasColorTest : public AtlasDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
float _time;
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
|
|
|
LabelAtlasColorTest();
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void step(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2013-02-28 15:57:15 +08:00
|
|
|
void actionFinishCallback();
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
2010-09-07 11:47:54 +08:00
|
|
|
|
2012-06-12 14:33:53 +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
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
float _time;
|
2012-04-19 14:35:52 +08:00
|
|
|
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
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2010-09-07 11:47:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Atlas4 : public AtlasDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
float _time;
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
|
|
|
Atlas4();
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void step(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void draw();
|
2010-09-07 11:47:54 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2010-09-07 11:47:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Atlas5 : public AtlasDemo
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
|
|
|
Atlas5();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2010-09-07 11:47:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class Atlas6 : public AtlasDemo
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
|
|
|
Atlas6();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2010-09-07 11:47:54 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class AtlasBitmapColor : public AtlasDemo
|
2010-09-07 11:47:54 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
|
|
|
AtlasBitmapColor();
|
|
|
|
virtual std::string title();
|
2010-09-07 11:47:54 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string subtitle();
|
2010-09-07 11:47:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class AtlasFastBitmap : public AtlasDemo
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
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:
|
2012-04-19 14:35:52 +08:00
|
|
|
LabelTTFTest();
|
2012-06-12 14:33:53 +08:00
|
|
|
virtual ~LabelTTFTest();
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-06-12 14:33:53 +08:00
|
|
|
private:
|
2013-06-20 14:17:10 +08:00
|
|
|
void setAlignmentLeft(Object* pSender);
|
|
|
|
void setAlignmentCenter(Object* pSender);
|
|
|
|
void setAlignmentRight(Object* pSender);
|
|
|
|
void setAlignmentTop(Object* pSender);
|
|
|
|
void setAlignmentMiddle(Object* pSender);
|
|
|
|
void setAlignmentBottom(Object* pSender);
|
2012-11-20 18:17:47 +08:00
|
|
|
void updateAlignment();
|
2012-06-12 14:33:53 +08:00
|
|
|
const char* getCurrentAlignment();
|
|
|
|
private:
|
2013-06-20 14:17:10 +08:00
|
|
|
LabelTTF* _plabel;
|
|
|
|
TextAlignment _horizAlign;
|
|
|
|
VerticalTextAlignment _vertAlign;
|
2011-07-06 14:56:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class LabelTTFMultiline : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
LabelTTFMultiline();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2011-07-06 14:56:05 +08:00
|
|
|
};
|
|
|
|
|
2011-08-18 18:40:24 +08:00
|
|
|
class LabelTTFChinese : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
LabelTTFChinese();
|
|
|
|
virtual std::string title();
|
2011-08-18 18:40:24 +08:00
|
|
|
};
|
|
|
|
|
2012-01-18 18:43:41 +08:00
|
|
|
class LabelBMFontChinese : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LabelBMFontChinese();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
2012-03-22 09:40:32 +08:00
|
|
|
class BitmapFontMultiLineAlignment : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
BitmapFontMultiLineAlignment();
|
|
|
|
~BitmapFontMultiLineAlignment();
|
2012-03-22 09:40:32 +08:00
|
|
|
void snapArrowsToEdge();
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2013-06-20 14:17:10 +08:00
|
|
|
void stringChanged(Object *sender);
|
|
|
|
void alignmentChanged(Object *sender);
|
|
|
|
virtual void ccTouchesBegan(Set *pTouches, Event *pEvent);
|
|
|
|
virtual void ccTouchesEnded(Set *pTouches, Event *pEvent);
|
|
|
|
virtual void ccTouchesMoved(Set *pTouches, Event *pEvent);
|
2012-03-22 09:40:32 +08:00
|
|
|
|
|
|
|
public:
|
2013-06-20 14:17:10 +08:00
|
|
|
LabelBMFont *_labelShouldRetain;
|
|
|
|
Sprite *_arrowsBarShouldRetain;
|
|
|
|
Sprite *_arrowsShouldRetain;
|
|
|
|
MenuItemFont *_lastSentenceItem, *_lastAlignmentItem;
|
2013-06-15 14:03:30 +08:00
|
|
|
bool _drag;
|
2012-03-22 09:40:32 +08:00
|
|
|
};
|
|
|
|
|
2012-03-22 11:48:37 +08:00
|
|
|
class LabelTTFA8Test : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
LabelTTFA8Test();
|
2012-03-22 11:48:37 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-03-22 11:48:37 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class BMFontOneAtlas : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
BMFontOneAtlas();
|
2012-03-22 11:48:37 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string subtitle();
|
2012-03-22 11:48:37 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class BMFontUnicode : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
BMFontUnicode();
|
2012-03-22 11:48:37 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-03-22 11:48:37 +08:00
|
|
|
};
|
|
|
|
|
2012-06-12 14:33:53 +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();
|
|
|
|
};
|
|
|
|
|
2013-04-26 09:22:26 +08:00
|
|
|
class TTFFontShadowAndStroke : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TTFFontShadowAndStroke();
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-06-12 14:33:53 +08:00
|
|
|
class Issue1343 : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Issue1343();
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2012-11-20 18:17:47 +08:00
|
|
|
class LabelBMFontBounds : public AtlasDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LabelBMFontBounds();
|
|
|
|
|
|
|
|
virtual void draw();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
private:
|
2013-06-20 14:17:10 +08:00
|
|
|
LabelBMFont *label1;
|
2012-11-20 18:17:47 +08:00
|
|
|
};
|
|
|
|
|
2011-07-06 14:56:05 +08:00
|
|
|
// we don't support linebreak mode
|
|
|
|
|
2010-09-07 11:47:54 +08:00
|
|
|
#endif
|