mirror of https://github.com/axmolengine/axmol.git
Migrate
This commit is contained in:
parent
abd9338a7a
commit
376941da91
|
@ -6,7 +6,7 @@ Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
Copyright (c) 2021-2022 Bytedance Inc.
|
||||
|
||||
https://axmolengine.github.io/axis
|
||||
https://axmolengine.github.io/axmol
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -5,7 +5,7 @@ Copyright (c) 2011 Zynga Inc.
|
|||
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
||||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
|
||||
https://axmolengine.github.io/
|
||||
https://axmolengine.github.io/axmol
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -376,7 +376,6 @@ THE SOFTWARE.
|
|||
#endif
|
||||
|
||||
namespace ax {}
|
||||
namespace axis = ax; // DEPRECATED
|
||||
namespace axmol = ax; // DEPRECATED
|
||||
namespace axmol = ax;
|
||||
// end of namespace group
|
||||
/// @}
|
||||
|
|
|
@ -32,7 +32,7 @@ DEFINE_TEST_SUITE(ActionManagerTests);
|
|||
class ActionManagerTest : public TestCase
|
||||
{
|
||||
protected:
|
||||
axis::TextureAtlas* _atlas;
|
||||
ax::TextureAtlas* _atlas;
|
||||
|
||||
std::string _title;
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@ DEFINE_TEST_SUITE(ActionsEaseTests);
|
|||
class EaseSpriteDemo : public TestCase
|
||||
{
|
||||
protected:
|
||||
axis::Sprite* _grossini;
|
||||
axis::Sprite* _tamara;
|
||||
axis::Sprite* _kathia;
|
||||
ax::Sprite* _grossini;
|
||||
ax::Sprite* _tamara;
|
||||
ax::Sprite* _kathia;
|
||||
|
||||
std::string _title;
|
||||
|
||||
|
|
|
@ -1663,7 +1663,7 @@ void Issue1305::onEnter()
|
|||
|
||||
void Issue1305::log(Node* sender)
|
||||
{
|
||||
axis::log("This message SHALL ONLY appear when the sprite is added to the scene, NOT BEFORE");
|
||||
ax::log("This message SHALL ONLY appear when the sprite is added to the scene, NOT BEFORE");
|
||||
}
|
||||
|
||||
void Issue1305::onExit()
|
||||
|
@ -2140,11 +2140,11 @@ void ActionResize::onEnter()
|
|||
imageViewResize->setContentSize(Size(50.0f, 40.0f));
|
||||
imageViewResize->setPosition(Vec2((widgetSize.width / 2.0f) + offset.x, (widgetSize.height / 2.0f) + offset.y));
|
||||
|
||||
auto resizeDown = axis::ResizeTo::create(2.8f, Size(50.0f, 40.0f));
|
||||
auto resizeUp = axis::ResizeTo::create(2.8f, Size(300.0f, 40.0f));
|
||||
auto resizeDown = ax::ResizeTo::create(2.8f, Size(50.0f, 40.0f));
|
||||
auto resizeUp = ax::ResizeTo::create(2.8f, Size(300.0f, 40.0f));
|
||||
|
||||
auto resizeByDown = axis::ResizeBy::create(1.8f, Size(0.0f, -30.0f));
|
||||
auto resizeByUp = axis::ResizeBy::create(1.8f, Size(0.0f, 30.0f));
|
||||
auto resizeByDown = ax::ResizeBy::create(1.8f, Size(0.0f, -30.0f));
|
||||
auto resizeByUp = ax::ResizeBy::create(1.8f, Size(0.0f, 30.0f));
|
||||
addChild(imageViewResize);
|
||||
auto rep = RepeatForever::create(Sequence::create(resizeUp, resizeDown, resizeByDown, resizeByUp, nullptr));
|
||||
imageViewResize->runAction(rep);
|
||||
|
@ -2155,11 +2155,11 @@ void ActionResize::onEnter()
|
|||
imageViewScale->setContentSize(Size(50.0f, 40.0f));
|
||||
imageViewScale->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
|
||||
|
||||
auto scaleDownScale = axis::ScaleTo::create(2.8f, 1.0f);
|
||||
auto scaleUpScale = axis::ScaleTo::create(2.8f, 6.0f, 1.0f);
|
||||
auto scaleDownScale = ax::ScaleTo::create(2.8f, 1.0f);
|
||||
auto scaleUpScale = ax::ScaleTo::create(2.8f, 6.0f, 1.0f);
|
||||
|
||||
auto scaleByDownScale = axis::ScaleBy::create(1.8f, 1.0f, 0.25f);
|
||||
auto scaleByUpScale = axis::ScaleBy::create(1.8f, 1.0f, 4.0f);
|
||||
auto scaleByDownScale = ax::ScaleBy::create(1.8f, 1.0f, 0.25f);
|
||||
auto scaleByUpScale = ax::ScaleBy::create(1.8f, 1.0f, 4.0f);
|
||||
addChild(imageViewScale);
|
||||
auto rep2 = RepeatForever::create(
|
||||
Sequence::create(scaleUpScale, scaleDownScale, scaleByDownScale, scaleByUpScale, nullptr));
|
||||
|
@ -2227,8 +2227,8 @@ void Issue14936_1::onEnter()
|
|||
ActionsDemo::onEnter();
|
||||
centerSprites(0);
|
||||
|
||||
auto origin = axis::Director::getInstance()->getVisibleOrigin();
|
||||
auto visibleSize = axis::Director::getInstance()->getVisibleSize();
|
||||
auto origin = ax::Director::getInstance()->getVisibleOrigin();
|
||||
auto visibleSize = ax::Director::getInstance()->getVisibleSize();
|
||||
|
||||
_count = 0;
|
||||
|
||||
|
@ -2256,8 +2256,8 @@ void Issue14936_2::onEnter()
|
|||
ActionsDemo::onEnter();
|
||||
centerSprites(0);
|
||||
|
||||
auto origin = axis::Director::getInstance()->getVisibleOrigin();
|
||||
auto visibleSize = axis::Director::getInstance()->getVisibleSize();
|
||||
auto origin = ax::Director::getInstance()->getVisibleOrigin();
|
||||
auto visibleSize = ax::Director::getInstance()->getVisibleSize();
|
||||
|
||||
_count = 0;
|
||||
auto counterLabel = Label::createWithTTF("0", "fonts/Marker Felt.ttf", 16.0f);
|
||||
|
@ -2303,21 +2303,21 @@ void SequenceWithFinalInstant::onEnter()
|
|||
{
|
||||
TestCase::onEnter();
|
||||
|
||||
_manager = new axis::ActionManager();
|
||||
_manager = new ax::ActionManager();
|
||||
|
||||
_target = axis::Node::create();
|
||||
_target = ax::Node::create();
|
||||
_target->setActionManager(_manager);
|
||||
_target->retain();
|
||||
_target->onEnter();
|
||||
|
||||
bool called(false);
|
||||
const auto f([&called]() -> void {
|
||||
axis::log("Callback called.");
|
||||
ax::log("Callback called.");
|
||||
called = true;
|
||||
});
|
||||
|
||||
const auto action =
|
||||
axis::Sequence::create(axis::DelayTime::create(0.05f), axis::CallFunc::create(f), nullptr);
|
||||
ax::Sequence::create(ax::DelayTime::create(0.05f), ax::CallFunc::create(f), nullptr);
|
||||
|
||||
_target->runAction(action);
|
||||
_manager->update(0);
|
||||
|
|
|
@ -34,9 +34,9 @@ DEFINE_TEST_SUITE(ActionsTests);
|
|||
class ActionsDemo : public TestCase
|
||||
{
|
||||
protected:
|
||||
axis::Sprite* _grossini;
|
||||
axis::Sprite* _tamara;
|
||||
axis::Sprite* _kathia;
|
||||
ax::Sprite* _grossini;
|
||||
ax::Sprite* _tamara;
|
||||
ax::Sprite* _kathia;
|
||||
|
||||
public:
|
||||
virtual void onEnter() override;
|
||||
|
@ -184,7 +184,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::EventListenerCustom* _frameDisplayedListener;
|
||||
ax::EventListenerCustom* _frameDisplayedListener;
|
||||
};
|
||||
|
||||
class ActionSequence : public ActionsDemo
|
||||
|
@ -402,9 +402,9 @@ public:
|
|||
virtual void onEnter() override;
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void addNewSpriteWithCoords(axis::Vec2 p);
|
||||
virtual void runActionsInSprite(axis::Sprite* sprite);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
virtual void addNewSpriteWithCoords(ax::Vec2 p);
|
||||
virtual void runActionsInSprite(ax::Sprite* sprite);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
};
|
||||
|
||||
class ActionMoveStacked : public ActionStacked
|
||||
|
@ -413,7 +413,7 @@ public:
|
|||
CREATE_FUNC(ActionMoveStacked);
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual void runActionsInSprite(axis::Sprite* sprite) override;
|
||||
virtual void runActionsInSprite(ax::Sprite* sprite) override;
|
||||
};
|
||||
|
||||
class ActionMoveJumpStacked : public ActionStacked
|
||||
|
@ -422,7 +422,7 @@ public:
|
|||
CREATE_FUNC(ActionMoveJumpStacked);
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual void runActionsInSprite(axis::Sprite* sprite) override;
|
||||
virtual void runActionsInSprite(ax::Sprite* sprite) override;
|
||||
};
|
||||
|
||||
class ActionMoveBezierStacked : public ActionStacked
|
||||
|
@ -431,7 +431,7 @@ public:
|
|||
CREATE_FUNC(ActionMoveBezierStacked);
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual void runActionsInSprite(axis::Sprite* sprite) override;
|
||||
virtual void runActionsInSprite(ax::Sprite* sprite) override;
|
||||
};
|
||||
|
||||
class ActionCatmullRomStacked : public ActionsDemo
|
||||
|
@ -468,7 +468,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::Sprite* _spriteTmp;
|
||||
ax::Sprite* _spriteTmp;
|
||||
};
|
||||
|
||||
class Issue1305_2 : public ActionsDemo
|
||||
|
@ -513,7 +513,7 @@ public:
|
|||
virtual void onEnter() override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual std::string title() const override;
|
||||
void logSprRotation(axis::Sprite* sender);
|
||||
void logSprRotation(ax::Sprite* sender);
|
||||
};
|
||||
|
||||
class Issue1398 : public ActionsDemo
|
||||
|
@ -580,7 +580,7 @@ public:
|
|||
virtual std::string title() const override;
|
||||
|
||||
private:
|
||||
axis::Vector<Node*> _pausedTargets;
|
||||
ax::Vector<Node*> _pausedTargets;
|
||||
};
|
||||
|
||||
class ActionResize : public ActionsDemo
|
||||
|
@ -637,8 +637,8 @@ public:
|
|||
virtual void onExit() override;
|
||||
|
||||
private:
|
||||
axis::ActionManager* _manager;
|
||||
axis::Node* _target;
|
||||
ax::ActionManager* _manager;
|
||||
ax::Node* _target;
|
||||
};
|
||||
|
||||
class Issue18003 : public ActionsDemo
|
||||
|
@ -651,8 +651,8 @@ public:
|
|||
virtual void onExit() override;
|
||||
|
||||
private:
|
||||
axis::ActionManager* _manager;
|
||||
axis::Node* _target;
|
||||
ax::ActionManager* _manager;
|
||||
ax::Node* _target;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -35,7 +35,7 @@ class TestController;
|
|||
|
||||
Private inheritance here hides part of interface from Director.
|
||||
*/
|
||||
class AppDelegate : private axis::Application
|
||||
class AppDelegate : private ax::Application
|
||||
{
|
||||
public:
|
||||
AppDelegate();
|
||||
|
@ -44,7 +44,7 @@ public:
|
|||
virtual void initGLContextAttrs();
|
||||
|
||||
/**
|
||||
@brief Implement Director and axis::Scene* init code here.
|
||||
@brief Implement Director and ax::Scene* init code here.
|
||||
@return true Initialize success, app continue.
|
||||
@return false Initialize failed, app terminate.
|
||||
*/
|
||||
|
|
|
@ -38,7 +38,7 @@ class TestSuite;
|
|||
/**
|
||||
* Each test case should inherit from TestCase, and add to a TestSuite object.
|
||||
*/
|
||||
class TestCase : public axis::Scene
|
||||
class TestCase : public ax::Scene
|
||||
{
|
||||
public:
|
||||
/** TestCase test type.*/
|
||||
|
@ -73,10 +73,10 @@ public:
|
|||
virtual std::string getActualOutput() const { return ""; }
|
||||
|
||||
/** Callback functions.*/
|
||||
virtual void restartTestCallback(axis::Ref* sender);
|
||||
virtual void nextTestCallback(axis::Ref* sender);
|
||||
virtual void priorTestCallback(axis::Ref* sender);
|
||||
virtual void onBackCallback(axis::Ref* sender);
|
||||
virtual void restartTestCallback(ax::Ref* sender);
|
||||
virtual void nextTestCallback(ax::Ref* sender);
|
||||
virtual void priorTestCallback(ax::Ref* sender);
|
||||
virtual void onBackCallback(ax::Ref* sender);
|
||||
|
||||
/**
|
||||
* You should NEVER call this method, unless you know what you are doing.
|
||||
|
@ -93,19 +93,19 @@ public:
|
|||
void setTestCaseName(std::string_view name) { _testCaseName = name; }
|
||||
std::string getTestCaseName() const { return _testCaseName; }
|
||||
|
||||
const axis::Label* getSubtitleLable() const { return _subtitleLabel; }
|
||||
const axis::MenuItemImage* getRestartTestItem() const { return _restartTestItem; }
|
||||
const ax::Label* getSubtitleLable() const { return _subtitleLabel; }
|
||||
const ax::MenuItemImage* getRestartTestItem() const { return _restartTestItem; }
|
||||
|
||||
virtual void onEnter() override;
|
||||
virtual bool init() override;
|
||||
|
||||
protected:
|
||||
axis::MenuItemImage* _priorTestItem;
|
||||
axis::MenuItemImage* _restartTestItem;
|
||||
axis::MenuItemImage* _nextTestItem;
|
||||
ax::MenuItemImage* _priorTestItem;
|
||||
ax::MenuItemImage* _restartTestItem;
|
||||
ax::MenuItemImage* _nextTestItem;
|
||||
|
||||
axis::Label* _titleLabel;
|
||||
axis::Label* _subtitleLabel;
|
||||
ax::Label* _titleLabel;
|
||||
ax::Label* _subtitleLabel;
|
||||
|
||||
private:
|
||||
TestSuite* _testSuite;
|
||||
|
@ -121,7 +121,7 @@ private:
|
|||
*
|
||||
* @note You should not inherit from TestBase directly.
|
||||
*/
|
||||
class TestBase : public axis::Ref
|
||||
class TestBase : public ax::Ref
|
||||
{
|
||||
public:
|
||||
virtual ~TestBase();
|
||||
|
@ -162,7 +162,7 @@ class TestController;
|
|||
class TestSuite : public TestBase
|
||||
{
|
||||
public:
|
||||
void addTestCase(std::string_view testName, std::function<axis::Scene*()> callback);
|
||||
void addTestCase(std::string_view testName, std::function<ax::Scene*()> callback);
|
||||
|
||||
virtual void restartCurrTest();
|
||||
virtual void enterNextTest();
|
||||
|
@ -172,7 +172,7 @@ public:
|
|||
virtual void runThisTest() override;
|
||||
|
||||
private:
|
||||
std::vector<std::function<axis::Scene*()>> _testCallbacks;
|
||||
std::vector<std::function<ax::Scene*()>> _testCallbacks;
|
||||
|
||||
int _currTestIndex;
|
||||
friend class TestController;
|
||||
|
@ -184,8 +184,8 @@ class TestCustomTableView;
|
|||
* An instance of TestList is a means for displaying hierarchical lists of TestSuite.
|
||||
*/
|
||||
class TestList : public TestBase,
|
||||
public axis::extension::TableViewDataSource,
|
||||
public axis::extension::TableViewDelegate
|
||||
public ax::extension::TableViewDataSource,
|
||||
public ax::extension::TableViewDelegate
|
||||
{
|
||||
public:
|
||||
TestList();
|
||||
|
@ -195,15 +195,15 @@ public:
|
|||
|
||||
virtual void runThisTest() override;
|
||||
|
||||
virtual void tableCellTouched(axis::extension::TableView* table,
|
||||
axis::extension::TableViewCell* cell) override;
|
||||
virtual axis::extension::TableViewCell* tableCellAtIndex(axis::extension::TableView* table,
|
||||
virtual void tableCellTouched(ax::extension::TableView* table,
|
||||
ax::extension::TableViewCell* cell) override;
|
||||
virtual ax::extension::TableViewCell* tableCellAtIndex(ax::extension::TableView* table,
|
||||
ssize_t idx) override;
|
||||
virtual axis::Size tableCellSizeForIndex(axis::extension::TableView* table, ssize_t idx) override;
|
||||
virtual ssize_t numberOfCellsInTableView(axis::extension::TableView* table) override;
|
||||
virtual ax::Size tableCellSizeForIndex(ax::extension::TableView* table, ssize_t idx) override;
|
||||
virtual ssize_t numberOfCellsInTableView(ax::extension::TableView* table) override;
|
||||
|
||||
virtual void scrollViewDidScroll(axis::extension::ScrollView* view) override {}
|
||||
virtual void scrollViewDidZoom(axis::extension::ScrollView* view) override {}
|
||||
virtual void scrollViewDidScroll(ax::extension::ScrollView* view) override {}
|
||||
virtual void scrollViewDidZoom(ax::extension::ScrollView* view) override {}
|
||||
|
||||
void deatchTableView();
|
||||
|
||||
|
@ -211,7 +211,7 @@ private:
|
|||
std::vector<std::function<TestBase*()>> _testCallbacks;
|
||||
bool _cellTouchEnabled;
|
||||
bool _shouldRestoreTableOffset;
|
||||
axis::Vec2 _tableOffset;
|
||||
ax::Vec2 _tableOffset;
|
||||
friend class TestController;
|
||||
TestCustomTableView* _tableView{};
|
||||
};
|
||||
|
@ -238,15 +238,15 @@ private:
|
|||
* BaseTest is retained for compatibility with older versions.
|
||||
* @warning It should soon be removed.
|
||||
*/
|
||||
class BaseTest : public axis::Layer
|
||||
class BaseTest : public ax::Layer
|
||||
{
|
||||
public:
|
||||
virtual std::string title() const { return ""; }
|
||||
virtual std::string subtitle() const { return ""; }
|
||||
|
||||
virtual void restartCallback(axis::Ref* sender) {}
|
||||
virtual void nextCallback(axis::Ref* sender) {}
|
||||
virtual void backCallback(axis::Ref* sender) {}
|
||||
virtual void restartCallback(ax::Ref* sender) {}
|
||||
virtual void nextCallback(ax::Ref* sender) {}
|
||||
virtual void backCallback(ax::Ref* sender) {}
|
||||
|
||||
virtual void onEnter() override {}
|
||||
virtual void onExit() override {}
|
||||
|
|
|
@ -55,19 +55,19 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void update(float dt) override;
|
||||
void addNewBillBoardWithCoords(axis::Vec3 p);
|
||||
void addNewAniBillBoardWithCoords(axis::Vec3 p);
|
||||
void rotateCameraCallback(axis::Ref* sender, float value);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void addNewBillBoardWithCoords(ax::Vec3 p);
|
||||
void addNewAniBillBoardWithCoords(ax::Vec3 p);
|
||||
void rotateCameraCallback(ax::Ref* sender, float value);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
void menuCallback_orientedPoint(axis::Ref* sender);
|
||||
void menuCallback_orientedPlane(axis::Ref* sender);
|
||||
void menuCallback_orientedPoint(ax::Ref* sender);
|
||||
void menuCallback_orientedPlane(ax::Ref* sender);
|
||||
|
||||
protected:
|
||||
axis::Camera* _camera;
|
||||
axis::Layer* _layerBillBoard;
|
||||
ax::Camera* _camera;
|
||||
ax::Layer* _layerBillBoard;
|
||||
|
||||
std::vector<axis::BillBoard*> _billboards;
|
||||
std::vector<ax::BillBoard*> _billboards;
|
||||
};
|
||||
|
||||
DEFINE_TEST_SUITE(BillBoardTests);
|
||||
|
|
|
@ -290,7 +290,7 @@ void Box2DTest::addNewSpriteAtPosition(Vec2 p)
|
|||
parent->addChild(sprite);
|
||||
sprite->setB2Body(body);
|
||||
sprite->setPTMRatio(PTM_RATIO);
|
||||
sprite->setPosition(axis::Vec2(p.x, p.y));
|
||||
sprite->setPosition(ax::Vec2(p.x, p.y));
|
||||
}
|
||||
|
||||
void Box2DTest::update(float dt)
|
||||
|
|
|
@ -47,18 +47,18 @@ public:
|
|||
void initPhysics();
|
||||
void createResetButton();
|
||||
|
||||
void addNewSpriteAtPosition(axis::Vec2 p);
|
||||
void addNewSpriteAtPosition(ax::Vec2 p);
|
||||
void update(float dt) override;
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
void toggleDebugCallback(axis::Ref* sender);
|
||||
void toggleDebugCallback(ax::Ref* sender);
|
||||
|
||||
private:
|
||||
b2World* world;
|
||||
|
||||
axis::Texture2D* _spriteTexture;
|
||||
axis::DrawNode* drawBox2D;
|
||||
axis::extension::PhysicsDebugNodeBox2D g_debugDraw;
|
||||
ax::Texture2D* _spriteTexture;
|
||||
ax::DrawNode* drawBox2D;
|
||||
ax::extension::PhysicsDebugNodeBox2D g_debugDraw;
|
||||
bool showDebugDraw = true;
|
||||
};
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ enum
|
|||
};
|
||||
|
||||
Settings settings;
|
||||
axis::Label* labelDebugDraw;
|
||||
ax::Label* labelDebugDraw;
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ extern TestEntry g_testEntries[MAX_TESTS];
|
|||
|
||||
int RegisterTest(const char* category, const char* name, TestCreateFcn* fcn);
|
||||
|
||||
class Box2DTestBed : public TestCase, axis::Layer
|
||||
class Box2DTestBed : public TestCase, ax::Layer
|
||||
{
|
||||
public:
|
||||
static Box2DTestBed* createWithEntryID(int entryId);
|
||||
|
@ -66,20 +66,20 @@ public:
|
|||
|
||||
bool initWithEntryID(int entryId);
|
||||
|
||||
bool onTouchBegan(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchMoved(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchEnded(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchBegan(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchMoved(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchEnded(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
void onKeyPressed(axis::EventKeyboard::KeyCode code, axis::Event* event);
|
||||
void onKeyReleased(axis::EventKeyboard::KeyCode code, axis::Event* event);
|
||||
void onKeyPressed(ax::EventKeyboard::KeyCode code, ax::Event* event);
|
||||
void onKeyReleased(ax::EventKeyboard::KeyCode code, ax::Event* event);
|
||||
|
||||
void onMouseDown(axis::Event* event);
|
||||
void onMouseUp(axis::Event* event);
|
||||
void onMouseMove(axis::Event* event);
|
||||
void onMouseScroll(axis::Event* event);
|
||||
void onMouseDown(ax::Event* event);
|
||||
void onMouseUp(ax::Event* event);
|
||||
void onMouseMove(ax::Event* event);
|
||||
void onMouseScroll(ax::Event* event);
|
||||
|
||||
axis::EventListenerTouchOneByOne* _touchListener;
|
||||
axis::EventListenerKeyboard* _keyboardListener;
|
||||
ax::EventListenerTouchOneByOne* _touchListener;
|
||||
ax::EventListenerKeyboard* _keyboardListener;
|
||||
|
||||
TestEntry* m_entry;
|
||||
Test* m_test;
|
||||
|
@ -87,15 +87,15 @@ public:
|
|||
|
||||
private:
|
||||
b2World* world;
|
||||
axis::Texture2D* _spriteTexture;
|
||||
ax::Texture2D* _spriteTexture;
|
||||
|
||||
b2Vec2 pos;
|
||||
b2Vec2 oldPos;
|
||||
bool button[2];
|
||||
|
||||
// Debug stuff
|
||||
axis::DrawNode* debugDrawNode;
|
||||
axis::extension::PhysicsDebugNodeBox2D g_debugDraw;
|
||||
ax::DrawNode* debugDrawNode;
|
||||
ax::extension::PhysicsDebugNodeBox2D g_debugDraw;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -28,7 +28,7 @@ USING_NS_AX;
|
|||
USING_NS_AX_EXT;
|
||||
|
||||
#if defined(AX_PLATFORM_PC)
|
||||
extern axis::Label* labelDebugDraw;
|
||||
extern ax::Label* labelDebugDraw;
|
||||
#endif
|
||||
|
||||
void DestructionListener::SayGoodbye(b2Joint* joint)
|
||||
|
|
|
@ -115,8 +115,8 @@ public:
|
|||
void DrawAABB(b2AABB* aabb, const b2Color& color);
|
||||
void Flush();
|
||||
|
||||
axis::extension::PhysicsDebugNodeBox2D g_debugDraw;
|
||||
axis::DrawNode* debugDrawNode;
|
||||
ax::extension::PhysicsDebugNodeBox2D g_debugDraw;
|
||||
ax::DrawNode* debugDrawNode;
|
||||
std::string debugString = "";
|
||||
|
||||
b2World* m_world;
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
virtual void onExit() override;
|
||||
virtual std::string title() const override { return "Bug1159"; }
|
||||
|
||||
void callBack(axis::Ref* sender);
|
||||
void callBack(ax::Ref* sender);
|
||||
|
||||
CREATE_FUNC(Bug1159Layer);
|
||||
};
|
||||
|
|
|
@ -44,12 +44,12 @@ protected:
|
|||
virtual void onExit() override;
|
||||
|
||||
private:
|
||||
axis::Sprite* sprite1;
|
||||
axis::Sprite* sprite2;
|
||||
axis::Sprite* sprite3;
|
||||
axis::Sprite* sprite4;
|
||||
ax::Sprite* sprite1;
|
||||
ax::Sprite* sprite2;
|
||||
ax::Sprite* sprite3;
|
||||
ax::Sprite* sprite4;
|
||||
|
||||
axis::Director::Projection _projection = axis::Director::Projection::_3D;
|
||||
ax::Director::Projection _projection = ax::Director::Projection::_3D;
|
||||
};
|
||||
|
||||
#endif /* defined(__cocos2d_tests__Bug_12847__) */
|
||||
|
|
|
@ -92,18 +92,18 @@ void Bug14327Layer::update(float dt)
|
|||
}
|
||||
}
|
||||
|
||||
void Bug14327Layer::editBoxEditingDidBegin(axis::ui::EditBox* editBox)
|
||||
void Bug14327Layer::editBoxEditingDidBegin(ax::ui::EditBox* editBox)
|
||||
{
|
||||
log("editBox %p DidBegin !", editBox);
|
||||
}
|
||||
|
||||
void Bug14327Layer::editBoxEditingDidEndWithAction(axis::ui::EditBox* editBox,
|
||||
axis::ui::EditBoxDelegate::EditBoxEndAction EditBoxEndAction)
|
||||
void Bug14327Layer::editBoxEditingDidEndWithAction(ax::ui::EditBox* editBox,
|
||||
ax::ui::EditBoxDelegate::EditBoxEndAction EditBoxEndAction)
|
||||
{
|
||||
log("editBox %p DidEnd !", editBox);
|
||||
}
|
||||
|
||||
void Bug14327Layer::editBoxTextChanged(axis::ui::EditBox* editBox, std::string_view text)
|
||||
void Bug14327Layer::editBoxTextChanged(ax::ui::EditBox* editBox, std::string_view text)
|
||||
{
|
||||
log("editBox %p TextChanged, text: %s ", editBox, text.data());
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
# include "ui/UIEditBox/UIEditBox.h"
|
||||
|
||||
class Bug14327Layer : public BugsTestBase, public axis::ui::EditBoxDelegate
|
||||
class Bug14327Layer : public BugsTestBase, public ax::ui::EditBoxDelegate
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(Bug14327Layer);
|
||||
|
@ -39,20 +39,20 @@ public:
|
|||
virtual bool init() override;
|
||||
virtual std::string title() const override { return "Bug14327"; }
|
||||
|
||||
virtual void editBoxEditingDidBegin(axis::ui::EditBox* editBox) override;
|
||||
virtual void editBoxEditingDidBegin(ax::ui::EditBox* editBox) override;
|
||||
virtual void editBoxEditingDidEndWithAction(
|
||||
axis::ui::EditBox* editBox,
|
||||
axis::ui::EditBoxDelegate::EditBoxEndAction EditBoxEndAction) override;
|
||||
virtual void editBoxTextChanged(axis::ui::EditBox* editBox, std::string_view text) override;
|
||||
virtual void editBoxReturn(axis::ui::EditBox* editBox) override;
|
||||
ax::ui::EditBox* editBox,
|
||||
ax::ui::EditBoxDelegate::EditBoxEndAction EditBoxEndAction) override;
|
||||
virtual void editBoxTextChanged(ax::ui::EditBox* editBox, std::string_view text) override;
|
||||
virtual void editBoxReturn(ax::ui::EditBox* editBox) override;
|
||||
|
||||
protected:
|
||||
virtual void update(float dt) override;
|
||||
|
||||
private:
|
||||
time_t _removeTime;
|
||||
axis::Label* _TTFShowTime;
|
||||
axis::ui::EditBox* _edit;
|
||||
ax::Label* _TTFShowTime;
|
||||
ax::ui::EditBox* _edit;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -44,7 +44,7 @@ bool Bug15776Layer::init()
|
|||
{
|
||||
if (BugsTestBase::init())
|
||||
{
|
||||
axis::Image* cocos2dxImage = new axis::Image();
|
||||
ax::Image* cocos2dxImage = new ax::Image();
|
||||
cocos2dxImage->initWithImageData(nullptr, 0, false);
|
||||
// should not crash. invalid cocos2dImage
|
||||
auto texture2d = Director::getInstance()->getTextureCache()->addImage(cocos2dxImage, "unused");
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
|
||||
void reset();
|
||||
void check(Node* target);
|
||||
void menuCallback(axis::Ref* sender);
|
||||
void menuCallback(ax::Ref* sender);
|
||||
};
|
||||
|
||||
#endif // __BUG_422_H__
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
CREATE_FUNC(Bug458Layer);
|
||||
|
||||
virtual bool init() override;
|
||||
void selectAnswer(axis::Ref* sender);
|
||||
void selectAnswer(ax::Ref* sender);
|
||||
};
|
||||
|
||||
#endif // __BUG_458_H__
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "axmol.h"
|
||||
|
||||
class QuestionContainerSprite : public axis::Sprite
|
||||
class QuestionContainerSprite : public ax::Sprite
|
||||
{
|
||||
public:
|
||||
virtual bool init() override;
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
virtual ~Bug624Layer();
|
||||
virtual bool init() override;
|
||||
void switchLayer(float dt);
|
||||
virtual void onAcceleration(axis::Acceleration* acc, axis::Event* event);
|
||||
virtual void onAcceleration(ax::Acceleration* acc, ax::Event* event);
|
||||
virtual std::string title() const override { return "Bug624"; }
|
||||
|
||||
CREATE_FUNC(Bug624Layer);
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
virtual ~Bug624Layer2();
|
||||
virtual bool init() override;
|
||||
void switchLayer(float dt);
|
||||
virtual void onAcceleration(axis::Acceleration* acc, axis::Event* event);
|
||||
virtual void onAcceleration(ax::Acceleration* acc, ax::Event* event);
|
||||
virtual std::string title() const override { return "Bug624-2"; }
|
||||
|
||||
CREATE_FUNC(Bug624Layer2);
|
||||
|
|
|
@ -33,9 +33,9 @@ public:
|
|||
virtual bool init() override;
|
||||
virtual std::string title() const override { return "Bug914"; }
|
||||
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void restart(axis::Ref* sender);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void restart(ax::Ref* sender);
|
||||
|
||||
CREATE_FUNC(Bug914Layer);
|
||||
};
|
||||
|
|
|
@ -43,15 +43,15 @@ public:
|
|||
virtual bool init() override;
|
||||
virtual std::string title() const override { return "BugChild"; }
|
||||
|
||||
void switchChild(axis::Ref* sender);
|
||||
void switchChild(ax::Ref* sender);
|
||||
|
||||
protected:
|
||||
axis::Sprite* parent1;
|
||||
axis::Sprite* parent2;
|
||||
ax::Sprite* parent1;
|
||||
ax::Sprite* parent2;
|
||||
|
||||
axis::Sprite* child;
|
||||
ax::Sprite* child;
|
||||
|
||||
axis::Menu* menu;
|
||||
ax::Menu* menu;
|
||||
};
|
||||
|
||||
class BugCameraMask : public BugsTestBase
|
||||
|
@ -62,10 +62,10 @@ public:
|
|||
virtual bool init() override;
|
||||
virtual std::string title() const override { return "BugCameraMask"; }
|
||||
|
||||
void switchSpriteFlag(axis::Ref* sender);
|
||||
void switchSpriteFlag(ax::Ref* sender);
|
||||
void updateSpriteMaskLabel();
|
||||
Node* _sprite;
|
||||
axis::Label* _spriteMaskLabel;
|
||||
ax::Label* _spriteMaskLabel;
|
||||
};
|
||||
|
||||
#endif /* defined(__Bug_Child__) */
|
||||
|
|
|
@ -409,8 +409,8 @@ void Camera3DTestDemo::addNewSpriteWithCoords(Vec3 p,
|
|||
}
|
||||
mesh->setScale(scale);
|
||||
}
|
||||
void Camera3DTestDemo::onTouchesBegan(const std::vector<Touch*>& touches, axis::Event* event) {}
|
||||
void Camera3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void Camera3DTestDemo::onTouchesBegan(const std::vector<Touch*>& touches, ax::Event* event) {}
|
||||
void Camera3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (touches.size() == 1)
|
||||
{
|
||||
|
@ -489,7 +489,7 @@ void Camera3DTestDemo::updateState(float elapsedTime)
|
|||
}
|
||||
}
|
||||
}
|
||||
void Camera3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void Camera3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
for (auto& item : touches)
|
||||
{
|
||||
|
@ -528,7 +528,7 @@ void Camera3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, axis::
|
|||
}
|
||||
}
|
||||
}
|
||||
void onTouchesCancelled(const std::vector<Touch*>& touches, axis::Event* event) {}
|
||||
void onTouchesCancelled(const std::vector<Touch*>& touches, ax::Event* event) {}
|
||||
void Camera3DTestDemo::updateCamera(float fDelta)
|
||||
{
|
||||
if (_mesh)
|
||||
|
@ -1118,7 +1118,7 @@ void CameraArcBallDemo::onTouchsMoved(const std::vector<Touch*>& touchs, Event*
|
|||
}
|
||||
}
|
||||
|
||||
void CameraArcBallDemo::calculateArcBall(axis::Vec3& axis, float& angle, float p1x, float p1y, float p2x, float p2y)
|
||||
void CameraArcBallDemo::calculateArcBall(ax::Vec3& axis, float& angle, float p1x, float p1y, float p2x, float p2y)
|
||||
{
|
||||
Mat4 rotation_matrix;
|
||||
Mat4::createRotation(_rotationQuat, &rotation_matrix);
|
||||
|
@ -1379,7 +1379,7 @@ void FogTestDemo::onExit()
|
|||
|
||||
void FogTestDemo::update(float dt) {}
|
||||
|
||||
void FogTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void FogTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (touches.size() == 1)
|
||||
{
|
||||
|
|
|
@ -68,10 +68,10 @@ class CameraBaseTest : public TestCase
|
|||
{
|
||||
public:
|
||||
protected:
|
||||
axis::BillBoard* bill1;
|
||||
axis::BillBoard* bill2;
|
||||
axis::Label* l1;
|
||||
axis::Label* l2;
|
||||
ax::BillBoard* bill1;
|
||||
ax::BillBoard* bill2;
|
||||
ax::Label* l1;
|
||||
ax::Label* l2;
|
||||
};
|
||||
|
||||
class CameraRotationTest : public CameraBaseTest
|
||||
|
@ -92,9 +92,9 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
protected:
|
||||
axis::Node* _camControlNode;
|
||||
axis::Node* _camNode;
|
||||
axis::EventListenerTouchOneByOne* _lis;
|
||||
ax::Node* _camControlNode;
|
||||
ax::Node* _camNode;
|
||||
ax::EventListenerTouchOneByOne* _lis;
|
||||
};
|
||||
|
||||
class Camera3DTestDemo : public CameraBaseTest
|
||||
|
@ -108,55 +108,55 @@ public:
|
|||
virtual void onExit() override;
|
||||
// overrides
|
||||
virtual std::string title() const override;
|
||||
void addNewSpriteWithCoords(axis::Vec3 p,
|
||||
void addNewSpriteWithCoords(ax::Vec3 p,
|
||||
std::string fileName,
|
||||
bool playAnimation = false,
|
||||
float scale = 1.0f,
|
||||
bool bindCamera = false);
|
||||
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
void scaleCameraCallback(axis::Ref* sender, float value);
|
||||
void rotateCameraCallback(axis::Ref* sender, float value);
|
||||
void SwitchViewCallback(axis::Ref* sender, CameraType cameraType);
|
||||
void scaleCameraCallback(ax::Ref* sender, float value);
|
||||
void rotateCameraCallback(ax::Ref* sender, float value);
|
||||
void SwitchViewCallback(ax::Ref* sender, CameraType cameraType);
|
||||
void updateCamera(float fDelta);
|
||||
void move3D(float elapsedTime);
|
||||
void updateState(float elapsedTime);
|
||||
bool isState(unsigned int state, unsigned int bit) const;
|
||||
void reachEndCallBack();
|
||||
|
||||
bool onTouchesCommon(axis::Touch* touch, axis::Event* event, bool* touchProperty);
|
||||
bool onTouchesZoomOut(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchesZoomOutEnd(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchesZoomIn(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchesZoomInEnd(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchesCommon(ax::Touch* touch, ax::Event* event, bool* touchProperty);
|
||||
bool onTouchesZoomOut(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchesZoomOutEnd(ax::Touch* touch, ax::Event* event);
|
||||
bool onTouchesZoomIn(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchesZoomInEnd(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
bool onTouchesRotateLeft(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchesRotateLeftEnd(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchesRotateRight(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchesRotateRightEnd(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchesRotateLeft(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchesRotateLeftEnd(ax::Touch* touch, ax::Event* event);
|
||||
bool onTouchesRotateRight(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchesRotateRightEnd(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
protected:
|
||||
std::string _title;
|
||||
axis::Layer* _layer3D;
|
||||
axis::MeshRenderer* _mesh;
|
||||
axis::Vec3 _targetPos;
|
||||
ax::Layer* _layer3D;
|
||||
ax::MeshRenderer* _mesh;
|
||||
ax::Vec3 _targetPos;
|
||||
CameraType _cameraType;
|
||||
axis::MenuItem* _incRot;
|
||||
axis::MenuItem* _decRot;
|
||||
ax::MenuItem* _incRot;
|
||||
ax::MenuItem* _decRot;
|
||||
unsigned int _curState;
|
||||
axis::Camera* _camera;
|
||||
axis::MoveTo* _moveAction;
|
||||
ax::Camera* _camera;
|
||||
ax::MoveTo* _moveAction;
|
||||
bool _bZoomOut;
|
||||
bool _bZoomIn;
|
||||
bool _bRotateLeft;
|
||||
bool _bRotateRight;
|
||||
axis::Label* _RotateRightlabel;
|
||||
axis::Label* _RotateLeftlabel;
|
||||
axis::Label* _ZoomInlabel;
|
||||
axis::Label* _ZoomOutlabel;
|
||||
ax::Label* _RotateRightlabel;
|
||||
ax::Label* _RotateLeftlabel;
|
||||
ax::Label* _ZoomInlabel;
|
||||
ax::Label* _ZoomOutlabel;
|
||||
};
|
||||
|
||||
class CameraCullingDemo : public CameraBaseTest
|
||||
|
@ -174,22 +174,22 @@ public:
|
|||
// overrides
|
||||
virtual std::string title() const override;
|
||||
void reachEndCallBack();
|
||||
void switchViewCallback(axis::Ref* sender);
|
||||
void addMeshCallback(axis::Ref* sender);
|
||||
void delMeshCallback(axis::Ref* sender);
|
||||
void switchViewCallback(ax::Ref* sender);
|
||||
void addMeshCallback(ax::Ref* sender);
|
||||
void delMeshCallback(ax::Ref* sender);
|
||||
|
||||
void drawCameraFrustum();
|
||||
|
||||
protected:
|
||||
axis::Label* _labelMeshCount;
|
||||
axis::Layer* _layer3D;
|
||||
std::vector<axis::MeshRenderer*> _objects;
|
||||
ax::Label* _labelMeshCount;
|
||||
ax::Layer* _layer3D;
|
||||
std::vector<ax::MeshRenderer*> _objects;
|
||||
CameraType _cameraType;
|
||||
axis::Camera* _cameraFirst;
|
||||
axis::Camera* _cameraThird;
|
||||
axis::MoveBy* _moveAction;
|
||||
axis::DrawNode3D* _drawAABB;
|
||||
axis::DrawNode3D* _drawFrustum;
|
||||
ax::Camera* _cameraFirst;
|
||||
ax::Camera* _cameraThird;
|
||||
ax::MoveBy* _moveAction;
|
||||
ax::DrawNode3D* _drawAABB;
|
||||
ax::DrawNode3D* _drawFrustum;
|
||||
int _row;
|
||||
};
|
||||
|
||||
|
@ -208,11 +208,11 @@ public:
|
|||
// overrides
|
||||
virtual std::string title() const override;
|
||||
|
||||
void switchOperateCallback(axis::Ref* sender);
|
||||
void switchTargetCallback(axis::Ref* sender);
|
||||
void onTouchsMoved(const std::vector<axis::Touch*>& touchs, axis::Event* event);
|
||||
void switchOperateCallback(ax::Ref* sender);
|
||||
void switchTargetCallback(ax::Ref* sender);
|
||||
void onTouchsMoved(const std::vector<ax::Touch*>& touchs, ax::Event* event);
|
||||
void updateCameraTransform();
|
||||
void calculateArcBall(axis::Vec3& axis,
|
||||
void calculateArcBall(ax::Vec3& axis,
|
||||
float& angle,
|
||||
float p1x,
|
||||
float p1y,
|
||||
|
@ -221,18 +221,18 @@ public:
|
|||
float projectToSphere(float r, float x, float y); // points on the screen project to arc ball
|
||||
|
||||
protected:
|
||||
axis::Layer* _layer3D;
|
||||
ax::Layer* _layer3D;
|
||||
CameraType _cameraType;
|
||||
axis::Camera* _camera;
|
||||
axis::DrawNode3D* _drawGrid;
|
||||
axis::Quaternion _rotationQuat; // rotation Quaternion
|
||||
ax::Camera* _camera;
|
||||
ax::DrawNode3D* _drawGrid;
|
||||
ax::Quaternion _rotationQuat; // rotation Quaternion
|
||||
float _radius; // arc ball radius
|
||||
float _distanceZ;
|
||||
OperateCamType _operate; // switch rotate or zoom
|
||||
axis::Vec3 _center; // camera look target
|
||||
ax::Vec3 _center; // camera look target
|
||||
int _target; // switch camera look target
|
||||
axis::MeshRenderer* _mesh1;
|
||||
axis::MeshRenderer* _mesh2;
|
||||
ax::MeshRenderer* _mesh1;
|
||||
ax::MeshRenderer* _mesh2;
|
||||
};
|
||||
|
||||
class FogTestDemo : public CameraBaseTest
|
||||
|
@ -250,21 +250,21 @@ public:
|
|||
// overrides
|
||||
virtual std::string title() const override;
|
||||
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
void switchTypeCallback(axis::Ref* sender, int type);
|
||||
void switchTypeCallback(ax::Ref* sender, int type);
|
||||
|
||||
protected:
|
||||
CameraType _cameraType = CameraType::Free;
|
||||
axis::Layer* _layer3D = nullptr;
|
||||
axis::Camera* _camera = nullptr;
|
||||
axis::MeshRenderer* _mesh1 = nullptr;
|
||||
axis::MeshRenderer* _mesh2 = nullptr;
|
||||
axis::backend::ProgramState* _programState1 = nullptr;
|
||||
axis::backend::ProgramState* _programState2 = nullptr;
|
||||
ax::Layer* _layer3D = nullptr;
|
||||
ax::Camera* _camera = nullptr;
|
||||
ax::MeshRenderer* _mesh1 = nullptr;
|
||||
ax::MeshRenderer* _mesh2 = nullptr;
|
||||
ax::backend::ProgramState* _programState1 = nullptr;
|
||||
ax::backend::ProgramState* _programState2 = nullptr;
|
||||
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
||||
axis::EventListenerCustom* _backToForegroundListener;
|
||||
ax::EventListenerCustom* _backToForegroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ ChipmunkTest::ChipmunkTest()
|
|||
#endif
|
||||
addChild(parent, 0, kTagParentNode);
|
||||
|
||||
addNewSpriteAtPosition(axis::Vec2(200.0f, 200.0f));
|
||||
addNewSpriteAtPosition(ax::Vec2(200.0f, 200.0f));
|
||||
|
||||
// menu for debug layer
|
||||
MenuItemFont::setFontSize(18);
|
||||
|
@ -202,7 +202,7 @@ void ChipmunkTest::reset(Ref* sender)
|
|||
getTestSuite()->restartCurrTest();
|
||||
}
|
||||
|
||||
void ChipmunkTest::addNewSpriteAtPosition(axis::Vec2 pos)
|
||||
void ChipmunkTest::addNewSpriteAtPosition(ax::Vec2 pos)
|
||||
{
|
||||
int posx, posy;
|
||||
|
||||
|
@ -232,7 +232,7 @@ void ChipmunkTest::addNewSpriteAtPosition(axis::Vec2 pos)
|
|||
cpShapeSetFriction(shape, 0.5f);
|
||||
cpSpaceAddShape(_space, shape);
|
||||
|
||||
auto sprite = PhysicsSpriteChipmunk2D::createWithTexture(_spriteTexture, axis::Rect(posx, posy, 85, 121));
|
||||
auto sprite = PhysicsSpriteChipmunk2D::createWithTexture(_spriteTexture, ax::Rect(posx, posy, 85, 121));
|
||||
parent->addChild(sprite);
|
||||
|
||||
sprite->setCPBody(body);
|
||||
|
@ -268,7 +268,7 @@ void ChipmunkTest::onAcceleration(Acceleration* acc, Event* event)
|
|||
prevX = accelX;
|
||||
prevY = accelY;
|
||||
|
||||
auto v = axis::Vec2(accelX, accelY);
|
||||
auto v = ax::Vec2(accelX, accelY);
|
||||
v = v * 200;
|
||||
cpSpaceSetGravity(_space, cpv(v.x, v.y));
|
||||
}
|
||||
|
|
|
@ -44,17 +44,17 @@ public:
|
|||
void onEnter() override;
|
||||
void initPhysics();
|
||||
void createResetButton();
|
||||
void reset(axis::Ref* sender);
|
||||
void reset(ax::Ref* sender);
|
||||
|
||||
void addNewSpriteAtPosition(axis::Vec2 p);
|
||||
void addNewSpriteAtPosition(ax::Vec2 p);
|
||||
void update(float dt) override;
|
||||
void toggleDebugCallback(axis::Ref* sender);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
virtual void onAcceleration(axis::Acceleration* acc, axis::Event* event);
|
||||
void toggleDebugCallback(ax::Ref* sender);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual void onAcceleration(ax::Acceleration* acc, ax::Event* event);
|
||||
|
||||
private:
|
||||
axis::Texture2D* _spriteTexture; // weak ref
|
||||
axis::extension::PhysicsDebugNodeChipmunk2D* _debugLayer; // weak ref
|
||||
ax::Texture2D* _spriteTexture; // weak ref
|
||||
ax::extension::PhysicsDebugNodeChipmunk2D* _debugLayer; // weak ref
|
||||
|
||||
cpSpace* _space; // strong ref
|
||||
cpShape* _walls[4];
|
||||
|
|
|
@ -100,7 +100,7 @@ char const* ChipmunkDemoMessageString = NULL;
|
|||
cpShapeFilter GRAB_FILTER = {CP_NO_GROUP, (unsigned int)GRABBABLE_MASK_BIT, (unsigned int)GRABBABLE_MASK_BIT};
|
||||
cpShapeFilter NOT_GRABBABLE_FILTER = {CP_NO_GROUP, ~GRABBABLE_MASK_BIT, ~GRABBABLE_MASK_BIT};
|
||||
|
||||
axis::DrawNode* drawCP = NULL;
|
||||
ax::DrawNode* drawCP = NULL;
|
||||
|
||||
void ChipmunkDemoDefaultDrawImpl(cpSpace* space){};
|
||||
|
||||
|
@ -168,7 +168,7 @@ void ChipmunkDebugDrawBB(cpBB bb, cpSpaceDebugColor color)
|
|||
Color4F(0.0f, 0.0f, 1.0f, 1.0f));
|
||||
}
|
||||
|
||||
axis::Label* label;
|
||||
ax::Label* label;
|
||||
|
||||
static int max_arbiters = 0;
|
||||
static int max_points = 0;
|
||||
|
@ -305,7 +305,7 @@ void updateMouseBody(void)
|
|||
|
||||
ChipmunkTestBed::ChipmunkTestBed()
|
||||
{
|
||||
// halx99: since axis init scene default camera at 'initWithXXX' function, only change design size at scene
|
||||
// halx99: since axmol init scene default camera at 'initWithXXX' function, only change design size at scene
|
||||
// construct is ok see also: https://github.com/axmolengine/axmol/commit/581a7921554c09746616759d5a5ca6ce9d3eaa22
|
||||
auto director = Director::getInstance();
|
||||
auto glView = director->getOpenGLView();
|
||||
|
|
|
@ -43,27 +43,27 @@ public:
|
|||
|
||||
void onEnter() override;
|
||||
void createResetButton();
|
||||
void reset(axis::Ref* sender);
|
||||
void reset(ax::Ref* sender);
|
||||
|
||||
void update(float dt) override;
|
||||
virtual void initPhysics();
|
||||
|
||||
void onMouseDown(axis::Event* event);
|
||||
void onMouseUp(axis::Event* event);
|
||||
void onMouseMove(axis::Event* event);
|
||||
void onMouseDown(ax::Event* event);
|
||||
void onMouseUp(ax::Event* event);
|
||||
void onMouseMove(ax::Event* event);
|
||||
void DrawInfo();
|
||||
void updateInit(ChipmunkDemo tt);
|
||||
|
||||
cpSpace* _space; // strong ref
|
||||
axis::extension::PhysicsDebugNodeChipmunk2D* _debugLayer; // weak ref
|
||||
ax::extension::PhysicsDebugNodeChipmunk2D* _debugLayer; // weak ref
|
||||
int keyPresses;
|
||||
bool mousePresses = false;
|
||||
|
||||
private:
|
||||
axis::EventListenerMouse* _mouseListener;
|
||||
axis::Node* _trackNode;
|
||||
axis::DrawNode* draw;
|
||||
axis::Label* drawInfo;
|
||||
ax::EventListenerMouse* _mouseListener;
|
||||
ax::Node* _trackNode;
|
||||
ax::DrawNode* draw;
|
||||
ax::Label* drawInfo;
|
||||
};
|
||||
|
||||
class LogoSmashDemo : public ChipmunkTestBed
|
||||
|
|
|
@ -35,8 +35,8 @@ public:
|
|||
CREATE_FUNC(ClickAndMoveTestCase);
|
||||
|
||||
ClickAndMoveTestCase();
|
||||
bool onTouchBegan(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchEnded(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchBegan(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchEnded(ax::Touch* touch, ax::Event* event);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -57,15 +57,15 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
virtual void setup() override;
|
||||
|
||||
virtual axis::Action* actionRotate();
|
||||
virtual axis::Action* actionScale();
|
||||
virtual ax::Action* actionRotate();
|
||||
virtual ax::Action* actionScale();
|
||||
|
||||
virtual axis::DrawNode* shape();
|
||||
virtual axis::Sprite* grossini();
|
||||
virtual ax::DrawNode* shape();
|
||||
virtual ax::Sprite* grossini();
|
||||
|
||||
virtual axis::Node* stencil();
|
||||
virtual axis::ClippingNode* clipper();
|
||||
virtual axis::Node* content();
|
||||
virtual ax::Node* stencil();
|
||||
virtual ax::ClippingNode* clipper();
|
||||
virtual ax::Node* content();
|
||||
};
|
||||
|
||||
class ShapeTest : public BasicTest
|
||||
|
@ -76,8 +76,8 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
virtual axis::Node* stencil() override;
|
||||
virtual axis::Node* content() override;
|
||||
virtual ax::Node* stencil() override;
|
||||
virtual ax::Node* content() override;
|
||||
};
|
||||
|
||||
class ShapeInvertedTest : public ShapeTest
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual axis::ClippingNode* clipper() override;
|
||||
virtual ax::ClippingNode* clipper() override;
|
||||
};
|
||||
|
||||
class SpriteTest : public BasicTest
|
||||
|
@ -98,9 +98,9 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
virtual axis::Node* stencil() override;
|
||||
virtual axis::ClippingNode* clipper() override;
|
||||
virtual axis::Node* content() override;
|
||||
virtual ax::Node* stencil() override;
|
||||
virtual ax::ClippingNode* clipper() override;
|
||||
virtual ax::Node* content() override;
|
||||
};
|
||||
|
||||
class SpriteNoAlphaTest : public SpriteTest
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual axis::ClippingNode* clipper() override;
|
||||
virtual ax::ClippingNode* clipper() override;
|
||||
};
|
||||
|
||||
class SpriteInvertedTest : public SpriteTest
|
||||
|
@ -120,7 +120,7 @@ public:
|
|||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual axis::ClippingNode* clipper() override;
|
||||
virtual ax::ClippingNode* clipper() override;
|
||||
};
|
||||
|
||||
class NestedTest : public BaseClippingNodeTest
|
||||
|
@ -142,13 +142,13 @@ public:
|
|||
virtual void setup() override;
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void pokeHoleAtPoint(axis::Vec2 point);
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void pokeHoleAtPoint(ax::Vec2 point);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
private:
|
||||
axis::ClippingNode* _outerClipper;
|
||||
axis::Node* _holes;
|
||||
axis::Node* _holesStencil;
|
||||
ax::ClippingNode* _outerClipper;
|
||||
ax::Node* _holes;
|
||||
ax::Node* _holesStencil;
|
||||
};
|
||||
|
||||
class ScrollViewDemo : public BaseClippingNodeTest
|
||||
|
@ -159,13 +159,13 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void setup() override;
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
private:
|
||||
bool _scrolling;
|
||||
axis::Vec2 _lastPoint;
|
||||
ax::Vec2 _lastPoint;
|
||||
};
|
||||
|
||||
//#if _AX_DEBUG > 1
|
||||
|
@ -180,7 +180,7 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void setup() override;
|
||||
virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override;
|
||||
virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override;
|
||||
|
||||
virtual void setupStencilForClippingOnPlane(int plane);
|
||||
virtual void setupStencilForDrawingOnPlane(int plane);
|
||||
|
@ -190,13 +190,13 @@ protected:
|
|||
void onBeforeDrawSprite(int planeIndex);
|
||||
void initCommands();
|
||||
|
||||
std::vector<axis::CustomCommand> _renderCmds;
|
||||
// axis::CallbackCommand _enableStencilCallback;
|
||||
// axis::CallbackCommand _disableStencilCallback;
|
||||
axis::Vector<axis::Sprite*> _sprites;
|
||||
axis::Vector<axis::Sprite*> _spritesStencil;
|
||||
axis::backend::UniformLocation _locColor;
|
||||
axis::backend::UniformLocation _locMVPMatrix;
|
||||
std::vector<ax::CustomCommand> _renderCmds;
|
||||
// ax::CallbackCommand _enableStencilCallback;
|
||||
// ax::CallbackCommand _disableStencilCallback;
|
||||
ax::Vector<ax::Sprite*> _sprites;
|
||||
ax::Vector<ax::Sprite*> _spritesStencil;
|
||||
ax::backend::UniformLocation _locColor;
|
||||
ax::backend::UniformLocation _locMVPMatrix;
|
||||
};
|
||||
|
||||
class RawStencilBufferTest2 : public RawStencilBufferTest
|
||||
|
@ -235,7 +235,7 @@ public:
|
|||
virtual void setupStencilForDrawingOnPlane(int plane) override;
|
||||
|
||||
private:
|
||||
axis::backend::UniformLocation _alphaMVPMatrix;
|
||||
ax::backend::UniformLocation _alphaMVPMatrix;
|
||||
};
|
||||
|
||||
class RawStencilBufferTest5 : public RawStencilBufferTestAlphaTest
|
||||
|
|
|
@ -70,7 +70,7 @@ void ConfigurationQuery::onEnter()
|
|||
{
|
||||
ConfigurationBase::onEnter();
|
||||
|
||||
log("cocos2d version: %s", Configuration::getInstance()->getValue("axis.version").asString().c_str());
|
||||
log("cocos2d version: %s", Configuration::getInstance()->getValue("axmol.version").asString().c_str());
|
||||
log("OpenGL version: %s", Configuration::getInstance()->getValue("gl.version").asString().c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ protected:
|
|||
ConsoleCustomCommand();
|
||||
virtual ~ConsoleCustomCommand();
|
||||
|
||||
axis::Console* _console;
|
||||
ax::Console* _console;
|
||||
|
||||
private:
|
||||
AX_DISALLOW_COPY_AND_ASSIGN(ConsoleCustomCommand);
|
||||
|
|
|
@ -38,10 +38,10 @@ public:
|
|||
CurlTest();
|
||||
~CurlTest();
|
||||
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
private:
|
||||
axis::Label* _label;
|
||||
ax::Label* _label;
|
||||
};
|
||||
|
||||
#endif // _CURL_TEST_H_
|
||||
|
|
|
@ -33,13 +33,13 @@ DEFINE_TEST_SUITE(EffectAdvanceTests);
|
|||
class EffectAdvanceBaseTest : public TestCase
|
||||
{
|
||||
protected:
|
||||
axis::TextureAtlas* _atlas;
|
||||
ax::TextureAtlas* _atlas;
|
||||
|
||||
std::string _title;
|
||||
|
||||
axis::Node* _bgNode;
|
||||
axis::Node* _target1;
|
||||
axis::Node* _target2;
|
||||
ax::Node* _bgNode;
|
||||
ax::Node* _target1;
|
||||
ax::Node* _target2;
|
||||
|
||||
public:
|
||||
virtual void onEnter() override;
|
||||
|
|
|
@ -60,7 +60,7 @@ Shaky3DDemo::Shaky3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* Shaky3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* Shaky3DDemo::createEffect(float t)
|
||||
{
|
||||
return Shaky3D::create(t, Size(15, 10), 5, false);
|
||||
}
|
||||
|
@ -71,12 +71,12 @@ Waves3DDemo::Waves3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* Waves3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* Waves3DDemo::createEffect(float t)
|
||||
{
|
||||
return Waves3D::create(t, Size(15, 10), 5, 40);
|
||||
}
|
||||
|
||||
axis::ActionInterval* FlipX3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* FlipX3DDemo::createEffect(float t)
|
||||
{
|
||||
auto flipx = FlipX3D::create(t);
|
||||
auto flipx_back = flipx->reverse();
|
||||
|
@ -90,7 +90,7 @@ FlipX3DDemo::FlipX3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* FlipY3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* FlipY3DDemo::createEffect(float t)
|
||||
{
|
||||
auto flipy = FlipY3D::create(t);
|
||||
auto flipy_back = flipy->reverse();
|
||||
|
@ -105,7 +105,7 @@ FlipY3DDemo::FlipY3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* Lens3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* Lens3DDemo::createEffect(float t)
|
||||
{
|
||||
auto size = Director::getInstance()->getWinSize();
|
||||
return Lens3D::create(t, Size(15, 10), Vec2(size.width / 2, size.height / 2), 240);
|
||||
|
@ -117,7 +117,7 @@ Lens3DDemo::Lens3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* Ripple3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* Ripple3DDemo::createEffect(float t)
|
||||
{
|
||||
auto size = Director::getInstance()->getWinSize();
|
||||
return Ripple3D::create(t, Size(32, 24), Vec2(size.width / 2, size.height / 2), 240, 4, 160);
|
||||
|
@ -129,7 +129,7 @@ Ripple3DDemo::Ripple3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* LiquidDemo::createEffect(float t)
|
||||
ax::ActionInterval* LiquidDemo::createEffect(float t)
|
||||
{
|
||||
return Liquid::create(t, Size(16, 12), 4, 20);
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ LiquidDemo::LiquidDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* WavesDemo::createEffect(float t)
|
||||
ax::ActionInterval* WavesDemo::createEffect(float t)
|
||||
{
|
||||
return Waves::create(t, Size(16, 12), 4, 20, true, true);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ WavesDemo::WavesDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* TwirlDemo::createEffect(float t)
|
||||
ax::ActionInterval* TwirlDemo::createEffect(float t)
|
||||
{
|
||||
auto size = Director::getInstance()->getWinSize();
|
||||
return Twirl::create(t, Size(12, 8), Vec2(size.width / 2, size.height / 2), 1, 2.5f);
|
||||
|
@ -163,7 +163,7 @@ TwirlDemo::TwirlDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* ShakyTiles3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* ShakyTiles3DDemo::createEffect(float t)
|
||||
{
|
||||
return ShakyTiles3D::create(t, Size(16, 12), 5, false);
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ ShakyTiles3DDemo::ShakyTiles3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* ShatteredTiles3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* ShatteredTiles3DDemo::createEffect(float t)
|
||||
{
|
||||
return ShatteredTiles3D::create(t, Size(16, 12), 5, false);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ ShatteredTiles3DDemo::ShatteredTiles3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* ShuffleTilesDemo::createEffect(float t)
|
||||
ax::ActionInterval* ShuffleTilesDemo::createEffect(float t)
|
||||
{
|
||||
auto shuffle = ShuffleTiles::create(t, Size(16, 12), 25);
|
||||
auto shuffle_back = shuffle->reverse();
|
||||
|
@ -200,7 +200,7 @@ ShuffleTilesDemo::ShuffleTilesDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* FadeOutTRTilesDemo::createEffect(float t)
|
||||
ax::ActionInterval* FadeOutTRTilesDemo::createEffect(float t)
|
||||
{
|
||||
auto fadeout = FadeOutTRTiles::create(t, Size(16, 12));
|
||||
auto back = fadeout->reverse();
|
||||
|
@ -215,7 +215,7 @@ FadeOutTRTilesDemo::FadeOutTRTilesDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* FadeOutBLTilesDemo::createEffect(float t)
|
||||
ax::ActionInterval* FadeOutBLTilesDemo::createEffect(float t)
|
||||
{
|
||||
auto fadeout = FadeOutBLTiles::create(t, Size(16, 12));
|
||||
auto back = fadeout->reverse();
|
||||
|
@ -230,7 +230,7 @@ FadeOutBLTilesDemo::FadeOutBLTilesDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* FadeOutUpTilesDemo::createEffect(float t)
|
||||
ax::ActionInterval* FadeOutUpTilesDemo::createEffect(float t)
|
||||
{
|
||||
auto fadeout = FadeOutUpTiles::create(t, Size(16, 12));
|
||||
auto back = fadeout->reverse();
|
||||
|
@ -245,7 +245,7 @@ FadeOutUpTilesDemo::FadeOutUpTilesDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* FadeOutDownTilesDemo::createEffect(float t)
|
||||
ax::ActionInterval* FadeOutDownTilesDemo::createEffect(float t)
|
||||
{
|
||||
auto fadeout = FadeOutDownTiles::create(t, Size(16, 12));
|
||||
auto back = fadeout->reverse();
|
||||
|
@ -260,7 +260,7 @@ FadeOutDownTilesDemo::FadeOutDownTilesDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* TurnOffTilesDemo::createEffect(float t)
|
||||
ax::ActionInterval* TurnOffTilesDemo::createEffect(float t)
|
||||
{
|
||||
auto fadeout = TurnOffTiles::create(t, Size(48, 32), 25);
|
||||
auto back = fadeout->reverse();
|
||||
|
@ -275,7 +275,7 @@ TurnOffTilesDemo::TurnOffTilesDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* WavesTiles3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* WavesTiles3DDemo::createEffect(float t)
|
||||
{
|
||||
return WavesTiles3D::create(t, Size(15, 10), 4, 120);
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ WavesTiles3DDemo::WavesTiles3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* JumpTiles3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* JumpTiles3DDemo::createEffect(float t)
|
||||
{
|
||||
return JumpTiles3D::create(t, Size(15, 10), 2, 30);
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ JumpTiles3DDemo::JumpTiles3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* SplitRowsDemo::createEffect(float t)
|
||||
ax::ActionInterval* SplitRowsDemo::createEffect(float t)
|
||||
{
|
||||
return SplitRows::create(t, 9);
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ SplitRowsDemo::SplitRowsDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* SplitColsDemo::createEffect(float t)
|
||||
ax::ActionInterval* SplitColsDemo::createEffect(float t)
|
||||
{
|
||||
return SplitCols::create(t, 9);
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ SplitColsDemo::SplitColsDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* PageTurn3DDemo::createEffect(float t)
|
||||
ax::ActionInterval* PageTurn3DDemo::createEffect(float t)
|
||||
{
|
||||
return PageTurn3D::create(t, Size(15, 10));
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ PageTurn3DDemo::PageTurn3DDemo()
|
|||
_subtitle = "";
|
||||
}
|
||||
|
||||
axis::ActionInterval* PageTurn3DRectDemo::createEffect(float t)
|
||||
ax::ActionInterval* PageTurn3DRectDemo::createEffect(float t)
|
||||
{
|
||||
return PageTurn3D::create(t, Size(15, 10));
|
||||
}
|
||||
|
|
|
@ -37,14 +37,14 @@ public:
|
|||
|
||||
protected:
|
||||
virtual bool init() override;
|
||||
virtual axis::ActionInterval* createEffect(float t) { return nullptr; }
|
||||
virtual ax::ActionInterval* createEffect(float t) { return nullptr; }
|
||||
void checkAnim(float dt);
|
||||
virtual bool isRectEffect() { return false; }
|
||||
virtual std::string title() const override { return _title; };
|
||||
virtual std::string subtitle() const override { return _subtitle; };
|
||||
std::string _title;
|
||||
std::string _subtitle;
|
||||
axis::NodeGrid* _gridNodeTarget;
|
||||
ax::NodeGrid* _gridNodeTarget;
|
||||
};
|
||||
|
||||
class Shaky3DDemo : public EffectBaseTest
|
||||
|
@ -54,7 +54,7 @@ public:
|
|||
Shaky3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class Waves3DDemo : public EffectBaseTest
|
||||
|
@ -64,7 +64,7 @@ public:
|
|||
Waves3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class FlipX3DDemo : public EffectBaseTest
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
FlipX3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class FlipY3DDemo : public EffectBaseTest
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
FlipY3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class Lens3DDemo : public EffectBaseTest
|
||||
|
@ -94,7 +94,7 @@ public:
|
|||
Lens3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class Ripple3DDemo : public EffectBaseTest
|
||||
|
@ -104,7 +104,7 @@ public:
|
|||
Ripple3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class LiquidDemo : public EffectBaseTest
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
LiquidDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class WavesDemo : public EffectBaseTest
|
||||
|
@ -124,7 +124,7 @@ public:
|
|||
WavesDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class TwirlDemo : public EffectBaseTest
|
||||
|
@ -134,7 +134,7 @@ public:
|
|||
TwirlDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class ShakyTiles3DDemo : public EffectBaseTest
|
||||
|
@ -144,7 +144,7 @@ public:
|
|||
ShakyTiles3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class ShatteredTiles3DDemo : public EffectBaseTest
|
||||
|
@ -154,7 +154,7 @@ public:
|
|||
ShatteredTiles3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class ShuffleTilesDemo : public EffectBaseTest
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
ShuffleTilesDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class FadeOutTRTilesDemo : public EffectBaseTest
|
||||
|
@ -174,7 +174,7 @@ public:
|
|||
FadeOutTRTilesDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class FadeOutBLTilesDemo : public EffectBaseTest
|
||||
|
@ -184,7 +184,7 @@ public:
|
|||
FadeOutBLTilesDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class FadeOutUpTilesDemo : public EffectBaseTest
|
||||
|
@ -194,7 +194,7 @@ public:
|
|||
FadeOutUpTilesDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class FadeOutDownTilesDemo : public EffectBaseTest
|
||||
|
@ -204,7 +204,7 @@ public:
|
|||
FadeOutDownTilesDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class TurnOffTilesDemo : public EffectBaseTest
|
||||
|
@ -214,7 +214,7 @@ public:
|
|||
TurnOffTilesDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class WavesTiles3DDemo : public EffectBaseTest
|
||||
|
@ -224,7 +224,7 @@ public:
|
|||
WavesTiles3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class JumpTiles3DDemo : public EffectBaseTest
|
||||
|
@ -234,7 +234,7 @@ public:
|
|||
JumpTiles3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class SplitRowsDemo : public EffectBaseTest
|
||||
|
@ -244,7 +244,7 @@ public:
|
|||
SplitRowsDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class SplitColsDemo : public EffectBaseTest
|
||||
|
@ -254,7 +254,7 @@ public:
|
|||
SplitColsDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class PageTurn3DDemo : public EffectBaseTest
|
||||
|
@ -264,7 +264,7 @@ public:
|
|||
PageTurn3DDemo();
|
||||
|
||||
protected:
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
class PageTurn3DRectDemo : public EffectBaseTest
|
||||
|
@ -275,7 +275,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual bool isRectEffect() override { return true; }
|
||||
virtual axis::ActionInterval* createEffect(float t) override;
|
||||
virtual ax::ActionInterval* createEffect(float t) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -127,7 +127,7 @@ void AssetsManagerExLoaderScene::startDownloadCallback(Ref* sender)
|
|||
else
|
||||
{
|
||||
_amListener =
|
||||
axis::extension::EventListenerAssetsManagerEx::create(_am, [this](EventAssetsManagerEx* event) {
|
||||
ax::extension::EventListenerAssetsManagerEx::create(_am, [this](EventAssetsManagerEx* event) {
|
||||
static int failCount = 0;
|
||||
switch (event->getEventCode())
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
|
||||
AssetsManagerExLoaderScene(int testIndex);
|
||||
|
||||
void startDownloadCallback(axis::Ref* sender);
|
||||
void startDownloadCallback(ax::Ref* sender);
|
||||
|
||||
virtual std::string title() const override;
|
||||
|
||||
|
@ -46,12 +46,12 @@ public:
|
|||
|
||||
private:
|
||||
int _testIndex;
|
||||
axis::Layer* _loadLayer;
|
||||
axis::Menu* _downloadMenu;
|
||||
ax::Layer* _loadLayer;
|
||||
ax::Menu* _downloadMenu;
|
||||
|
||||
axis::extension::AssetsManagerEx* _am;
|
||||
axis::Label* _progress;
|
||||
axis::extension::EventListenerAssetsManagerEx* _amListener;
|
||||
ax::extension::AssetsManagerEx* _am;
|
||||
ax::Label* _progress;
|
||||
ax::extension::EventListenerAssetsManagerEx* _amListener;
|
||||
|
||||
void onLoadEnd();
|
||||
};
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
#include "GUI/CCScrollView/CCScrollView.h"
|
||||
#include "GUI/CCScrollView/CCTableView.h"
|
||||
|
||||
class CustomTableViewCell : public axis::extension::TableViewCell
|
||||
class CustomTableViewCell : public ax::extension::TableViewCell
|
||||
{
|
||||
public:
|
||||
virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override;
|
||||
virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override;
|
||||
};
|
||||
|
||||
#endif /* __CUSTOMTABELVIEWCELL_H__ */
|
||||
|
|
|
@ -32,22 +32,22 @@
|
|||
DEFINE_TEST_SUITE(TableViewTests);
|
||||
|
||||
class TableViewTest : public TestCase,
|
||||
public axis::extension::TableViewDataSource,
|
||||
public axis::extension::TableViewDelegate
|
||||
public ax::extension::TableViewDataSource,
|
||||
public ax::extension::TableViewDelegate
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(TableViewTest);
|
||||
|
||||
virtual bool init() override;
|
||||
|
||||
virtual void scrollViewDidScroll(axis::extension::ScrollView* view) override{};
|
||||
virtual void scrollViewDidZoom(axis::extension::ScrollView* view) override {}
|
||||
virtual void tableCellTouched(axis::extension::TableView* table,
|
||||
axis::extension::TableViewCell* cell) override;
|
||||
virtual axis::Size tableCellSizeForIndex(axis::extension::TableView* table, ssize_t idx) override;
|
||||
virtual axis::extension::TableViewCell* tableCellAtIndex(axis::extension::TableView* table,
|
||||
virtual void scrollViewDidScroll(ax::extension::ScrollView* view) override{};
|
||||
virtual void scrollViewDidZoom(ax::extension::ScrollView* view) override {}
|
||||
virtual void tableCellTouched(ax::extension::TableView* table,
|
||||
ax::extension::TableViewCell* cell) override;
|
||||
virtual ax::Size tableCellSizeForIndex(ax::extension::TableView* table, ssize_t idx) override;
|
||||
virtual ax::extension::TableViewCell* tableCellAtIndex(ax::extension::TableView* table,
|
||||
ssize_t idx) override;
|
||||
virtual ssize_t numberOfCellsInTableView(axis::extension::TableView* table) override;
|
||||
virtual ssize_t numberOfCellsInTableView(ax::extension::TableView* table) override;
|
||||
};
|
||||
|
||||
#endif // __TABLEVIEWTESTSCENE_H__
|
||||
|
|
|
@ -42,18 +42,18 @@ public:
|
|||
MouseEventTest();
|
||||
~MouseEventTest();
|
||||
|
||||
void onMouseDown(axis::Event* event);
|
||||
void onMouseUp(axis::Event* event);
|
||||
void onMouseMove(axis::Event* event);
|
||||
void onMouseScroll(axis::Event* event);
|
||||
void onMouseDown(ax::Event* event);
|
||||
void onMouseUp(ax::Event* event);
|
||||
void onMouseMove(ax::Event* event);
|
||||
void onMouseScroll(ax::Event* event);
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::Label* _labelAction;
|
||||
axis::Label* _labelPosition;
|
||||
axis::EventListenerMouse* _mouseListener;
|
||||
ax::Label* _labelAction;
|
||||
ax::Label* _labelPosition;
|
||||
ax::EventListenerMouse* _mouseListener;
|
||||
};
|
||||
|
||||
class HideMouseTest : public BaseMouseTest
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::EventListenerMouse* _lis;
|
||||
ax::EventListenerMouse* _lis;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -41,11 +41,11 @@ public:
|
|||
// CREATE_NODE(IntervalLayer);
|
||||
|
||||
protected:
|
||||
axis::Label* _label0;
|
||||
axis::Label* _label1;
|
||||
axis::Label* _label2;
|
||||
axis::Label* _label3;
|
||||
axis::Label* _label4;
|
||||
ax::Label* _label0;
|
||||
ax::Label* _label1;
|
||||
ax::Label* _label2;
|
||||
ax::Label* _label3;
|
||||
ax::Label* _label4;
|
||||
|
||||
float _time0, _time1, _time2, _time3, _time4;
|
||||
};
|
||||
|
|
|
@ -673,7 +673,7 @@ std::string LabelFNTMultiLineAlignment::subtitle() const
|
|||
return "";
|
||||
}
|
||||
|
||||
void LabelFNTMultiLineAlignment::selectAlignmentItem(axis::MenuItemFont* item)
|
||||
void LabelFNTMultiLineAlignment::selectAlignmentItem(ax::MenuItemFont* item)
|
||||
{
|
||||
if (this->_lastAlignmentItem && this->_lastAlignmentItem != item)
|
||||
{
|
||||
|
@ -700,7 +700,7 @@ void LabelFNTMultiLineAlignment::selectAlignmentItem(axis::MenuItemFont* item)
|
|||
}
|
||||
}
|
||||
|
||||
void LabelFNTMultiLineAlignment::selectSentenceItem(axis::MenuItemFont* item)
|
||||
void LabelFNTMultiLineAlignment::selectSentenceItem(ax::MenuItemFont* item)
|
||||
{
|
||||
if (this->_lastSentenceItem && this->_lastSentenceItem != item)
|
||||
{
|
||||
|
@ -714,7 +714,7 @@ void LabelFNTMultiLineAlignment::selectSentenceItem(axis::MenuItemFont* item)
|
|||
this->_label->setString(str);
|
||||
}
|
||||
|
||||
std::string LabelFNTMultiLineAlignment::getItemString(axis::MenuItemFont* item)
|
||||
std::string LabelFNTMultiLineAlignment::getItemString(ax::MenuItemFont* item)
|
||||
{
|
||||
std::string str;
|
||||
|
||||
|
@ -737,7 +737,7 @@ std::string LabelFNTMultiLineAlignment::getItemString(axis::MenuItemFont* item)
|
|||
return str;
|
||||
}
|
||||
|
||||
void LabelFNTMultiLineAlignment::stringChanged(axis::Ref* sender)
|
||||
void LabelFNTMultiLineAlignment::stringChanged(ax::Ref* sender)
|
||||
{
|
||||
auto item = (MenuItemFont*)sender;
|
||||
|
||||
|
@ -746,7 +746,7 @@ void LabelFNTMultiLineAlignment::stringChanged(axis::Ref* sender)
|
|||
this->snapArrowsToEdge();
|
||||
}
|
||||
|
||||
void LabelFNTMultiLineAlignment::alignmentChanged(axis::Ref* sender)
|
||||
void LabelFNTMultiLineAlignment::alignmentChanged(ax::Ref* sender)
|
||||
{
|
||||
auto item = static_cast<MenuItemFont*>(sender);
|
||||
|
||||
|
@ -755,7 +755,7 @@ void LabelFNTMultiLineAlignment::alignmentChanged(axis::Ref* sender)
|
|||
this->snapArrowsToEdge();
|
||||
}
|
||||
|
||||
void LabelFNTMultiLineAlignment::onTouchesBegan(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void LabelFNTMultiLineAlignment::onTouchesBegan(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
auto touch = touches[0];
|
||||
auto location = touch->getLocationInView();
|
||||
|
@ -767,7 +767,7 @@ void LabelFNTMultiLineAlignment::onTouchesBegan(const std::vector<Touch*>& touch
|
|||
}
|
||||
}
|
||||
|
||||
void LabelFNTMultiLineAlignment::onTouchesEnded(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void LabelFNTMultiLineAlignment::onTouchesEnded(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
_drag = false;
|
||||
this->snapArrowsToEdge();
|
||||
|
@ -775,7 +775,7 @@ void LabelFNTMultiLineAlignment::onTouchesEnded(const std::vector<Touch*>& touch
|
|||
this->_arrowsBar->setVisible(false);
|
||||
}
|
||||
|
||||
void LabelFNTMultiLineAlignment::onTouchesMoved(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void LabelFNTMultiLineAlignment::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (!_drag)
|
||||
{
|
||||
|
@ -835,7 +835,7 @@ std::string LabelFNTMultiLineAlignmentUNICODE::subtitle() const
|
|||
return "";
|
||||
}
|
||||
|
||||
std::string LabelFNTMultiLineAlignmentUNICODE::getItemString(axis::MenuItemFont* item)
|
||||
std::string LabelFNTMultiLineAlignmentUNICODE::getItemString(ax::MenuItemFont* item)
|
||||
{
|
||||
std::string str;
|
||||
|
||||
|
@ -1208,8 +1208,8 @@ LabelTTFEmoji::LabelTTFEmoji()
|
|||
auto label = Label::createWithTTF(emojiString, "fonts/NotoEmoji-Regular.ttf", 23);
|
||||
label->setPosition(winSize.width / 2, winSize.height / 2);
|
||||
label->setDimensions(winSize.width, winSize.height);
|
||||
label->setVerticalAlignment(axis::TextVAlignment::CENTER);
|
||||
label->setHorizontalAlignment(axis::TextHAlignment::CENTER);
|
||||
label->setVerticalAlignment(ax::TextVAlignment::CENTER);
|
||||
label->setHorizontalAlignment(ax::TextHAlignment::CENTER);
|
||||
addChild(label);
|
||||
}
|
||||
|
||||
|
@ -2261,7 +2261,7 @@ LabelLayoutBaseTest::LabelLayoutBaseTest()
|
|||
this->initSliders(size);
|
||||
}
|
||||
|
||||
void LabelLayoutBaseTest::initFontSizeChange(const axis::Size& size)
|
||||
void LabelLayoutBaseTest::initFontSizeChange(const ax::Size& size)
|
||||
{
|
||||
auto fontSizeLabel = Label::createWithSystemFont("font size:20", "Arial", 10);
|
||||
fontSizeLabel->setName("fontSize");
|
||||
|
@ -2281,7 +2281,7 @@ void LabelLayoutBaseTest::initFontSizeChange(const axis::Size& size)
|
|||
this->addChild(fontSizeLabel);
|
||||
}
|
||||
|
||||
void LabelLayoutBaseTest::initWrapOption(const axis::Size& size)
|
||||
void LabelLayoutBaseTest::initWrapOption(const ax::Size& size)
|
||||
{
|
||||
auto label = Label::createWithSystemFont("Enable Wrap:", "Arial", 10);
|
||||
label->setColor(Color3B::WHITE);
|
||||
|
@ -2310,7 +2310,7 @@ void LabelLayoutBaseTest::initWrapOption(const axis::Size& size)
|
|||
this->addChild(checkBox);
|
||||
}
|
||||
|
||||
void LabelLayoutBaseTest::initToggleLabelTypeOption(const axis::Size& size)
|
||||
void LabelLayoutBaseTest::initToggleLabelTypeOption(const ax::Size& size)
|
||||
{
|
||||
auto label = Label::createWithSystemFont("Toggle Label Type:", "Arial", 10);
|
||||
label->setColor(Color3B::WHITE);
|
||||
|
@ -2347,7 +2347,7 @@ void LabelLayoutBaseTest::initToggleLabelTypeOption(const axis::Size& size)
|
|||
this->addChild(checkBox);
|
||||
}
|
||||
|
||||
void LabelLayoutBaseTest::initAlignmentOption(const axis::Size& size)
|
||||
void LabelLayoutBaseTest::initAlignmentOption(const ax::Size& size)
|
||||
{
|
||||
// add text alignment settings
|
||||
MenuItemFont::setFontSize(30);
|
||||
|
@ -2368,7 +2368,7 @@ void LabelLayoutBaseTest::initAlignmentOption(const axis::Size& size)
|
|||
this->addChild(menu);
|
||||
}
|
||||
|
||||
void LabelLayoutBaseTest::initSliders(const axis::Size& size)
|
||||
void LabelLayoutBaseTest::initSliders(const ax::Size& size)
|
||||
{
|
||||
auto slider = ui::Slider::create();
|
||||
slider->setTag(1);
|
||||
|
@ -2417,7 +2417,7 @@ void LabelLayoutBaseTest::initSliders(const axis::Size& size)
|
|||
});
|
||||
}
|
||||
|
||||
void LabelLayoutBaseTest::initTestLabel(const axis::Size& size)
|
||||
void LabelLayoutBaseTest::initTestLabel(const ax::Size& size)
|
||||
{
|
||||
auto center = VisibleRect::center();
|
||||
_label = Label::createWithTTF("五六七八This is a very long sentence一二三四.", "fonts/HKYuanMini.ttf", 20);
|
||||
|
@ -2429,7 +2429,7 @@ void LabelLayoutBaseTest::initTestLabel(const axis::Size& size)
|
|||
_labelType = 0;
|
||||
}
|
||||
|
||||
void LabelLayoutBaseTest::initDrawNode(const axis::Size& size)
|
||||
void LabelLayoutBaseTest::initDrawNode(const ax::Size& size)
|
||||
{
|
||||
_drawNode = DrawNode::create();
|
||||
|
||||
|
@ -2468,7 +2468,7 @@ void LabelLayoutBaseTest::setAlignmentBottom(Ref* sender)
|
|||
_label->setVerticalAlignment(TextVAlignment::BOTTOM);
|
||||
}
|
||||
|
||||
void LabelLayoutBaseTest::valueChanged(axis::Ref* sender, axis::extension::Control::EventType controlEvent)
|
||||
void LabelLayoutBaseTest::valueChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent)
|
||||
{
|
||||
ControlStepper* pControl = (ControlStepper*)sender;
|
||||
// Change value of label.
|
||||
|
@ -2501,7 +2501,7 @@ void LabelLayoutBaseTest::valueChanged(axis::Ref* sender, axis::extension::Contr
|
|||
// AXLOG("label line height = %f", _label->getLineHeight());
|
||||
}
|
||||
|
||||
void LabelLayoutBaseTest::updateDrawNodeSize(const axis::Size& drawNodeSize)
|
||||
void LabelLayoutBaseTest::updateDrawNodeSize(const ax::Size& drawNodeSize)
|
||||
{
|
||||
auto origin = Director::getInstance()->getWinSize();
|
||||
auto labelSize = _label->getContentSize();
|
||||
|
@ -3077,7 +3077,7 @@ LabelItalics::LabelItalics()
|
|||
addChild(_label2a, 0, kTagBitmapAtlas2);
|
||||
_label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 6));
|
||||
|
||||
auto menuItem = MenuItemFont::create("disable italics", [&](axis::Ref* sender) {
|
||||
auto menuItem = MenuItemFont::create("disable italics", [&](ax::Ref* sender) {
|
||||
_label2a->disableEffect(LabelEffect::ITALICS);
|
||||
_label1a->disableEffect(LabelEffect::ITALICS);
|
||||
});
|
||||
|
@ -3129,7 +3129,7 @@ LabelBold::LabelBold()
|
|||
addChild(_label2a, 0, kTagBitmapAtlas2);
|
||||
_label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 6));
|
||||
|
||||
auto menuItem = MenuItemFont::create("disable bold", [&](axis::Ref* sender) {
|
||||
auto menuItem = MenuItemFont::create("disable bold", [&](ax::Ref* sender) {
|
||||
_label2a->disableEffect(LabelEffect::BOLD);
|
||||
_label1a->disableEffect(LabelEffect::BOLD);
|
||||
});
|
||||
|
@ -3181,7 +3181,7 @@ LabelUnderline::LabelUnderline()
|
|||
addChild(_label2a, 0, kTagBitmapAtlas2);
|
||||
_label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 6));
|
||||
|
||||
auto menuItem = MenuItemFont::create("disable underline", [&](axis::Ref* sender) {
|
||||
auto menuItem = MenuItemFont::create("disable underline", [&](ax::Ref* sender) {
|
||||
_label2a->disableEffect(LabelEffect::UNDERLINE);
|
||||
_label1a->disableEffect(LabelEffect::UNDERLINE);
|
||||
});
|
||||
|
@ -3223,7 +3223,7 @@ LabelUnderlineMultiline::LabelUnderlineMultiline()
|
|||
addChild(_label2a, 0, kTagBitmapAtlas2);
|
||||
_label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 3));
|
||||
|
||||
auto menuItem = MenuItemFont::create("disable underline", [&](axis::Ref* sender) {
|
||||
auto menuItem = MenuItemFont::create("disable underline", [&](ax::Ref* sender) {
|
||||
_label2a->disableEffect(LabelEffect::UNDERLINE);
|
||||
_label1a->disableEffect(LabelEffect::UNDERLINE);
|
||||
});
|
||||
|
@ -3265,7 +3265,7 @@ LabelStrikethrough::LabelStrikethrough()
|
|||
addChild(_label2a, 0, kTagBitmapAtlas2);
|
||||
_label2a->setPosition(Vec2(s.width / 2, s.height * 1 / 3));
|
||||
|
||||
auto menuItem = MenuItemFont::create("disable underline", [&](axis::Ref* sender) {
|
||||
auto menuItem = MenuItemFont::create("disable underline", [&](ax::Ref* sender) {
|
||||
_label2a->disableEffect(LabelEffect::STRIKETHROUGH);
|
||||
_label1a->disableEffect(LabelEffect::STRIKETHROUGH);
|
||||
});
|
||||
|
@ -3403,14 +3403,14 @@ LabelIssue15214::LabelIssue15214()
|
|||
// 1
|
||||
Label* label = Label::createWithTTF("TTF with setColor()", "fonts/arial.ttf", 24.0f);
|
||||
label->enableUnderline();
|
||||
label->setColor(axis::Color3B::BLUE);
|
||||
label->setColor(ax::Color3B::BLUE);
|
||||
label->setPosition(size.width / 2, size.height / 5 * 4);
|
||||
this->addChild(label);
|
||||
|
||||
// 2
|
||||
Label* label2 = Label::createWithSystemFont("System with setColor()", "Verdana", 24.0f);
|
||||
label2->enableUnderline();
|
||||
label2->setColor(axis::Color3B::BLUE);
|
||||
label2->setColor(ax::Color3B::BLUE);
|
||||
label2->setPosition(size.width / 2, size.height / 5 * 3);
|
||||
this->addChild(label2);
|
||||
|
||||
|
@ -3597,7 +3597,7 @@ LabelIssue20523::LabelIssue20523()
|
|||
auto size = Director::getInstance()->getWinSize();
|
||||
auto _crashingLabel = Label::createWithTTF("0", "fonts/Marker Felt.ttf", 120);
|
||||
_crashingLabel->setPosition(Vec2(size.width / 2, size.height / 2));
|
||||
_crashingLabel->setColor(axis::Color3B(200, 200, 200));
|
||||
_crashingLabel->setColor(ax::Color3B(200, 200, 200));
|
||||
addChild(_crashingLabel, 1);
|
||||
//_crashingLabel->setWidth(size.width);
|
||||
|
||||
|
@ -3646,7 +3646,7 @@ std::string LabelLetterColorsTest::subtitle() const
|
|||
return "Should not crash!";
|
||||
}
|
||||
|
||||
void LabelLetterColorsTest::setLetterColors(axis::Label* label, const axis::Color3B& color)
|
||||
void LabelLetterColorsTest::setLetterColors(ax::Label* label, const ax::Color3B& color)
|
||||
{
|
||||
int n = label->getStringLength();
|
||||
for (int i = 0; i < n; ++i)
|
||||
|
|
|
@ -170,22 +170,22 @@ public:
|
|||
void snapArrowsToEdge();
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void stringChanged(axis::Ref* sender);
|
||||
void alignmentChanged(axis::Ref* sender);
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void selectAlignmentItem(axis::MenuItemFont* item);
|
||||
void selectSentenceItem(axis::MenuItemFont* item);
|
||||
virtual std::string getItemString(axis::MenuItemFont* item);
|
||||
void stringChanged(ax::Ref* sender);
|
||||
void alignmentChanged(ax::Ref* sender);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void selectAlignmentItem(ax::MenuItemFont* item);
|
||||
void selectSentenceItem(ax::MenuItemFont* item);
|
||||
virtual std::string getItemString(ax::MenuItemFont* item);
|
||||
|
||||
protected:
|
||||
axis::Label* _label = nullptr;
|
||||
axis::Sprite* _arrowsBar = nullptr;
|
||||
axis::Sprite* _arrows = nullptr;
|
||||
std::vector<axis::MenuItemFont*> _menuItems;
|
||||
axis::MenuItemFont* _lastSentenceItem = nullptr;
|
||||
axis::MenuItemFont* _lastAlignmentItem = nullptr;
|
||||
ax::Label* _label = nullptr;
|
||||
ax::Sprite* _arrowsBar = nullptr;
|
||||
ax::Sprite* _arrows = nullptr;
|
||||
std::vector<ax::MenuItemFont*> _menuItems;
|
||||
ax::MenuItemFont* _lastSentenceItem = nullptr;
|
||||
ax::MenuItemFont* _lastAlignmentItem = nullptr;
|
||||
bool _drag = false;
|
||||
};
|
||||
|
||||
|
@ -198,7 +198,7 @@ public:
|
|||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual std::string getItemString(axis::MenuItemFont* item) override;
|
||||
virtual std::string getItemString(ax::MenuItemFont* item) override;
|
||||
};
|
||||
|
||||
class LabelFNTUNICODELanguages : public AtlasDemoNew
|
||||
|
@ -286,13 +286,13 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
void setAlignmentLeft(axis::Ref* sender);
|
||||
void setAlignmentCenter(axis::Ref* sender);
|
||||
void setAlignmentRight(axis::Ref* sender);
|
||||
void setAlignmentLeft(ax::Ref* sender);
|
||||
void setAlignmentCenter(ax::Ref* sender);
|
||||
void setAlignmentRight(ax::Ref* sender);
|
||||
void updateAlignment();
|
||||
|
||||
axis::Label* _label;
|
||||
axis::TextHAlignment _horizAlign;
|
||||
ax::Label* _label;
|
||||
ax::TextHAlignment _horizAlign;
|
||||
};
|
||||
|
||||
class LabelTTFEmoji : public AtlasDemoNew
|
||||
|
@ -374,13 +374,13 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type);
|
||||
void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type);
|
||||
|
||||
private:
|
||||
axis::Label* shadowLabelOutline;
|
||||
axis::Label* shadowLabelTTF;
|
||||
axis::Label* shadowLabelGrow;
|
||||
axis::Label* shadowLabelBMFont;
|
||||
ax::Label* shadowLabelOutline;
|
||||
ax::Label* shadowLabelTTF;
|
||||
ax::Label* shadowLabelGrow;
|
||||
ax::Label* shadowLabelBMFont;
|
||||
};
|
||||
|
||||
class LabelCharMapTest : public AtlasDemoNew
|
||||
|
@ -459,14 +459,14 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
void setAlignmentLeft(axis::Ref* sender);
|
||||
void setAlignmentCenter(axis::Ref* sender);
|
||||
void setAlignmentRight(axis::Ref* sender);
|
||||
void setAlignmentTop(axis::Ref* sender);
|
||||
void setAlignmentMiddle(axis::Ref* sender);
|
||||
void setAlignmentBottom(axis::Ref* sender);
|
||||
void setAlignmentLeft(ax::Ref* sender);
|
||||
void setAlignmentCenter(ax::Ref* sender);
|
||||
void setAlignmentRight(ax::Ref* sender);
|
||||
void setAlignmentTop(ax::Ref* sender);
|
||||
void setAlignmentMiddle(ax::Ref* sender);
|
||||
void setAlignmentBottom(ax::Ref* sender);
|
||||
|
||||
axis::Label* _label;
|
||||
ax::Label* _label;
|
||||
};
|
||||
|
||||
class LabelIssue4428Test : public AtlasDemoNew
|
||||
|
@ -501,10 +501,10 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type);
|
||||
void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type);
|
||||
|
||||
private:
|
||||
axis::Label* label;
|
||||
ax::Label* label;
|
||||
};
|
||||
|
||||
class LabelAdditionalKerningTest : public AtlasDemoNew
|
||||
|
@ -517,10 +517,10 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void sliderEvent(axis::Ref* sender, axis::ui::Slider::EventType type);
|
||||
void sliderEvent(ax::Ref* sender, ax::ui::Slider::EventType type);
|
||||
|
||||
private:
|
||||
axis::Label* label;
|
||||
ax::Label* label;
|
||||
};
|
||||
|
||||
class LabelIssue8492Test : public AtlasDemoNew
|
||||
|
@ -704,27 +704,27 @@ class LabelLayoutBaseTest : public AtlasDemoNew
|
|||
{
|
||||
public:
|
||||
LabelLayoutBaseTest();
|
||||
void updateDrawNodeSize(const axis::Size& drawNodeSize);
|
||||
axis::extension::ControlStepper* makeControlStepper();
|
||||
void valueChanged(axis::Ref* sender, axis::extension::Control::EventType controlEvent);
|
||||
void updateDrawNodeSize(const ax::Size& drawNodeSize);
|
||||
ax::extension::ControlStepper* makeControlStepper();
|
||||
void valueChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent);
|
||||
|
||||
protected:
|
||||
void setAlignmentLeft(axis::Ref* sender);
|
||||
void setAlignmentCenter(axis::Ref* sender);
|
||||
void setAlignmentRight(axis::Ref* sender);
|
||||
void setAlignmentTop(axis::Ref* sender);
|
||||
void setAlignmentMiddle(axis::Ref* sender);
|
||||
void setAlignmentBottom(axis::Ref* sender);
|
||||
void setAlignmentLeft(ax::Ref* sender);
|
||||
void setAlignmentCenter(ax::Ref* sender);
|
||||
void setAlignmentRight(ax::Ref* sender);
|
||||
void setAlignmentTop(ax::Ref* sender);
|
||||
void setAlignmentMiddle(ax::Ref* sender);
|
||||
void setAlignmentBottom(ax::Ref* sender);
|
||||
|
||||
void initWrapOption(const axis::Size& size);
|
||||
void initToggleLabelTypeOption(const axis::Size& size);
|
||||
void initAlignmentOption(const axis::Size& size);
|
||||
void initFontSizeChange(const axis::Size& size);
|
||||
void initSliders(const axis::Size& size);
|
||||
void initTestLabel(const axis::Size& size);
|
||||
void initDrawNode(const axis::Size& size);
|
||||
axis::DrawNode* _drawNode;
|
||||
axis::Label* _label;
|
||||
void initWrapOption(const ax::Size& size);
|
||||
void initToggleLabelTypeOption(const ax::Size& size);
|
||||
void initAlignmentOption(const ax::Size& size);
|
||||
void initFontSizeChange(const ax::Size& size);
|
||||
void initSliders(const ax::Size& size);
|
||||
void initTestLabel(const ax::Size& size);
|
||||
void initDrawNode(const ax::Size& size);
|
||||
ax::DrawNode* _drawNode;
|
||||
ax::Label* _label;
|
||||
int _labelType;
|
||||
};
|
||||
|
||||
|
@ -801,7 +801,7 @@ public:
|
|||
|
||||
LabelToggleTypeTest();
|
||||
void initToggleCheckboxes();
|
||||
void onChangedRadioButtonSelect(axis::ui::RadioButton* radioButton, axis::ui::RadioButton::EventType type);
|
||||
void onChangedRadioButtonSelect(ax::ui::RadioButton* radioButton, ax::ui::RadioButton::EventType type);
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
@ -814,7 +814,7 @@ public:
|
|||
|
||||
LabelSystemFontTest();
|
||||
void initToggleCheckboxes();
|
||||
void onChangedRadioButtonSelect(axis::ui::RadioButton* radioButton, axis::ui::RadioButton::EventType type);
|
||||
void onChangedRadioButtonSelect(ax::ui::RadioButton* radioButton, ax::ui::RadioButton::EventType type);
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
@ -861,8 +861,8 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
axis::Label* _label1a;
|
||||
axis::Label* _label2a;
|
||||
ax::Label* _label1a;
|
||||
ax::Label* _label2a;
|
||||
};
|
||||
|
||||
class LabelBold : public AtlasDemoNew
|
||||
|
@ -874,8 +874,8 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
axis::Label* _label1a;
|
||||
axis::Label* _label2a;
|
||||
ax::Label* _label1a;
|
||||
ax::Label* _label2a;
|
||||
};
|
||||
|
||||
class LabelUnderline : public AtlasDemoNew
|
||||
|
@ -887,8 +887,8 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
axis::Label* _label1a;
|
||||
axis::Label* _label2a;
|
||||
ax::Label* _label1a;
|
||||
ax::Label* _label2a;
|
||||
};
|
||||
|
||||
class LabelUnderlineMultiline : public AtlasDemoNew
|
||||
|
@ -900,8 +900,8 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
axis::Label* _label1a;
|
||||
axis::Label* _label2a;
|
||||
ax::Label* _label1a;
|
||||
ax::Label* _label2a;
|
||||
};
|
||||
|
||||
class LabelStrikethrough : public AtlasDemoNew
|
||||
|
@ -913,8 +913,8 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
axis::Label* _label1a;
|
||||
axis::Label* _label2a;
|
||||
ax::Label* _label1a;
|
||||
ax::Label* _label2a;
|
||||
};
|
||||
|
||||
class LabelLocalizationTest : public AtlasDemoNew
|
||||
|
@ -923,13 +923,13 @@ public:
|
|||
CREATE_FUNC(LabelLocalizationTest);
|
||||
|
||||
LabelLocalizationTest();
|
||||
void onChangedRadioButtonSelect(axis::ui::RadioButton* radioButton, axis::ui::RadioButton::EventType type);
|
||||
void onChangedRadioButtonSelect(ax::ui::RadioButton* radioButton, ax::ui::RadioButton::EventType type);
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
axis::Label* _label1;
|
||||
axis::Label* _label2;
|
||||
ax::Label* _label1;
|
||||
ax::Label* _label2;
|
||||
cocostudio::ILocalizationManager* _localizationJson;
|
||||
cocostudio::ILocalizationManager* _localizationBin;
|
||||
};
|
||||
|
@ -1027,7 +1027,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
static void setLetterColors(axis::Label* label, const axis::Color3B& color);
|
||||
static void setLetterColors(ax::Label* label, const ax::Color3B& color);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -855,7 +855,7 @@ void LayerRadialGradientTest::onEnter()
|
|||
addChild(listview);
|
||||
}
|
||||
|
||||
axis::ui::Slider* LayerRadialGradientTest::createSlider()
|
||||
ax::ui::Slider* LayerRadialGradientTest::createSlider()
|
||||
{
|
||||
auto slider = ui::Slider::create();
|
||||
slider->setTouchEnabled(true);
|
||||
|
@ -870,18 +870,18 @@ axis::ui::Slider* LayerRadialGradientTest::createSlider()
|
|||
return slider;
|
||||
}
|
||||
|
||||
void LayerRadialGradientTest::listviewCallback(axis::Ref* sender, axis::ui::ListView::EventType type)
|
||||
void LayerRadialGradientTest::listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type)
|
||||
{
|
||||
// clear all text to white
|
||||
auto listview = static_cast<axis::ui::ListView*>(sender);
|
||||
auto listview = static_cast<ax::ui::ListView*>(sender);
|
||||
for (auto&& item : listview->getItems())
|
||||
static_cast<axis::ui::Text*>(item)->setColor(axis::Color3B::WHITE);
|
||||
static_cast<ax::ui::Text*>(item)->setColor(ax::Color3B::WHITE);
|
||||
|
||||
_currentSeletedItemIndex = (int)listview->getCurSelectedIndex();
|
||||
listview->getItem(_currentSeletedItemIndex)->setColor(axis::Color3B::RED);
|
||||
listview->getItem(_currentSeletedItemIndex)->setColor(ax::Color3B::RED);
|
||||
|
||||
int percent = 100;
|
||||
auto slider = static_cast<axis::ui::Slider*>(getChildByTag(101));
|
||||
auto slider = static_cast<ax::ui::Slider*>(getChildByTag(101));
|
||||
switch (_currentSeletedItemIndex)
|
||||
{
|
||||
case 0:
|
||||
|
@ -910,9 +910,9 @@ void LayerRadialGradientTest::listviewCallback(axis::Ref* sender, axis::ui::List
|
|||
}
|
||||
}
|
||||
|
||||
void LayerRadialGradientTest::sliderCallback(axis::Ref* sender, axis::ui::Slider::EventType type)
|
||||
void LayerRadialGradientTest::sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type)
|
||||
{
|
||||
auto slider = static_cast<axis::ui::Slider*>(sender);
|
||||
auto slider = static_cast<ax::ui::Slider*>(sender);
|
||||
float percent = slider->getPercent() / 100.f;
|
||||
switch (_currentSeletedItemIndex)
|
||||
{
|
||||
|
@ -946,32 +946,32 @@ void LayerRadialGradientTest::sliderCallback(axis::Ref* sender, axis::ui::Slider
|
|||
}
|
||||
}
|
||||
|
||||
axis::ui::ListView* LayerRadialGradientTest::createListView()
|
||||
ax::ui::ListView* LayerRadialGradientTest::createListView()
|
||||
{
|
||||
auto listview = axis::ui::ListView::create();
|
||||
auto listview = ax::ui::ListView::create();
|
||||
|
||||
auto scale = axis::ui::Text::create();
|
||||
auto scale = ax::ui::Text::create();
|
||||
scale->setString("scale[0-2]");
|
||||
scale->setColor(axis::Color3B::RED); // default seleted item
|
||||
scale->setColor(ax::Color3B::RED); // default seleted item
|
||||
scale->setTouchEnabled(true);
|
||||
listview->pushBackCustomItem(scale);
|
||||
|
||||
auto skewx = axis::ui::Text::create();
|
||||
auto skewx = ax::ui::Text::create();
|
||||
skewx->setString("skewx[0-90]");
|
||||
skewx->setTouchEnabled(true);
|
||||
listview->pushBackCustomItem(skewx);
|
||||
|
||||
auto skewy = axis::ui::Text::create();
|
||||
auto skewy = ax::ui::Text::create();
|
||||
skewy->setString("skewy[0-90]");
|
||||
skewy->setTouchEnabled(true);
|
||||
listview->pushBackCustomItem(skewy);
|
||||
|
||||
auto expand = axis::ui::Text::create();
|
||||
auto expand = ax::ui::Text::create();
|
||||
expand->setString("expand[0-1]");
|
||||
expand->setTouchEnabled(true);
|
||||
listview->pushBackCustomItem(expand);
|
||||
|
||||
auto radius = axis::ui::Text::create();
|
||||
auto radius = ax::ui::Text::create();
|
||||
radius->setString("radius[0-300]");
|
||||
radius->setTouchEnabled(true);
|
||||
listview->pushBackCustomItem(radius);
|
||||
|
|
|
@ -96,11 +96,11 @@ public:
|
|||
virtual void onEnter() override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void updateSize(axis::Vec2& touchLocation);
|
||||
void updateSize(ax::Vec2& touchLocation);
|
||||
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
};
|
||||
|
||||
class LayerTest2 : public LayerTest
|
||||
|
@ -126,10 +126,10 @@ class LayerGradientTest : public LayerTest
|
|||
public:
|
||||
CREATE_FUNC(LayerGradientTest);
|
||||
LayerGradientTest();
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void toggleItem(axis::Ref* sender);
|
||||
void toggleItem(ax::Ref* sender);
|
||||
};
|
||||
|
||||
class LayerGradientTest2 : public LayerTest
|
||||
|
@ -146,7 +146,7 @@ class LayerIgnoreAnchorPointPos : public LayerTest
|
|||
public:
|
||||
CREATE_FUNC(LayerIgnoreAnchorPointPos);
|
||||
virtual void onEnter() override;
|
||||
void onToggle(axis::Ref* pObject);
|
||||
void onToggle(ax::Ref* pObject);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
};
|
||||
|
@ -156,7 +156,7 @@ class LayerIgnoreAnchorPointRot : public LayerTest
|
|||
public:
|
||||
CREATE_FUNC(LayerIgnoreAnchorPointRot);
|
||||
virtual void onEnter() override;
|
||||
void onToggle(axis::Ref* pObject);
|
||||
void onToggle(ax::Ref* pObject);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
};
|
||||
|
@ -166,7 +166,7 @@ class LayerIgnoreAnchorPointScale : public LayerTest
|
|||
public:
|
||||
CREATE_FUNC(LayerIgnoreAnchorPointScale);
|
||||
virtual void onEnter() override;
|
||||
void onToggle(axis::Ref* pObject);
|
||||
void onToggle(ax::Ref* pObject);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
};
|
||||
|
@ -191,7 +191,7 @@ public:
|
|||
void step(float dt);
|
||||
|
||||
private:
|
||||
axis::LayerColor* _layer[3];
|
||||
ax::LayerColor* _layer[3];
|
||||
};
|
||||
|
||||
class LayerBug3162B : public LayerTest
|
||||
|
@ -205,7 +205,7 @@ public:
|
|||
void step(float dt);
|
||||
|
||||
private:
|
||||
axis::LayerColor* _layer[3];
|
||||
ax::LayerColor* _layer[3];
|
||||
};
|
||||
|
||||
class LayerColorOccludeBug : public LayerTest
|
||||
|
@ -218,7 +218,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::LayerColor* _layer;
|
||||
ax::LayerColor* _layer;
|
||||
};
|
||||
|
||||
class LayerRadialGradientTest : public LayerTest
|
||||
|
@ -228,14 +228,14 @@ public:
|
|||
virtual void onEnter() override;
|
||||
virtual std::string title() const override;
|
||||
|
||||
void sliderCallback(axis::Ref* sender, axis::ui::Slider::EventType type);
|
||||
void listviewCallback(axis::Ref* sender, axis::ui::ListView::EventType type);
|
||||
void sliderCallback(ax::Ref* sender, ax::ui::Slider::EventType type);
|
||||
void listviewCallback(ax::Ref* sender, ax::ui::ListView::EventType type);
|
||||
|
||||
private:
|
||||
axis::ui::Slider* createSlider();
|
||||
axis::ui::ListView* createListView();
|
||||
ax::ui::Slider* createSlider();
|
||||
ax::ui::ListView* createListView();
|
||||
|
||||
axis::LayerRadialGradient* _layer;
|
||||
ax::LayerRadialGradient* _layer;
|
||||
int _currentSeletedItemIndex;
|
||||
};
|
||||
|
||||
|
|
|
@ -41,22 +41,22 @@ public:
|
|||
|
||||
virtual void update(float delta) override;
|
||||
|
||||
void SwitchLight(axis::Ref* sender, axis::LightType lightType);
|
||||
void SwitchLight(ax::Ref* sender, ax::LightType lightType);
|
||||
|
||||
private:
|
||||
void addSprite();
|
||||
void addLights();
|
||||
|
||||
private:
|
||||
axis::AmbientLight* _ambientLight;
|
||||
axis::DirectionLight* _directionalLight;
|
||||
axis::PointLight* _pointLight;
|
||||
axis::SpotLight* _spotLight;
|
||||
ax::AmbientLight* _ambientLight;
|
||||
ax::DirectionLight* _directionalLight;
|
||||
ax::PointLight* _pointLight;
|
||||
ax::SpotLight* _spotLight;
|
||||
|
||||
axis::Label* _ambientLightLabel;
|
||||
axis::Label* _directionalLightLabel;
|
||||
axis::Label* _pointLightLabel;
|
||||
axis::Label* _spotLightLabel;
|
||||
ax::Label* _ambientLightLabel;
|
||||
ax::Label* _directionalLightLabel;
|
||||
ax::Label* _pointLightLabel;
|
||||
ax::Label* _spotLightLabel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -69,12 +69,12 @@ public:
|
|||
private:
|
||||
struct Locations
|
||||
{
|
||||
Locations(axis::backend::ProgramState* ps, axis::backend::UniformLocation loc)
|
||||
Locations(ax::backend::ProgramState* ps, ax::backend::UniformLocation loc)
|
||||
: programState(ps), location(loc)
|
||||
{}
|
||||
|
||||
axis::backend::ProgramState* programState = nullptr;
|
||||
axis::backend::UniformLocation location;
|
||||
ax::backend::ProgramState* programState = nullptr;
|
||||
ax::backend::UniformLocation location;
|
||||
};
|
||||
std::vector<Locations> timeUniforms;
|
||||
};
|
||||
|
@ -94,9 +94,9 @@ public:
|
|||
void updateUniformTime(float);
|
||||
|
||||
private:
|
||||
axis::backend::UniformLocation _locationTime;
|
||||
ax::backend::UniformLocation _locationTime;
|
||||
EffectAutoBindingResolver* _resolver = nullptr;
|
||||
axis::backend::ProgramState* _noiseProgramState = nullptr;
|
||||
ax::backend::ProgramState* _noiseProgramState = nullptr;
|
||||
};
|
||||
|
||||
class Material_setTechnique : public MaterialSystemBaseTest
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
private:
|
||||
void changeMaterial(float dt);
|
||||
|
||||
axis::MeshRenderer* _mesh;
|
||||
ax::MeshRenderer* _mesh;
|
||||
int _techniqueState;
|
||||
};
|
||||
|
||||
|
|
|
@ -478,7 +478,7 @@ void BugsTest::issue1410MenuCallback(Ref* sender)
|
|||
log("NO CRASHES");
|
||||
}
|
||||
|
||||
void BugsTest::issue1410v2MenuCallback(axis::Ref* pSender)
|
||||
void BugsTest::issue1410v2MenuCallback(ax::Ref* pSender)
|
||||
{
|
||||
auto menu = static_cast<Menu*>(static_cast<MenuItem*>(pSender)->getParent());
|
||||
menu->setEnabled(true);
|
||||
|
@ -487,7 +487,7 @@ void BugsTest::issue1410v2MenuCallback(axis::Ref* pSender)
|
|||
log("NO CRASHES. AND MENU SHOULD STOP WORKING");
|
||||
}
|
||||
|
||||
void BugsTest::backMenuCallback(axis::Ref* pSender)
|
||||
void BugsTest::backMenuCallback(ax::Ref* pSender)
|
||||
{
|
||||
static_cast<LayerMultiplex*>(_parent)->switchTo(0, false);
|
||||
}
|
||||
|
|
|
@ -40,39 +40,39 @@ public:
|
|||
virtual bool init() override;
|
||||
};
|
||||
|
||||
class MenuLayerMainMenu : public axis::Layer
|
||||
class MenuLayerMainMenu : public ax::Layer
|
||||
{
|
||||
protected:
|
||||
axis::MenuItem* _disabledItem;
|
||||
axis::EventListenerTouchOneByOne* _touchListener;
|
||||
ax::MenuItem* _disabledItem;
|
||||
ax::EventListenerTouchOneByOne* _touchListener;
|
||||
|
||||
public:
|
||||
MenuLayerMainMenu();
|
||||
~MenuLayerMainMenu();
|
||||
|
||||
public:
|
||||
bool touchBegan(axis::Touch* touch, axis::Event* event);
|
||||
void touchEnded(axis::Touch* touch, axis::Event* event);
|
||||
void touchCancelled(axis::Touch* touch, axis::Event* event);
|
||||
void touchMoved(axis::Touch* touch, axis::Event* event);
|
||||
bool touchBegan(ax::Touch* touch, ax::Event* event);
|
||||
void touchEnded(ax::Touch* touch, ax::Event* event);
|
||||
void touchCancelled(ax::Touch* touch, ax::Event* event);
|
||||
void touchMoved(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
void allowTouches(float dt);
|
||||
void menuCallback(axis::Ref* sender);
|
||||
void menuCallbackConfig(axis::Ref* sender);
|
||||
void menuCallbackDisabled(axis::Ref* sender);
|
||||
void menuCallback2(axis::Ref* sender);
|
||||
void menuCallbackPriorityTest(axis::Ref* sender);
|
||||
void menuCallbackBugsTest(axis::Ref* pSender);
|
||||
void onQuit(axis::Ref* sender);
|
||||
void menuMovingCallback(axis::Ref* pSender);
|
||||
void menuCallback(ax::Ref* sender);
|
||||
void menuCallbackConfig(ax::Ref* sender);
|
||||
void menuCallbackDisabled(ax::Ref* sender);
|
||||
void menuCallback2(ax::Ref* sender);
|
||||
void menuCallbackPriorityTest(ax::Ref* sender);
|
||||
void menuCallbackBugsTest(ax::Ref* pSender);
|
||||
void onQuit(ax::Ref* sender);
|
||||
void menuMovingCallback(ax::Ref* pSender);
|
||||
|
||||
// CREATE_NODE(MenuLayer1);
|
||||
};
|
||||
|
||||
class MenuLayer2 : public axis::Layer
|
||||
class MenuLayer2 : public ax::Layer
|
||||
{
|
||||
protected:
|
||||
axis::Vec2 _centeredMenu;
|
||||
ax::Vec2 _centeredMenu;
|
||||
bool _alignedH;
|
||||
|
||||
void alignMenusH();
|
||||
|
@ -82,56 +82,56 @@ public:
|
|||
MenuLayer2();
|
||||
~MenuLayer2();
|
||||
|
||||
void menuCallback(axis::Ref* sender);
|
||||
void menuCallbackOpacity(axis::Ref* sender);
|
||||
void menuCallbackAlign(axis::Ref* sender);
|
||||
void menuCallback(ax::Ref* sender);
|
||||
void menuCallbackOpacity(ax::Ref* sender);
|
||||
void menuCallbackAlign(ax::Ref* sender);
|
||||
|
||||
// CREATE_NODE(MenuLayer2);
|
||||
};
|
||||
|
||||
class MenuLayer3 : public axis::Layer
|
||||
class MenuLayer3 : public ax::Layer
|
||||
{
|
||||
protected:
|
||||
axis::MenuItem* _disabledItem;
|
||||
ax::MenuItem* _disabledItem;
|
||||
|
||||
public:
|
||||
MenuLayer3();
|
||||
~MenuLayer3();
|
||||
};
|
||||
|
||||
class MenuLayer4 : public axis::Layer
|
||||
class MenuLayer4 : public ax::Layer
|
||||
{
|
||||
public:
|
||||
MenuLayer4();
|
||||
~MenuLayer4();
|
||||
|
||||
void menuCallback(axis::Ref* sender);
|
||||
void backCallback(axis::Ref* sender);
|
||||
void menuCallback(ax::Ref* sender);
|
||||
void backCallback(ax::Ref* sender);
|
||||
};
|
||||
|
||||
class BugsTest : public axis::Layer
|
||||
class BugsTest : public ax::Layer
|
||||
{
|
||||
public:
|
||||
BugsTest();
|
||||
|
||||
void issue1410MenuCallback(axis::Ref* pSender);
|
||||
void issue1410v2MenuCallback(axis::Ref* pSender);
|
||||
void backMenuCallback(axis::Ref* pSender);
|
||||
void issue1410MenuCallback(ax::Ref* pSender);
|
||||
void issue1410v2MenuCallback(ax::Ref* pSender);
|
||||
void backMenuCallback(ax::Ref* pSender);
|
||||
};
|
||||
|
||||
class RemoveMenuItemWhenMove : public axis::Layer
|
||||
class RemoveMenuItemWhenMove : public ax::Layer
|
||||
{
|
||||
public:
|
||||
RemoveMenuItemWhenMove();
|
||||
~RemoveMenuItemWhenMove();
|
||||
bool onTouchBegan(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchMoved(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchBegan(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchMoved(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
void goBack(axis::Ref* pSender);
|
||||
void goBack(ax::Ref* pSender);
|
||||
|
||||
private:
|
||||
axis::MenuItemFont* item;
|
||||
axis::EventListenerTouchOneByOne* _touchListener;
|
||||
ax::MenuItemFont* item;
|
||||
ax::EventListenerTouchOneByOne* _touchListener;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -126,7 +126,7 @@ void DrawNode3D::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
|
|||
}
|
||||
}
|
||||
|
||||
void DrawNode3D::updateCommand(axis::Renderer* renderer, const Mat4& transform, uint32_t flags)
|
||||
void DrawNode3D::updateCommand(ax::Renderer* renderer, const Mat4& transform, uint32_t flags)
|
||||
{
|
||||
auto& matrixP = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
auto mvp = matrixP * transform;
|
||||
|
|
|
@ -33,16 +33,16 @@ NS_AX_BEGIN
|
|||
/**
|
||||
* Copy DrawNode for 3D geometry drawing.
|
||||
*/
|
||||
class DrawNode3D : public axis::Node
|
||||
class DrawNode3D : public ax::Node
|
||||
{
|
||||
public:
|
||||
/** creates and initialize a DrawNode3D node */
|
||||
static axis::DrawNode3D* create();
|
||||
static ax::DrawNode3D* create();
|
||||
|
||||
/**
|
||||
* Draw 3D Line
|
||||
*/
|
||||
void drawLine(const axis::Vec3& from, const axis::Vec3& to, const Color4F& color);
|
||||
void drawLine(const ax::Vec3& from, const ax::Vec3& to, const Color4F& color);
|
||||
|
||||
/**
|
||||
* Draw 3D cube
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
* vertices[7]:Left-top-back.
|
||||
* @param color
|
||||
*/
|
||||
void drawCube(axis::Vec3* vertices, const Color4F& color);
|
||||
void drawCube(ax::Vec3* vertices, const Color4F& color);
|
||||
|
||||
/** Clear the geometry in the node's buffer. */
|
||||
void clear();
|
||||
|
@ -77,10 +77,10 @@ public:
|
|||
*/
|
||||
void setBlendFunc(const BlendFunc& blendFunc);
|
||||
|
||||
void updateCommand(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags);
|
||||
void updateCommand(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags);
|
||||
|
||||
// Overrides
|
||||
virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override;
|
||||
virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override;
|
||||
|
||||
DrawNode3D();
|
||||
virtual ~DrawNode3D();
|
||||
|
@ -93,7 +93,7 @@ protected:
|
|||
void ensureCapacity(int count);
|
||||
|
||||
BlendFunc _blendFunc;
|
||||
axis::CustomCommand _customCommand;
|
||||
ax::CustomCommand _customCommand;
|
||||
backend::ProgramState* _programStateLine = nullptr;
|
||||
backend::DepthStencilDescriptor* _depthstencilDescriptor = nullptr;
|
||||
backend::UniformLocation _locMVPMatrix;
|
||||
|
|
|
@ -95,7 +95,7 @@ MeshRendererTestDemo::~MeshRendererTestDemo()
|
|||
//------------------------------------------------------------------
|
||||
MeshRendererForceDepthTest::MeshRendererForceDepthTest()
|
||||
{
|
||||
auto orc = axis::MeshRenderer::create("MeshRendererTest/orc.c3b");
|
||||
auto orc = ax::MeshRenderer::create("MeshRendererTest/orc.c3b");
|
||||
orc->setScale(5);
|
||||
orc->setPositionNormalized(Vec2(.5f, .3f));
|
||||
orc->setPositionZ(40);
|
||||
|
@ -180,7 +180,7 @@ void MeshRendererBasicTest::addNewMeshWithCoords(Vec2 p)
|
|||
mesh->setTexture("MeshRendererTest/boss.png");
|
||||
|
||||
//
|
||||
// mesh->setEffect(axis::EFFECT_OUTLINE);
|
||||
// mesh->setEffect(ax::EFFECT_OUTLINE);
|
||||
|
||||
// add to scene
|
||||
addChild(mesh);
|
||||
|
@ -398,7 +398,7 @@ std::string MeshRendererFakeShadowTest::subtitle() const
|
|||
return "touch the screen to move around";
|
||||
}
|
||||
|
||||
void MeshRendererFakeShadowTest::Move(axis::Ref* sender, int value)
|
||||
void MeshRendererFakeShadowTest::Move(ax::Ref* sender, int value)
|
||||
{
|
||||
_orc->setPositionX(_orc->getPositionX() + value);
|
||||
}
|
||||
|
@ -498,11 +498,11 @@ bool MeshRendererFakeShadowTest::isState(unsigned int state, unsigned int bit) c
|
|||
return (state & bit) == bit;
|
||||
}
|
||||
|
||||
void MeshRendererFakeShadowTest::onTouchesBegan(const std::vector<Touch*>& touches, axis::Event* event) {}
|
||||
void MeshRendererFakeShadowTest::onTouchesBegan(const std::vector<Touch*>& touches, ax::Event* event) {}
|
||||
|
||||
void MeshRendererFakeShadowTest::onTouchesMoved(const std::vector<Touch*>& touches, axis::Event* event) {}
|
||||
void MeshRendererFakeShadowTest::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event* event) {}
|
||||
|
||||
void MeshRendererFakeShadowTest::onTouchesEnded(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void MeshRendererFakeShadowTest::onTouchesEnded(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
for (auto&&item : touches)
|
||||
{
|
||||
|
@ -634,7 +634,7 @@ std::string MeshRendererLightMapTest::subtitle() const
|
|||
return "drag the screen to move around";
|
||||
}
|
||||
|
||||
void MeshRendererLightMapTest::onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void MeshRendererLightMapTest::onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (touches.size() == 1)
|
||||
{
|
||||
|
@ -2125,7 +2125,7 @@ void MeshRendererCubeMapTest::addNewMeshWithCoords(Vec2 p)
|
|||
#endif
|
||||
}
|
||||
|
||||
void MeshRendererCubeMapTest::onTouchesMoved(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void MeshRendererCubeMapTest::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (touches.size())
|
||||
{
|
||||
|
@ -2165,7 +2165,7 @@ Issue9767::Issue9767()
|
|||
|
||||
Issue9767::~Issue9767() {}
|
||||
|
||||
void Issue9767::menuCallback_SwitchShader(axis::Ref* sender)
|
||||
void Issue9767::menuCallback_SwitchShader(ax::Ref* sender)
|
||||
{
|
||||
AX_SAFE_RELEASE_NULL(_programState);
|
||||
if (_shaderType == Issue9767::ShaderType::SHADER_TEX)
|
||||
|
@ -2271,7 +2271,7 @@ Animate3DCallbackTest::Animate3DCallbackTest()
|
|||
((PUParticleSystem3D*)node)->startParticleSystem();
|
||||
}
|
||||
|
||||
axis::log("frame %d", info->frame);
|
||||
ax::log("frame %d", info->frame);
|
||||
});
|
||||
Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(listener, -1);
|
||||
}
|
||||
|
@ -2365,7 +2365,7 @@ CameraBackgroundClearTest::CameraBackgroundClearTest()
|
|||
_label->setPosition(s.width / 2.f, VisibleRect::top().y * 0.8f);
|
||||
}
|
||||
|
||||
void CameraBackgroundClearTest::switch_CameraClearMode(axis::Ref* sender)
|
||||
void CameraBackgroundClearTest::switch_CameraClearMode(ax::Ref* sender)
|
||||
{
|
||||
auto brush = _camera->getBackgroundBrush();
|
||||
CameraBackgroundBrush::BrushType type = CameraBackgroundBrush::BrushType::NONE;
|
||||
|
@ -2585,7 +2585,7 @@ std::string MeshRendererPropertyTest::subtitle() const
|
|||
}
|
||||
|
||||
void MeshRendererPropertyTest::update(float delta) {}
|
||||
void MeshRendererPropertyTest::printMeshName(axis::Ref* sender)
|
||||
void MeshRendererPropertyTest::printMeshName(ax::Ref* sender)
|
||||
{
|
||||
AXLOG("MeshName Begin");
|
||||
Vector<Mesh*> meshes = _mesh->getMeshes();
|
||||
|
@ -2595,7 +2595,7 @@ void MeshRendererPropertyTest::printMeshName(axis::Ref* sender)
|
|||
}
|
||||
AXLOG("MeshName End");
|
||||
}
|
||||
void MeshRendererPropertyTest::removeUsedTexture(axis::Ref* sender)
|
||||
void MeshRendererPropertyTest::removeUsedTexture(ax::Ref* sender)
|
||||
{
|
||||
if (_meshTex != nullptr)
|
||||
{
|
||||
|
@ -2604,7 +2604,7 @@ void MeshRendererPropertyTest::removeUsedTexture(axis::Ref* sender)
|
|||
}
|
||||
}
|
||||
|
||||
void MeshRendererPropertyTest::resetTexture(axis::Ref* sender)
|
||||
void MeshRendererPropertyTest::resetTexture(ax::Ref* sender)
|
||||
{
|
||||
if (_meshTex != nullptr)
|
||||
{
|
||||
|
@ -2628,7 +2628,7 @@ void MeshRendererPropertyTest::refreshMeshRender()
|
|||
cacheTex = Director::getInstance()->getTextureCache()->addImage(image, "/dummyTexture");
|
||||
image->release();
|
||||
}
|
||||
mesh->setTexture(cacheTex, axis::NTextureData::Usage::Diffuse, false);
|
||||
mesh->setTexture(cacheTex, ax::NTextureData::Usage::Diffuse, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2645,7 +2645,7 @@ Issue16155Test::Issue16155Test()
|
|||
addChild(mesh);
|
||||
removeChild(mesh);
|
||||
|
||||
axis::log("Issue 16155: Ref count:%d. Run this test again. RC should be the same", rcBefore);
|
||||
ax::log("Issue 16155: Ref count:%d. Run this test again. RC should be the same", rcBefore);
|
||||
}
|
||||
|
||||
std::string Issue16155Test::title() const
|
||||
|
|
|
@ -75,8 +75,8 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
};
|
||||
|
||||
class MeshRendererUVAnimationTest : public MeshRendererTestDemo
|
||||
|
@ -93,10 +93,10 @@ protected:
|
|||
|
||||
float _cylinder_texture_offset;
|
||||
float _shining_duration;
|
||||
axis::backend::ProgramState* _state = nullptr;
|
||||
ax::backend::ProgramState* _state = nullptr;
|
||||
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
||||
axis::EventListenerCustom* _backToForegroundListener;
|
||||
ax::EventListenerCustom* _backToForegroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -115,25 +115,25 @@ public:
|
|||
virtual ~MeshRendererFakeShadowTest();
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void Move(axis::Ref* sender, int value);
|
||||
void Move(ax::Ref* sender, int value);
|
||||
void updateCamera(float fDelta);
|
||||
void move3D(float elapsedTime);
|
||||
void updateState(float elapsedTime);
|
||||
bool isState(unsigned int state, unsigned int bit) const;
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
private:
|
||||
axis::Camera* _camera;
|
||||
axis::Vec3 _targetPos;
|
||||
ax::Camera* _camera;
|
||||
ax::Vec3 _targetPos;
|
||||
unsigned int _curState;
|
||||
axis::MeshRenderer* _plane;
|
||||
axis::MeshRenderer* _orc;
|
||||
axis::backend::ProgramState* _state = nullptr;
|
||||
ax::MeshRenderer* _plane;
|
||||
ax::MeshRenderer* _orc;
|
||||
ax::backend::ProgramState* _state = nullptr;
|
||||
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
||||
axis::EventListenerCustom* _backToForegroundListener;
|
||||
ax::EventListenerCustom* _backToForegroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -145,10 +145,10 @@ public:
|
|||
virtual ~MeshRendererLightMapTest();
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
private:
|
||||
axis::Camera* _camera;
|
||||
ax::Camera* _camera;
|
||||
};
|
||||
|
||||
class MeshRendererBasicToonShaderTest : public MeshRendererTestDemo
|
||||
|
@ -161,10 +161,10 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
protected:
|
||||
axis::backend::ProgramState* _state;
|
||||
ax::backend::ProgramState* _state;
|
||||
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
||||
axis::EventListenerCustom* _backToForegroundListener;
|
||||
ax::EventListenerCustom* _backToForegroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -186,15 +186,15 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
std::vector<axis::MeshRenderer*> _meshes;
|
||||
std::vector<ax::MeshRenderer*> _meshes;
|
||||
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
||||
axis::EventListenerCustom* _backToForegroundListener;
|
||||
ax::EventListenerCustom* _backToForegroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -207,9 +207,9 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void menuCallback_asyncLoadMesh(axis::Ref* sender);
|
||||
void menuCallback_asyncLoadMesh(ax::Ref* sender);
|
||||
|
||||
void asyncLoad_Callback(axis::MeshRenderer* mesh, void* param);
|
||||
void asyncLoad_Callback(ax::MeshRenderer* mesh, void* param);
|
||||
|
||||
protected:
|
||||
std::vector<std::string> _paths; // model paths to be loaded
|
||||
|
@ -223,17 +223,17 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
|
||||
void switchAnimationQualityCallback(axis::Ref* sender);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void switchAnimationQualityCallback(ax::Ref* sender);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
std::string getAnimationQualityMessage() const;
|
||||
|
||||
private:
|
||||
std::vector<axis::MeshRenderer*> _meshes;
|
||||
std::vector<ax::MeshRenderer*> _meshes;
|
||||
int _animateQuality;
|
||||
axis::MenuItemFont* _menuItem;
|
||||
ax::MenuItemFont* _menuItem;
|
||||
};
|
||||
|
||||
class MeshRendererWithSkinOutlineTest : public MeshRendererTestDemo
|
||||
|
@ -245,15 +245,15 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
std::vector<axis::MeshRenderer*> _meshes;
|
||||
std::vector<ax::MeshRenderer*> _meshes;
|
||||
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
||||
axis::EventListenerCustom* _backToForegroundListener;
|
||||
ax::EventListenerCustom* _backToForegroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -266,7 +266,7 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
virtual void update(float dt) override;
|
||||
|
||||
|
@ -285,16 +285,16 @@ protected:
|
|||
|
||||
void renewCallBack();
|
||||
|
||||
axis::MeshRenderer* _mesh;
|
||||
ax::MeshRenderer* _mesh;
|
||||
|
||||
axis::Action* _swim;
|
||||
axis::Animate3D* _hurt;
|
||||
ax::Action* _swim;
|
||||
ax::Animate3D* _hurt;
|
||||
|
||||
float _elapseTransTime;
|
||||
|
||||
State _state;
|
||||
|
||||
axis::MoveTo* _moveAction;
|
||||
ax::MoveTo* _moveAction;
|
||||
};
|
||||
|
||||
class AttachmentTest : public MeshRendererTestDemo
|
||||
|
@ -305,13 +305,13 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
|
||||
protected:
|
||||
bool _hasWeapon;
|
||||
axis::MeshRenderer* _mesh;
|
||||
ax::MeshRenderer* _mesh;
|
||||
};
|
||||
|
||||
class MeshRendererReskinTest : public MeshRendererTestDemo
|
||||
|
@ -321,10 +321,10 @@ public:
|
|||
MeshRendererReskinTest();
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
|
||||
void menuCallback_reSkin(axis::Ref* sender);
|
||||
void menuCallback_reSkin(ax::Ref* sender);
|
||||
|
||||
protected:
|
||||
void applyCurSkin();
|
||||
|
@ -343,7 +343,7 @@ protected:
|
|||
|
||||
std::vector<std::string> _skins[(int)SkinType::MAX_TYPE]; // all skins
|
||||
int _curSkin[(int)SkinType::MAX_TYPE]; // current skin index
|
||||
axis::MeshRenderer* _mesh;
|
||||
ax::MeshRenderer* _mesh;
|
||||
};
|
||||
|
||||
class MeshRendererWithOBBPerformanceTest : public MeshRendererTestDemo
|
||||
|
@ -354,35 +354,35 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void update(float dt) override;
|
||||
void addNewOBBWithCoords(axis::Vec2 p);
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void addOBBCallback(axis::Ref* sender);
|
||||
void delOBBCallback(axis::Ref* sender);
|
||||
void addNewOBBWithCoords(ax::Vec2 p);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void addOBBCallback(ax::Ref* sender);
|
||||
void delOBBCallback(ax::Ref* sender);
|
||||
void addOBBWithCount(float value);
|
||||
void delOBBWithCount(float value);
|
||||
|
||||
protected:
|
||||
axis::MeshRenderer* _mesh;
|
||||
std::vector<axis::OBB> _obb;
|
||||
axis::DrawNode3D* _drawOBB;
|
||||
axis::Label* _labelCubeCount;
|
||||
axis::MoveTo* _moveAction;
|
||||
axis::OBB _obbt;
|
||||
axis::OBB _obbtOri; // tortoise origin obb
|
||||
axis::DrawNode3D* _drawDebug;
|
||||
ax::MeshRenderer* _mesh;
|
||||
std::vector<ax::OBB> _obb;
|
||||
ax::DrawNode3D* _drawOBB;
|
||||
ax::Label* _labelCubeCount;
|
||||
ax::MoveTo* _moveAction;
|
||||
ax::OBB _obbt;
|
||||
ax::OBB _obbtOri; // tortoise origin obb
|
||||
ax::DrawNode3D* _drawDebug;
|
||||
bool _hasCollider;
|
||||
std::set<int> _intersetList;
|
||||
void initDrawBox();
|
||||
void reachEndCallBack();
|
||||
|
||||
void unproject(const axis::Mat4& viewProjection,
|
||||
const axis::Size* viewport,
|
||||
axis::Vec3* src,
|
||||
axis::Vec3* dst);
|
||||
void calculateRayByLocationInView(axis::Ray* ray, const axis::Vec2& location);
|
||||
void unproject(const ax::Mat4& viewProjection,
|
||||
const ax::Size* viewport,
|
||||
ax::Vec3* src,
|
||||
ax::Vec3* dst);
|
||||
void calculateRayByLocationInView(ax::Ray* ray, const ax::Vec2& location);
|
||||
};
|
||||
|
||||
class MeshRendererMirrorTest : public MeshRendererTestDemo
|
||||
|
@ -393,12 +393,12 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
|
||||
protected:
|
||||
bool _hasWeapon;
|
||||
axis::MeshRenderer* _mesh;
|
||||
axis::MeshRenderer* _mirrorMesh;
|
||||
ax::MeshRenderer* _mesh;
|
||||
ax::MeshRenderer* _mirrorMesh;
|
||||
};
|
||||
|
||||
class QuaternionTest : public MeshRendererTestDemo
|
||||
|
@ -409,11 +409,11 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
virtual void update(float delta) override;
|
||||
|
||||
protected:
|
||||
axis::MeshRenderer* _mesh;
|
||||
ax::MeshRenderer* _mesh;
|
||||
float _arcSpeed;
|
||||
float _radius;
|
||||
float _accAngle;
|
||||
|
@ -430,7 +430,7 @@ public:
|
|||
|
||||
virtual void update(float delta) override;
|
||||
|
||||
void menuCallback_Message(axis::Ref* sender);
|
||||
void menuCallback_Message(ax::Ref* sender);
|
||||
|
||||
protected:
|
||||
void switchCase();
|
||||
|
@ -441,7 +441,7 @@ protected:
|
|||
_UI_3D_UI,
|
||||
MAX_CASE_NUM,
|
||||
};
|
||||
axis::Label* _label;
|
||||
ax::Label* _label;
|
||||
int _caseIdx; // use case index
|
||||
std::string _useCaseTitles[(int)USECASE::MAX_CASE_NUM];
|
||||
};
|
||||
|
@ -455,10 +455,10 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void addNewMeshWithCoords(axis::Vec2 p);
|
||||
void addNewMeshWithCoords(ax::Vec2 p);
|
||||
|
||||
protected:
|
||||
std::vector<axis::MeshRenderer*> _meshes;
|
||||
std::vector<ax::MeshRenderer*> _meshes;
|
||||
int _vectorIndex;
|
||||
};
|
||||
|
||||
|
@ -476,18 +476,18 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void addNewMeshWithCoords(axis::Vec2);
|
||||
void addNewMeshWithCoords(ax::Vec2);
|
||||
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
axis::TextureCube* _textureCube;
|
||||
axis::Skybox* _skyBox;
|
||||
axis::MeshRenderer* _teapot;
|
||||
axis::Camera* _camera;
|
||||
ax::TextureCube* _textureCube;
|
||||
ax::Skybox* _skyBox;
|
||||
ax::MeshRenderer* _teapot;
|
||||
ax::Camera* _camera;
|
||||
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
||||
axis::EventListenerCustom* _backToForegroundListener;
|
||||
ax::EventListenerCustom* _backToForegroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -507,11 +507,11 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void menuCallback_SwitchShader(axis::Ref* sender);
|
||||
void menuCallback_SwitchShader(ax::Ref* sender);
|
||||
|
||||
protected:
|
||||
ShaderType _shaderType;
|
||||
axis::MeshRenderer* _mesh;
|
||||
ax::MeshRenderer* _mesh;
|
||||
};
|
||||
|
||||
/// Clipping MeshRenderer
|
||||
|
@ -535,7 +535,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
protected:
|
||||
axis::MeshRenderer* _meshRenderer;
|
||||
ax::MeshRenderer* _meshRenderer;
|
||||
};
|
||||
|
||||
class CameraBackgroundClearTest : public MeshRendererTestDemo
|
||||
|
@ -546,11 +546,11 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void switch_CameraClearMode(axis::Ref* sender);
|
||||
void switch_CameraClearMode(ax::Ref* sender);
|
||||
|
||||
protected:
|
||||
axis::Camera* _camera;
|
||||
axis::Label* _label;
|
||||
ax::Camera* _camera;
|
||||
ax::Label* _label;
|
||||
};
|
||||
|
||||
class MeshRendererVertexColorTest : public MeshRendererTestDemo
|
||||
|
@ -564,9 +564,9 @@ public:
|
|||
virtual ~MeshRendererVertexColorTest();
|
||||
|
||||
protected:
|
||||
axis::MeshRenderer* _mesh;
|
||||
ax::MeshRenderer* _mesh;
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
||||
axis::EventListenerCustom* _backToForegroundListener;
|
||||
ax::EventListenerCustom* _backToForegroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -580,8 +580,8 @@ public:
|
|||
virtual void update(float delta) override;
|
||||
|
||||
protected:
|
||||
axis::MeshRenderer* _mesh;
|
||||
axis::MotionStreak3D* _streak;
|
||||
ax::MeshRenderer* _mesh;
|
||||
ax::MotionStreak3D* _streak;
|
||||
};
|
||||
|
||||
class MeshRendererNormalMappingTest : public MeshRendererTestDemo
|
||||
|
@ -605,15 +605,15 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
virtual void update(float delta) override;
|
||||
|
||||
void printMeshName(axis::Ref* sender);
|
||||
void removeUsedTexture(axis::Ref* sender);
|
||||
void resetTexture(axis::Ref* sender);
|
||||
void printMeshName(ax::Ref* sender);
|
||||
void removeUsedTexture(ax::Ref* sender);
|
||||
void resetTexture(ax::Ref* sender);
|
||||
|
||||
void refreshMeshRender();
|
||||
|
||||
protected:
|
||||
axis::MeshRenderer* _mesh;
|
||||
axis::Texture2D* _meshTex;
|
||||
ax::MeshRenderer* _mesh;
|
||||
ax::Texture2D* _meshTex;
|
||||
std::string _texFile;
|
||||
};
|
||||
|
||||
|
|
|
@ -39,17 +39,17 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
virtual void onEnter() override;
|
||||
|
||||
void modeCallback(axis::Ref* sender);
|
||||
void modeCallback(ax::Ref* sender);
|
||||
|
||||
protected:
|
||||
axis::MotionStreak* _streak;
|
||||
ax::MotionStreak* _streak;
|
||||
};
|
||||
|
||||
class MotionStreakTest1 : public MotionStreakTest
|
||||
{
|
||||
protected:
|
||||
axis::Node* _root;
|
||||
axis::Node* _target;
|
||||
ax::Node* _root;
|
||||
ax::Node* _target;
|
||||
|
||||
public:
|
||||
CREATE_FUNC(MotionStreakTest1);
|
||||
|
@ -61,13 +61,13 @@ public:
|
|||
class MotionStreakTest2 : public MotionStreakTest
|
||||
{
|
||||
protected:
|
||||
axis::Node* _root;
|
||||
axis::Node* _target;
|
||||
ax::Node* _root;
|
||||
ax::Node* _target;
|
||||
|
||||
public:
|
||||
CREATE_FUNC(MotionStreakTest2);
|
||||
virtual void onEnter() override;
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
};
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
virtual void update(float dt) override;
|
||||
|
||||
private:
|
||||
axis::Vec2 _center;
|
||||
ax::Vec2 _center;
|
||||
float _radius;
|
||||
float _angle;
|
||||
};
|
||||
|
|
|
@ -36,10 +36,10 @@ public:
|
|||
|
||||
virtual bool init() override;
|
||||
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesCancelled(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesCancelled(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
};
|
||||
|
||||
#endif /* __MULTITOUCHTEST_H__ */
|
||||
|
|
|
@ -105,13 +105,13 @@ bool NavMeshBaseTestDemo::init()
|
|||
return true;
|
||||
}
|
||||
|
||||
void NavMeshBaseTestDemo::onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void NavMeshBaseTestDemo::onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
_needMoveAgents = true;
|
||||
touchesBegan(touches, event);
|
||||
}
|
||||
|
||||
void NavMeshBaseTestDemo::onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void NavMeshBaseTestDemo::onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (touches.size() && _camera)
|
||||
{
|
||||
|
@ -130,7 +130,7 @@ void NavMeshBaseTestDemo::onTouchesMoved(const std::vector<axis::Touch*>& touche
|
|||
touchesMoved(touches, event);
|
||||
}
|
||||
|
||||
void NavMeshBaseTestDemo::onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void NavMeshBaseTestDemo::onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
touchesEnded(touches, event);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ Vec3 jump(const Vec3* pV1, const Vec3* pV2, float height, float t)
|
|||
return pOut;
|
||||
}
|
||||
|
||||
void NavMeshBaseTestDemo::moveAgents(const axis::Vec3& des)
|
||||
void NavMeshBaseTestDemo::moveAgents(const ax::Vec3& des)
|
||||
{
|
||||
for (auto&& iter : _agents)
|
||||
{
|
||||
|
@ -279,7 +279,7 @@ std::string NavMeshBasicTestDemo::subtitle() const
|
|||
return "Basic Test";
|
||||
}
|
||||
|
||||
void NavMeshBasicTestDemo::touchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void NavMeshBasicTestDemo::touchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (!_needMoveAgents)
|
||||
return;
|
||||
|
@ -355,8 +355,8 @@ bool NavMeshAdvanceTestDemo::init()
|
|||
_debugLabel->retain();
|
||||
|
||||
auto menuItem0 = MenuItemLabel::create(_obstacleLabel, [=](Ref*) {
|
||||
float x = axis::random(-50.0f, 50.0f);
|
||||
float z = axis::random(-50.0f, 50.0f);
|
||||
float x = ax::random(-50.0f, 50.0f);
|
||||
float z = ax::random(-50.0f, 50.0f);
|
||||
Physics3DWorld::HitResult result;
|
||||
getPhysics3DWorld()->rayCast(Vec3(x, 50.0f, z), Vec3(x, -50.0f, z), &result);
|
||||
createObstacle(result.hitPosition);
|
||||
|
@ -365,8 +365,8 @@ bool NavMeshAdvanceTestDemo::init()
|
|||
menuItem0->setPosition(Vec2(VisibleRect::left().x, VisibleRect::top().y - 50));
|
||||
|
||||
auto menuItem1 = MenuItemLabel::create(_agentLabel, [=](Ref*) {
|
||||
float x = axis::random(-50.0f, 50.0f);
|
||||
float z = axis::random(-50.0f, 50.0f);
|
||||
float x = ax::random(-50.0f, 50.0f);
|
||||
float z = ax::random(-50.0f, 50.0f);
|
||||
Physics3DWorld::HitResult result;
|
||||
getPhysics3DWorld()->rayCast(Vec3(x, 50.0f, z), Vec3(x, -50.0f, z), &result);
|
||||
createAgent(result.hitPosition);
|
||||
|
@ -415,7 +415,7 @@ std::string NavMeshAdvanceTestDemo::subtitle() const
|
|||
return "Advance Test";
|
||||
}
|
||||
|
||||
void NavMeshAdvanceTestDemo::touchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void NavMeshAdvanceTestDemo::touchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (!_needMoveAgents)
|
||||
return;
|
||||
|
|
|
@ -52,23 +52,23 @@ public:
|
|||
// overrides
|
||||
virtual bool init() override;
|
||||
virtual void update(float delta) override;
|
||||
virtual void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
virtual void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
virtual void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
virtual void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
void initScene();
|
||||
void createAgent(const axis::Vec3& pos);
|
||||
void createObstacle(const axis::Vec3& pos);
|
||||
void moveAgents(const axis::Vec3& des);
|
||||
virtual void touchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event){};
|
||||
virtual void touchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event){};
|
||||
virtual void touchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event){};
|
||||
void createAgent(const ax::Vec3& pos);
|
||||
void createObstacle(const ax::Vec3& pos);
|
||||
void moveAgents(const ax::Vec3& des);
|
||||
virtual void touchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event){};
|
||||
virtual void touchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event){};
|
||||
virtual void touchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event){};
|
||||
|
||||
protected:
|
||||
axis::Camera* _camera;
|
||||
ax::Camera* _camera;
|
||||
float _angle;
|
||||
std::vector<std::pair<axis::NavMeshAgent*, axis::Animate3D*>> _agents;
|
||||
std::vector<std::pair<ax::NavMeshAgent*, ax::Animate3D*>> _agents;
|
||||
bool _needMoveAgents;
|
||||
};
|
||||
|
||||
|
@ -87,12 +87,12 @@ public:
|
|||
virtual void onEnter() override;
|
||||
|
||||
protected:
|
||||
virtual void touchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event) override{};
|
||||
virtual void touchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event) override{};
|
||||
virtual void touchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event) override;
|
||||
virtual void touchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event) override{};
|
||||
virtual void touchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event) override{};
|
||||
virtual void touchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event) override;
|
||||
|
||||
protected:
|
||||
axis::Label* _debugLabel;
|
||||
ax::Label* _debugLabel;
|
||||
};
|
||||
|
||||
class NavMeshAdvanceTestDemo : public NavMeshBaseTestDemo
|
||||
|
@ -110,14 +110,14 @@ public:
|
|||
virtual void onEnter() override;
|
||||
|
||||
protected:
|
||||
virtual void touchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event) override{};
|
||||
virtual void touchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event) override{};
|
||||
virtual void touchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event) override;
|
||||
virtual void touchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event) override{};
|
||||
virtual void touchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event) override{};
|
||||
virtual void touchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event) override;
|
||||
|
||||
protected:
|
||||
axis::Label* _obstacleLabel;
|
||||
axis::Label* _agentLabel;
|
||||
axis::Label* _debugLabel;
|
||||
ax::Label* _obstacleLabel;
|
||||
ax::Label* _agentLabel;
|
||||
ax::Label* _debugLabel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -66,7 +66,7 @@ struct DownloaderTest : public TestCase
|
|||
TAG_SPRITE,
|
||||
};
|
||||
|
||||
Node* createDownloadView(const char* name, const axis::ui::Button::ccWidgetClickCallback& callback)
|
||||
Node* createDownloadView(const char* name, const ax::ui::Button::ccWidgetClickCallback& callback)
|
||||
{
|
||||
Size viewSize(220, 120);
|
||||
float margin = 5;
|
||||
|
@ -217,7 +217,7 @@ struct DownloaderTest : public TestCase
|
|||
};
|
||||
|
||||
// define success callback
|
||||
downloader->onDataTaskSuccess = [this](const axis::network::DownloadTask& task,
|
||||
downloader->onDataTaskSuccess = [this](const ax::network::DownloadTask& task,
|
||||
std::vector<unsigned char>& data) {
|
||||
// create texture from data
|
||||
Texture2D* texture = nullptr;
|
||||
|
@ -252,7 +252,7 @@ struct DownloaderTest : public TestCase
|
|||
AX_SAFE_RELEASE(texture);
|
||||
};
|
||||
|
||||
downloader->onFileTaskSuccess = [this](const axis::network::DownloadTask& task) {
|
||||
downloader->onFileTaskSuccess = [this](const ax::network::DownloadTask& task) {
|
||||
Texture2D* texture = nullptr;
|
||||
do
|
||||
{
|
||||
|
@ -286,7 +286,7 @@ struct DownloaderTest : public TestCase
|
|||
};
|
||||
|
||||
// define failed callback
|
||||
downloader->onTaskError = [this](const axis::network::DownloadTask& task, int errorCode,
|
||||
downloader->onTaskError = [this](const ax::network::DownloadTask& task, int errorCode,
|
||||
int errorCodeInternal, std::string_view errorStr) {
|
||||
log("Failed to download : %s, identifier(%s) error code(%d), internal error code(%d) desc(%s)",
|
||||
task.requestURL.c_str(), task.identifier.c_str(), errorCode, errorCodeInternal, errorStr.data());
|
||||
|
|
|
@ -102,7 +102,7 @@ HttpClientTest::~HttpClientTest()
|
|||
HttpClient::destroyInstance();
|
||||
}
|
||||
|
||||
void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender)
|
||||
void HttpClientTest::onMenuGetTestClicked(ax::Ref* sender)
|
||||
{
|
||||
// test 1(sync request test)
|
||||
{
|
||||
|
@ -175,7 +175,7 @@ void HttpClientTest::onMenuGetTestClicked(axis::Ref* sender)
|
|||
_labelStatusCode->setString("waiting...");
|
||||
}
|
||||
|
||||
void HttpClientTest::onMenuPostTestClicked(axis::Ref* sender)
|
||||
void HttpClientTest::onMenuPostTestClicked(ax::Ref* sender)
|
||||
{
|
||||
// test 1
|
||||
{
|
||||
|
@ -213,7 +213,7 @@ void HttpClientTest::onMenuPostTestClicked(axis::Ref* sender)
|
|||
_labelStatusCode->setString("waiting...");
|
||||
}
|
||||
|
||||
void HttpClientTest::onMenuPostBinaryTestClicked(axis::Ref* sender)
|
||||
void HttpClientTest::onMenuPostBinaryTestClicked(ax::Ref* sender)
|
||||
{
|
||||
HttpRequest* request = new HttpRequest();
|
||||
request->setUrl("https://httpbin.org/post");
|
||||
|
@ -381,7 +381,7 @@ HttpClientClearRequestsTest::~HttpClientClearRequestsTest()
|
|||
HttpClient::destroyInstance();
|
||||
}
|
||||
|
||||
void HttpClientClearRequestsTest::onMenuCancelAllClicked(axis::Ref* sender)
|
||||
void HttpClientClearRequestsTest::onMenuCancelAllClicked(ax::Ref* sender)
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
|
@ -409,7 +409,7 @@ void HttpClientClearRequestsTest::onMenuCancelAllClicked(axis::Ref* sender)
|
|||
_labelStatusCode->setString("waiting...");
|
||||
}
|
||||
|
||||
void HttpClientClearRequestsTest::onMenuCancelSomeClicked(axis::Ref* sender)
|
||||
void HttpClientClearRequestsTest::onMenuCancelSomeClicked(ax::Ref* sender)
|
||||
{
|
||||
// test 1
|
||||
for (int i = 0; i < 10; i++)
|
||||
|
|
|
@ -41,19 +41,19 @@ public:
|
|||
virtual ~HttpClientTest();
|
||||
|
||||
// Menu Callbacks
|
||||
void onMenuGetTestClicked(axis::Ref* sender);
|
||||
void onMenuPostTestClicked(axis::Ref* sender);
|
||||
void onMenuPostBinaryTestClicked(axis::Ref* sender);
|
||||
void onMenuPutTestClicked(axis::Ref* sender);
|
||||
void onMenuDeleteTestClicked(axis::Ref* sender);
|
||||
void onMenuGetTestClicked(ax::Ref* sender);
|
||||
void onMenuPostTestClicked(ax::Ref* sender);
|
||||
void onMenuPostBinaryTestClicked(ax::Ref* sender);
|
||||
void onMenuPutTestClicked(ax::Ref* sender);
|
||||
void onMenuDeleteTestClicked(ax::Ref* sender);
|
||||
|
||||
// Http Response Callback
|
||||
void onHttpRequestCompleted(axis::network::HttpClient* sender, axis::network::HttpResponse* response);
|
||||
void onHttpRequestCompleted(ax::network::HttpClient* sender, ax::network::HttpResponse* response);
|
||||
|
||||
virtual std::string title() const override { return "Http Request Test"; }
|
||||
|
||||
private:
|
||||
axis::Label* _labelStatusCode;
|
||||
ax::Label* _labelStatusCode;
|
||||
};
|
||||
|
||||
class HttpClientClearRequestsTest : public TestCase
|
||||
|
@ -65,19 +65,19 @@ public:
|
|||
virtual ~HttpClientClearRequestsTest();
|
||||
|
||||
// Menu Callbacks
|
||||
void onMenuCancelAllClicked(axis::Ref* sender);
|
||||
void onMenuCancelSomeClicked(axis::Ref* sender);
|
||||
void onMenuCancelAllClicked(ax::Ref* sender);
|
||||
void onMenuCancelSomeClicked(ax::Ref* sender);
|
||||
|
||||
// Http Response Callback
|
||||
void onHttpRequestCompleted(axis::network::HttpClient* sender, axis::network::HttpResponse* response);
|
||||
void onHttpRequestCompleted(ax::network::HttpClient* sender, ax::network::HttpResponse* response);
|
||||
|
||||
virtual std::string title() const override { return "Http Request Test"; }
|
||||
|
||||
private:
|
||||
int _totalExpectedRequests;
|
||||
int _totalProcessedRequests;
|
||||
axis::Label* _labelTrakingData;
|
||||
axis::Label* _labelStatusCode;
|
||||
ax::Label* _labelTrakingData;
|
||||
ax::Label* _labelStatusCode;
|
||||
};
|
||||
|
||||
#endif //__HTTPREQUESTHTTP_H
|
||||
|
|
|
@ -62,7 +62,7 @@ AudioEngineTests::AudioEngineTests()
|
|||
namespace
|
||||
{
|
||||
|
||||
class TextButton : public axis::Label
|
||||
class TextButton : public ax::Label
|
||||
{
|
||||
public:
|
||||
static TextButton* create(std::string_view text, const std::function<void(TextButton*)>& onTriggered)
|
||||
|
@ -213,7 +213,7 @@ std::string AudioEngineTestDemo::title() const
|
|||
return "New Audio Engine Test";
|
||||
}
|
||||
|
||||
void AudioEngineTestDemo::onBackCallback(axis::Ref* sender)
|
||||
void AudioEngineTestDemo::onBackCallback(ax::Ref* sender)
|
||||
{
|
||||
AudioEngine::end();
|
||||
TestCase::onBackCallback(sender);
|
||||
|
@ -897,7 +897,7 @@ bool AudioPerformanceTest::init()
|
|||
unschedule("test");
|
||||
schedule(
|
||||
[audioFiles](float dt) {
|
||||
int index = axis::random(0, (int)(audioFiles.size() - 1));
|
||||
int index = ax::random(0, (int)(audioFiles.size() - 1));
|
||||
AX_PROFILER_START("play2d");
|
||||
AudioEngine::play2d(audioFiles[index]);
|
||||
AX_PROFILER_STOP("play2d");
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual void onExit() override;
|
||||
|
||||
virtual void onBackCallback(axis::Ref* sender) override;
|
||||
virtual void onBackCallback(ax::Ref* sender) override;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<bool> _isDestroyed;
|
||||
|
@ -74,7 +74,7 @@ private:
|
|||
void* _timeSlider;
|
||||
bool _updateTimeSlider;
|
||||
bool _isStopped;
|
||||
axis::Label* _playOverLabel;
|
||||
ax::Label* _playOverLabel;
|
||||
};
|
||||
|
||||
class AudioWavTest : public AudioEngineTestDemo
|
||||
|
@ -96,7 +96,7 @@ private:
|
|||
int _curIndex = -1;
|
||||
std::vector<std::string> _wavFiles;
|
||||
|
||||
axis::Label* _stateLabel = nullptr;
|
||||
ax::Label* _stateLabel = nullptr;
|
||||
};
|
||||
|
||||
class PlaySimultaneouslyTest : public AudioEngineTestDemo
|
||||
|
@ -135,10 +135,10 @@ public:
|
|||
private:
|
||||
static const int FILE_COUNT = 2;
|
||||
std::string _files[FILE_COUNT];
|
||||
axis::AudioProfile _audioProfile;
|
||||
ax::AudioProfile _audioProfile;
|
||||
|
||||
int _audioCount;
|
||||
axis::Label* _showLabel;
|
||||
ax::Label* _showLabel;
|
||||
float _time;
|
||||
float _minDelay;
|
||||
void* _timeSlider;
|
||||
|
|
|
@ -1707,7 +1707,7 @@ Issue8194::Issue8194()
|
|||
#define tagB 101
|
||||
// dispatch custom event in another custom event, make the custom event "Issue8194" take effect immediately
|
||||
_listener =
|
||||
getEventDispatcher()->addCustomEventListener(Director::EVENT_AFTER_UPDATE, [this](axis::EventCustom* event) {
|
||||
getEventDispatcher()->addCustomEventListener(Director::EVENT_AFTER_UPDATE, [this](ax::EventCustom* event) {
|
||||
if (nodesAdded)
|
||||
{
|
||||
// AXLOG("Fire Issue8194 Event");
|
||||
|
@ -1728,8 +1728,8 @@ Issue8194::Issue8194()
|
|||
auto nodeA = Node::create();
|
||||
addChild(nodeA, 1, tagA);
|
||||
|
||||
axis::EventListenerCustom* listenerA =
|
||||
axis::EventListenerCustom::create("Issue8194", [&](axis::EventCustom* event) {
|
||||
ax::EventListenerCustom* listenerA =
|
||||
ax::EventListenerCustom::create("Issue8194", [&](ax::EventCustom* event) {
|
||||
_subtitleLabel->setString("Bug has been fixed.");
|
||||
event->stopPropagation();
|
||||
});
|
||||
|
@ -1739,8 +1739,8 @@ Issue8194::Issue8194()
|
|||
auto nodeB = Node::create();
|
||||
addChild(nodeB, -1, tagB);
|
||||
|
||||
axis::EventListenerCustom* listenerB =
|
||||
axis::EventListenerCustom::create("Issue8194", [&](axis::EventCustom* event) {
|
||||
ax::EventListenerCustom* listenerB =
|
||||
ax::EventListenerCustom::create("Issue8194", [&](ax::EventCustom* event) {
|
||||
_subtitleLabel->setString("Bug exist yet.");
|
||||
event->stopPropagation();
|
||||
});
|
||||
|
@ -1778,7 +1778,7 @@ Issue9898::Issue9898()
|
|||
auto nodeA = Node::create();
|
||||
addChild(nodeA);
|
||||
|
||||
_listener = axis::EventListenerCustom::create("Issue9898", [&](axis::EventCustom* event) {
|
||||
_listener = ax::EventListenerCustom::create("Issue9898", [&](ax::EventCustom* event) {
|
||||
_eventDispatcher->removeEventListener(_listener);
|
||||
_eventDispatcher->dispatchCustomEvent("Issue9898");
|
||||
});
|
||||
|
|
|
@ -81,8 +81,8 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::EventListenerCustom* _listener;
|
||||
axis::EventListenerCustom* _listener2;
|
||||
ax::EventListenerCustom* _listener;
|
||||
ax::EventListenerCustom* _listener2;
|
||||
};
|
||||
|
||||
class LabelKeyboardEventTest : public EventDispatcherTestDemo
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::Sprite* _sprite;
|
||||
ax::Sprite* _sprite;
|
||||
bool _spriteSaved;
|
||||
};
|
||||
|
||||
|
@ -138,16 +138,16 @@ public:
|
|||
|
||||
virtual void update(float dt) override;
|
||||
|
||||
void onEvent1(axis::EventCustom* event);
|
||||
void onEvent2(axis::EventCustom* event);
|
||||
void onEvent1(ax::EventCustom* event);
|
||||
void onEvent2(ax::EventCustom* event);
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
protected:
|
||||
int _count1, _count2, _count3, _count4;
|
||||
axis::Label *_label1, *_label2, *_label3, *_label4;
|
||||
axis::EventListenerCustom *_event1, *_event2, *_event3, *_event4;
|
||||
ax::Label *_label1, *_label2, *_label3, *_label4;
|
||||
ax::EventListenerCustom *_event1, *_event2, *_event3, *_event4;
|
||||
};
|
||||
|
||||
class GlobalZTouchTest : public EventDispatcherTestDemo
|
||||
|
@ -162,7 +162,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
protected:
|
||||
axis::Sprite* _sprite;
|
||||
ax::Sprite* _sprite;
|
||||
float _accum;
|
||||
};
|
||||
|
||||
|
@ -176,8 +176,8 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
protected:
|
||||
bool isPointInNode(axis::Vec2 pt, axis::Node* node);
|
||||
bool isPointInTopHalfAreaOfScreen(axis::Vec2 pt);
|
||||
bool isPointInNode(ax::Vec2 pt, ax::Node* node);
|
||||
bool isPointInTopHalfAreaOfScreen(ax::Vec2 pt);
|
||||
};
|
||||
|
||||
class PauseResumeTargetTest : public EventDispatcherTestDemo
|
||||
|
@ -204,11 +204,11 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::Sprite* _touchableSprite;
|
||||
axis::MenuItemFont* _itemPauseTouch;
|
||||
axis::MenuItemFont* _itemResumeTouch;
|
||||
axis::MenuItemFont* _itemAddToScene;
|
||||
axis::MenuItemFont* _itemRemoveFromScene;
|
||||
ax::Sprite* _touchableSprite;
|
||||
ax::MenuItemFont* _itemPauseTouch;
|
||||
ax::MenuItemFont* _itemResumeTouch;
|
||||
ax::MenuItemFont* _itemAddToScene;
|
||||
ax::MenuItemFont* _itemRemoveFromScene;
|
||||
};
|
||||
|
||||
class PauseResumeTargetTest3 : public EventDispatcherTestDemo
|
||||
|
@ -222,7 +222,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::Sprite* _touchableSprite;
|
||||
ax::Sprite* _touchableSprite;
|
||||
};
|
||||
|
||||
class Issue4129 : public EventDispatcherTestDemo
|
||||
|
@ -236,7 +236,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::EventListenerCustom* _customlistener;
|
||||
ax::EventListenerCustom* _customlistener;
|
||||
bool _bugFixed;
|
||||
};
|
||||
|
||||
|
@ -295,7 +295,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::EventListenerCustom* _listener;
|
||||
ax::EventListenerCustom* _listener;
|
||||
};
|
||||
|
||||
class Issue9898 : public EventDispatcherTestDemo
|
||||
|
@ -308,7 +308,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::EventListenerCustom* _listener;
|
||||
ax::EventListenerCustom* _listener;
|
||||
};
|
||||
|
||||
#endif /* defined(__samples__NewEventDispatcherTest__) */
|
||||
|
|
|
@ -554,13 +554,13 @@ void SpriteCreation::doTest()
|
|||
spriteCache.clear();
|
||||
}
|
||||
|
||||
void SpriteCreation::addSpritesCallback(axis::Ref*)
|
||||
void SpriteCreation::addSpritesCallback(ax::Ref*)
|
||||
{
|
||||
updateSpriteCountLabel(totalSprites + suggestDelta);
|
||||
doTest();
|
||||
}
|
||||
|
||||
void SpriteCreation::delSpritesCallback(axis::Ref*)
|
||||
void SpriteCreation::delSpritesCallback(ax::Ref*)
|
||||
{
|
||||
updateSpriteCountLabel(totalSprites - suggestDelta);
|
||||
doTest();
|
||||
|
@ -754,7 +754,7 @@ void CaptureNodeTest::onCaptured(Ref*)
|
|||
BugAutoCulling::BugAutoCulling()
|
||||
{
|
||||
Size s = Director::getInstance()->getWinSize();
|
||||
auto fastmap = axis::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx");
|
||||
auto fastmap = ax::FastTMXTiledMap::create("TileMaps/orthogonal-test2.tmx");
|
||||
this->addChild(fastmap);
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
|
@ -856,7 +856,7 @@ RendererUniformBatch::RendererUniformBatch()
|
|||
}
|
||||
}
|
||||
|
||||
axis::backend::ProgramState* RendererUniformBatch::createBlurProgramState()
|
||||
ax::backend::ProgramState* RendererUniformBatch::createBlurProgramState()
|
||||
{
|
||||
auto programState =
|
||||
new backend::ProgramState(ProgramManager::getInstance()->getCustomProgram(CustomProgramType::BLUR));
|
||||
|
@ -877,7 +877,7 @@ axis::backend::ProgramState* RendererUniformBatch::createBlurProgramState()
|
|||
return programState;
|
||||
}
|
||||
|
||||
axis::backend::ProgramState* RendererUniformBatch::createSepiaProgramState()
|
||||
ax::backend::ProgramState* RendererUniformBatch::createSepiaProgramState()
|
||||
{
|
||||
auto programState =
|
||||
new backend::ProgramState(ProgramManager::getInstance()->getCustomProgram(CustomProgramType::SEPIA));
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
|
||||
void createSpriteTest();
|
||||
void createNewSpriteTest();
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
NewSpriteTest();
|
||||
|
@ -80,16 +80,16 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
NewClippingNodeTest();
|
||||
virtual ~NewClippingNodeTest();
|
||||
|
||||
bool _scrolling;
|
||||
axis::Vec2 _lastPoint;
|
||||
ax::Vec2 _lastPoint;
|
||||
};
|
||||
|
||||
class NewDrawNodeTest : public MultiSceneTest
|
||||
|
@ -114,9 +114,9 @@ public:
|
|||
protected:
|
||||
NewCullingTest();
|
||||
virtual ~NewCullingTest();
|
||||
bool onTouchBegan(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchMoved(axis::Touch* touch, axis::Event* event);
|
||||
axis::Vec2 _lastPos;
|
||||
bool onTouchBegan(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchMoved(ax::Touch* touch, ax::Event* event);
|
||||
ax::Vec2 _lastPos;
|
||||
};
|
||||
|
||||
class SpriteCreation : public MultiSceneTest
|
||||
|
@ -136,9 +136,9 @@ public:
|
|||
protected:
|
||||
int totalSprites = 1000;
|
||||
int suggestDelta = 100;
|
||||
axis::Label* _labelSpriteNum = nullptr;
|
||||
axis::Label* labelCreate = nullptr;
|
||||
axis::Label* labelDestory = nullptr;
|
||||
ax::Label* _labelSpriteNum = nullptr;
|
||||
ax::Label* labelCreate = nullptr;
|
||||
ax::Label* labelDestory = nullptr;
|
||||
SpriteCreation();
|
||||
virtual ~SpriteCreation();
|
||||
};
|
||||
|
@ -168,7 +168,7 @@ protected:
|
|||
CaptureScreenTest();
|
||||
~CaptureScreenTest();
|
||||
|
||||
void onCaptured(axis::Ref*);
|
||||
void onCaptured(ax::Ref*);
|
||||
void afterCaptured(bool succeed, std::string_view outputFile);
|
||||
|
||||
std::string _filename;
|
||||
|
@ -187,7 +187,7 @@ protected:
|
|||
CaptureNodeTest();
|
||||
~CaptureNodeTest();
|
||||
|
||||
void onCaptured(axis::Ref*);
|
||||
void onCaptured(ax::Ref*);
|
||||
|
||||
std::string _filename;
|
||||
};
|
||||
|
@ -224,8 +224,8 @@ public:
|
|||
protected:
|
||||
RendererUniformBatch();
|
||||
|
||||
axis::backend::ProgramState* createBlurProgramState();
|
||||
axis::backend::ProgramState* createSepiaProgramState();
|
||||
ax::backend::ProgramState* createBlurProgramState();
|
||||
ax::backend::ProgramState* createSepiaProgramState();
|
||||
};
|
||||
|
||||
class RendererUniformBatch2 : public MultiSceneTest
|
||||
|
@ -238,8 +238,8 @@ public:
|
|||
protected:
|
||||
RendererUniformBatch2();
|
||||
|
||||
axis::backend::ProgramState* createBlurProgramState();
|
||||
axis::backend::ProgramState* createSepiaProgramState();
|
||||
ax::backend::ProgramState* createBlurProgramState();
|
||||
ax::backend::ProgramState* createSepiaProgramState();
|
||||
};
|
||||
|
||||
class NonBatchSprites : public MultiSceneTest
|
||||
|
@ -274,7 +274,7 @@ protected:
|
|||
float _maDt = 1.0f / 60.0f;
|
||||
float _rmaDt = 1.0f / 60.0f;
|
||||
const float DEST_DT_30FPS = 1.0f / 30.0f;
|
||||
axis::Label* _totalSprites = nullptr;
|
||||
ax::Label* _totalSprites = nullptr;
|
||||
Ticker _contSlow = Ticker(20);
|
||||
Ticker _contFast = Ticker(2);
|
||||
Ticker _around30fps = Ticker(60 * 3);
|
||||
|
|
|
@ -41,7 +41,7 @@ protected:
|
|||
TestCocosNodeDemo();
|
||||
virtual ~TestCocosNodeDemo();
|
||||
|
||||
axis::Director::Projection _preProjection;
|
||||
ax::Director::Projection _preProjection;
|
||||
};
|
||||
|
||||
class NodeTest2 : public TestCocosNodeDemo
|
||||
|
@ -208,8 +208,8 @@ public:
|
|||
protected:
|
||||
CameraTest1();
|
||||
|
||||
axis::Sprite* _sprite1;
|
||||
axis::Sprite* _sprite2;
|
||||
ax::Sprite* _sprite1;
|
||||
ax::Sprite* _sprite2;
|
||||
};
|
||||
|
||||
class CameraTest2 : public TestCocosNodeDemo
|
||||
|
@ -224,15 +224,15 @@ public:
|
|||
protected:
|
||||
CameraTest2();
|
||||
|
||||
axis::Sprite* _sprite1;
|
||||
axis::Sprite* _sprite2;
|
||||
ax::Sprite* _sprite1;
|
||||
ax::Sprite* _sprite2;
|
||||
};
|
||||
|
||||
class ConvertToNode : public TestCocosNodeDemo
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(ConvertToNode);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
|
@ -273,7 +273,7 @@ public:
|
|||
|
||||
protected:
|
||||
NodeGlobalZValueTest();
|
||||
axis::Sprite* _sprite;
|
||||
ax::Sprite* _sprite;
|
||||
};
|
||||
|
||||
class NodeNormalizedPositionTest1 : public TestCocosNodeDemo
|
||||
|
@ -298,7 +298,7 @@ protected:
|
|||
NodeNormalizedPositionTest2();
|
||||
|
||||
void update(float dt) override;
|
||||
axis::Size _copyContentSize;
|
||||
ax::Size _copyContentSize;
|
||||
float _accum;
|
||||
};
|
||||
|
||||
|
@ -314,7 +314,7 @@ protected:
|
|||
|
||||
void update(float dt) override;
|
||||
float _accum;
|
||||
axis::Sprite* sprite;
|
||||
ax::Sprite* sprite;
|
||||
};
|
||||
|
||||
class NodeNameTest : public TestCocosNodeDemo
|
||||
|
|
|
@ -37,10 +37,10 @@ public:
|
|||
OpenURLTest();
|
||||
~OpenURLTest();
|
||||
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
private:
|
||||
axis::Label* _label;
|
||||
ax::Label* _label;
|
||||
};
|
||||
|
||||
#endif // _OPEN_URL_TEST_H_
|
||||
|
|
|
@ -32,15 +32,15 @@ DEFINE_TEST_SUITE(ParallaxTests);
|
|||
class ParallaxDemo : public TestCase
|
||||
{
|
||||
protected:
|
||||
axis::TextureAtlas* _atlas;
|
||||
ax::TextureAtlas* _atlas;
|
||||
};
|
||||
|
||||
class Parallax1 : public ParallaxDemo
|
||||
{
|
||||
protected:
|
||||
axis::Node* _root;
|
||||
axis::Node* _target;
|
||||
axis::MotionStreak* _streak;
|
||||
ax::Node* _root;
|
||||
ax::Node* _target;
|
||||
ax::MotionStreak* _streak;
|
||||
|
||||
public:
|
||||
CREATE_FUNC(Parallax1);
|
||||
|
@ -51,15 +51,15 @@ public:
|
|||
class Parallax2 : public ParallaxDemo
|
||||
{
|
||||
protected:
|
||||
axis::Node* _root;
|
||||
axis::Node* _target;
|
||||
axis::MotionStreak* _streak;
|
||||
ax::Node* _root;
|
||||
ax::Node* _target;
|
||||
ax::MotionStreak* _streak;
|
||||
|
||||
public:
|
||||
CREATE_FUNC(Parallax2);
|
||||
Parallax2();
|
||||
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
virtual std::string title() const override;
|
||||
};
|
||||
|
@ -67,16 +67,16 @@ public:
|
|||
class Issue2572 : public ParallaxDemo
|
||||
{
|
||||
protected:
|
||||
axis::ParallaxNode* _paraNode;
|
||||
ax::ParallaxNode* _paraNode;
|
||||
float _moveTimer;
|
||||
float _addTimer;
|
||||
axis::Vector<axis::Sprite*> _childList;
|
||||
ax::Vector<ax::Sprite*> _childList;
|
||||
ssize_t _preListSize;
|
||||
int _printCount;
|
||||
|
||||
float _addChildStep;
|
||||
float _wholeMoveTime;
|
||||
axis::Vec2 _wholeMoveSize;
|
||||
ax::Vec2 _wholeMoveSize;
|
||||
|
||||
virtual void update(float dt) override;
|
||||
|
||||
|
|
|
@ -90,9 +90,9 @@ bool Particle3DTestDemo::init()
|
|||
return true;
|
||||
}
|
||||
|
||||
void Particle3DTestDemo::onTouchesBegan(const std::vector<Touch*>& touches, axis::Event* event) {}
|
||||
void Particle3DTestDemo::onTouchesBegan(const std::vector<Touch*>& touches, ax::Event* event) {}
|
||||
|
||||
void Particle3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void Particle3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (touches.size())
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ void Particle3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, axis
|
|||
}
|
||||
}
|
||||
|
||||
void Particle3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, axis::Event* event) {}
|
||||
void Particle3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, ax::Event* event) {}
|
||||
|
||||
Particle3DTestDemo::Particle3DTestDemo(void) : _angle(0.0f) {}
|
||||
|
||||
|
|
|
@ -44,14 +44,14 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual void update(float delta) override;
|
||||
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
std::string _title;
|
||||
axis::Camera* _camera;
|
||||
axis::Label* _particleLab;
|
||||
ax::Camera* _camera;
|
||||
ax::Label* _particleLab;
|
||||
float _angle;
|
||||
};
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ DEFINE_TEST_SUITE(ParticleTests);
|
|||
class ParticleDemo : public TestCase
|
||||
{
|
||||
protected:
|
||||
axis::ParticleSystemQuad* _emitter;
|
||||
axis::Sprite* _background;
|
||||
axis::LayerColor* _color;
|
||||
ax::ParticleSystemQuad* _emitter;
|
||||
ax::Sprite* _background;
|
||||
ax::LayerColor* _color;
|
||||
|
||||
public:
|
||||
~ParticleDemo();
|
||||
|
@ -44,11 +44,11 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void toggleCallback(axis::Ref* sender);
|
||||
void toggleCallback(ax::Ref* sender);
|
||||
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
virtual void update(float dt) override;
|
||||
void setEmitterPosition();
|
||||
|
@ -484,8 +484,8 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::Node* _parent1;
|
||||
axis::Node* _parent2;
|
||||
ax::Node* _parent1;
|
||||
ax::Node* _parent2;
|
||||
};
|
||||
|
||||
class ParticleBatchMultipleEmitters : public ParticleDemo
|
||||
|
@ -542,7 +542,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::ParticleBatchNode* _batchNode;
|
||||
ax::ParticleBatchNode* _batchNode;
|
||||
};
|
||||
|
||||
class ReorderParticleSystems : public ParticleDemo
|
||||
|
@ -556,7 +556,7 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::ParticleBatchNode* _batchNode;
|
||||
ax::ParticleBatchNode* _batchNode;
|
||||
};
|
||||
|
||||
class PremultipliedAlphaTest : public ParticleDemo
|
||||
|
|
|
@ -52,7 +52,7 @@ enum
|
|||
#define ARRAY_SIZE_Y 3
|
||||
#define ARRAY_SIZE_Z 4
|
||||
|
||||
static axis::Scene* physicsScene = nullptr;
|
||||
static ax::Scene* physicsScene = nullptr;
|
||||
|
||||
Physics3DTests::Physics3DTests()
|
||||
{
|
||||
|
@ -143,13 +143,13 @@ bool Physics3DTestDemo::init()
|
|||
return false;
|
||||
}
|
||||
|
||||
void Physics3DTestDemo::onTouchesBegan(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void Physics3DTestDemo::onTouchesBegan(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
_needShootBox = true;
|
||||
event->stopPropagation();
|
||||
}
|
||||
|
||||
void Physics3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void Physics3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (touches.size() && _camera)
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ void Physics3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, axis:
|
|||
}
|
||||
}
|
||||
|
||||
void Physics3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, axis::Event* event)
|
||||
void Physics3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (!_needShootBox)
|
||||
return;
|
||||
|
@ -191,7 +191,7 @@ void Physics3DTestDemo::update(float /*delta*/) {}
|
|||
|
||||
Physics3DTestDemo::~Physics3DTestDemo() {}
|
||||
|
||||
void Physics3DTestDemo::shootBox(const axis::Vec3& des)
|
||||
void Physics3DTestDemo::shootBox(const ax::Vec3& des)
|
||||
{
|
||||
Physics3DRigidBodyDes rbDes;
|
||||
Vec3 linearVel = des - _camera->getPosition3D();
|
||||
|
@ -534,7 +534,7 @@ bool Physics3DConstraintDemo::init()
|
|||
return true;
|
||||
}
|
||||
|
||||
void Physics3DConstraintDemo::onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void Physics3DConstraintDemo::onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
// ray trace
|
||||
if (_camera)
|
||||
|
@ -566,7 +566,7 @@ void Physics3DConstraintDemo::onTouchesBegan(const std::vector<axis::Touch*>& to
|
|||
Physics3DTestDemo::onTouchesBegan(touches, event);
|
||||
_needShootBox = false;
|
||||
}
|
||||
void Physics3DConstraintDemo::onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void Physics3DConstraintDemo::onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (_constraint)
|
||||
{
|
||||
|
@ -586,7 +586,7 @@ void Physics3DConstraintDemo::onTouchesMoved(const std::vector<axis::Touch*>& to
|
|||
}
|
||||
Physics3DTestDemo::onTouchesMoved(touches, event);
|
||||
}
|
||||
void Physics3DConstraintDemo::onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void Physics3DConstraintDemo::onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
if (_constraint)
|
||||
{
|
||||
|
|
|
@ -60,16 +60,16 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
virtual void update(float delta) override;
|
||||
|
||||
virtual void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
virtual void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
virtual void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
virtual void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
void shootBox(const axis::Vec3& des);
|
||||
void shootBox(const ax::Vec3& des);
|
||||
|
||||
protected:
|
||||
std::string _title;
|
||||
axis::Camera* _camera = nullptr;
|
||||
ax::Camera* _camera = nullptr;
|
||||
float _angle = 0.f;
|
||||
bool _needShootBox = false;
|
||||
};
|
||||
|
@ -97,12 +97,12 @@ public:
|
|||
|
||||
virtual bool init() override;
|
||||
|
||||
virtual void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event) override;
|
||||
virtual void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event) override;
|
||||
virtual void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event) override;
|
||||
virtual void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event) override;
|
||||
virtual void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event) override;
|
||||
virtual void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event) override;
|
||||
|
||||
protected:
|
||||
axis::Physics3DConstraint* _constraint; // for picking
|
||||
ax::Physics3DConstraint* _constraint; // for picking
|
||||
float _pickingDistance; // picking distance
|
||||
};
|
||||
|
||||
|
|
|
@ -42,31 +42,31 @@ public:
|
|||
virtual void onEnter() override;
|
||||
virtual std::string title() const override;
|
||||
|
||||
void toggleDebugCallback(axis::Ref* sender);
|
||||
void toggleDebugCallback(ax::Ref* sender);
|
||||
|
||||
axis::Sprite* addGrossiniAtPosition(axis::Vec2 p, float scale = 1.0);
|
||||
axis::Sprite* makeBall(axis::Vec2 point,
|
||||
ax::Sprite* addGrossiniAtPosition(ax::Vec2 p, float scale = 1.0);
|
||||
ax::Sprite* makeBall(ax::Vec2 point,
|
||||
float radius,
|
||||
axis::PhysicsMaterial material = axis::PHYSICSBODY_MATERIAL_DEFAULT);
|
||||
axis::Sprite* makeBox(axis::Vec2 point,
|
||||
axis::Size size,
|
||||
ax::PhysicsMaterial material = ax::PHYSICSBODY_MATERIAL_DEFAULT);
|
||||
ax::Sprite* makeBox(ax::Vec2 point,
|
||||
ax::Size size,
|
||||
int color = 0,
|
||||
axis::PhysicsMaterial material = axis::PHYSICSBODY_MATERIAL_DEFAULT);
|
||||
axis::Sprite* makeTriangle(axis::Vec2 point,
|
||||
axis::Size size,
|
||||
ax::PhysicsMaterial material = ax::PHYSICSBODY_MATERIAL_DEFAULT);
|
||||
ax::Sprite* makeTriangle(ax::Vec2 point,
|
||||
ax::Size size,
|
||||
int color = 0,
|
||||
axis::PhysicsMaterial material = axis::PHYSICSBODY_MATERIAL_DEFAULT);
|
||||
ax::PhysicsMaterial material = ax::PHYSICSBODY_MATERIAL_DEFAULT);
|
||||
|
||||
bool onTouchBegan(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchMoved(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchEnded(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchBegan(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchMoved(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchEnded(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
void toggleDebug();
|
||||
|
||||
protected:
|
||||
axis::Texture2D* _spriteTexture;
|
||||
axis::SpriteBatchNode* _ball;
|
||||
std::unordered_map<int, axis::Node*> _mouses;
|
||||
ax::Texture2D* _spriteTexture;
|
||||
ax::SpriteBatchNode* _ball;
|
||||
std::unordered_map<int, ax::Node*> _mouses;
|
||||
bool _debugDraw;
|
||||
};
|
||||
|
||||
|
@ -88,8 +88,8 @@ public:
|
|||
void onEnter() override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onAcceleration(axis::Acceleration* acc, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onAcceleration(ax::Acceleration* acc, ax::Event* event);
|
||||
};
|
||||
|
||||
class PhysicsDemoPyramidStack : public PhysicsDemo
|
||||
|
@ -112,15 +112,15 @@ public:
|
|||
void onEnter() override;
|
||||
virtual std::string title() const override;
|
||||
void update(float delta) override;
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
void changeModeCallback(axis::Ref* sender);
|
||||
void changeModeCallback(ax::Ref* sender);
|
||||
|
||||
bool anyRay(axis::PhysicsWorld& world, const axis::PhysicsRayCastInfo& info, void* data);
|
||||
bool anyRay(ax::PhysicsWorld& world, const ax::PhysicsRayCastInfo& info, void* data);
|
||||
|
||||
private:
|
||||
float _angle;
|
||||
axis::DrawNode* _node;
|
||||
ax::DrawNode* _node;
|
||||
int _mode;
|
||||
};
|
||||
|
||||
|
@ -152,9 +152,9 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
bool onTouchBegan(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchMoved(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchEnded(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchBegan(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchMoved(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchEnded(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
private:
|
||||
float _distance;
|
||||
|
@ -169,7 +169,7 @@ public:
|
|||
void onEnter() override;
|
||||
virtual std::string title() const override;
|
||||
|
||||
bool onContactBegin(axis::PhysicsContact& contact);
|
||||
bool onContactBegin(ax::PhysicsContact& contact);
|
||||
};
|
||||
|
||||
class PhysicsDemoSlice : public PhysicsDemo
|
||||
|
@ -181,10 +181,10 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
bool slice(axis::PhysicsWorld& world, const axis::PhysicsRayCastInfo& info, void* data);
|
||||
void clipPoly(axis::PhysicsShapePolygon* shape, axis::Vec2 normal, float distance);
|
||||
bool slice(ax::PhysicsWorld& world, const ax::PhysicsRayCastInfo& info, void* data);
|
||||
void clipPoly(ax::PhysicsShapePolygon* shape, ax::Vec2 normal, float distance);
|
||||
|
||||
void onTouchEnded(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchEnded(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
private:
|
||||
int _sliceTag;
|
||||
|
@ -207,12 +207,12 @@ public:
|
|||
|
||||
void onEnter() override;
|
||||
void resetTest();
|
||||
bool onContactBegin(axis::PhysicsContact& contact);
|
||||
bool onContactBegin(ax::PhysicsContact& contact);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void onDecrease(axis::Ref* sender);
|
||||
void onIncrease(axis::Ref* sender);
|
||||
void onDecrease(ax::Ref* sender);
|
||||
void onIncrease(ax::Ref* sender);
|
||||
|
||||
private:
|
||||
int _yellowBoxNum;
|
||||
|
@ -251,13 +251,13 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void changeBodyCallback(axis::Ref* sender);
|
||||
void changeBodyCallback(ax::Ref* sender);
|
||||
|
||||
private:
|
||||
axis::Sprite* _nodeA;
|
||||
axis::Sprite* _nodeB;
|
||||
axis::PhysicsBody* _body;
|
||||
axis::MenuItemFont* _button;
|
||||
ax::Sprite* _nodeA;
|
||||
ax::Sprite* _nodeB;
|
||||
ax::PhysicsBody* _body;
|
||||
ax::MenuItemFont* _button;
|
||||
bool _bodyInA;
|
||||
};
|
||||
|
||||
|
@ -281,11 +281,11 @@ public:
|
|||
void onEnter() override;
|
||||
virtual std::string title() const override;
|
||||
|
||||
bool onTouchBegan(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchBegan(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
private:
|
||||
axis::Sprite* _parentSprite;
|
||||
axis::Layer* _rootLayer;
|
||||
ax::Sprite* _parentSprite;
|
||||
ax::Layer* _rootLayer;
|
||||
};
|
||||
|
||||
class PhysicsIssue9959 : public PhysicsDemo
|
||||
|
|
|
@ -85,17 +85,17 @@ std::string RenderTextureSave::subtitle() const
|
|||
return "Press 'Save Image' to create an snapshot of the render texture";
|
||||
}
|
||||
|
||||
void RenderTextureSave::clearImage(axis::Ref* sender)
|
||||
void RenderTextureSave::clearImage(ax::Ref* sender)
|
||||
{
|
||||
_target->clear(AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1(), AXRANDOM_0_1());
|
||||
}
|
||||
|
||||
void RenderTextureSave::clearImageTransparent(axis::Ref* sender)
|
||||
void RenderTextureSave::clearImageTransparent(ax::Ref* sender)
|
||||
{
|
||||
_target->clear(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void RenderTextureSave::saveImageWithPremultipliedAlpha(axis::Ref* sender)
|
||||
void RenderTextureSave::saveImageWithPremultipliedAlpha(ax::Ref* sender)
|
||||
{
|
||||
static int counter = 0;
|
||||
|
||||
|
@ -120,7 +120,7 @@ void RenderTextureSave::saveImageWithPremultipliedAlpha(axis::Ref* sender)
|
|||
counter++;
|
||||
}
|
||||
|
||||
void RenderTextureSave::saveImageWithNonPremultipliedAlpha(axis::Ref* sender)
|
||||
void RenderTextureSave::saveImageWithNonPremultipliedAlpha(ax::Ref* sender)
|
||||
{
|
||||
static int counter = 0;
|
||||
|
||||
|
@ -146,7 +146,7 @@ void RenderTextureSave::saveImageWithNonPremultipliedAlpha(axis::Ref* sender)
|
|||
counter++;
|
||||
}
|
||||
|
||||
void RenderTextureSave::addImage(axis::Ref* sender)
|
||||
void RenderTextureSave::addImage(ax::Ref* sender)
|
||||
{
|
||||
auto s = Director::getInstance()->getWinSize();
|
||||
|
||||
|
|
|
@ -42,16 +42,16 @@ public:
|
|||
~RenderTextureSave();
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void clearImage(axis::Ref* pSender);
|
||||
void clearImageTransparent(axis::Ref* sender);
|
||||
void saveImageWithPremultipliedAlpha(axis::Ref* pSender);
|
||||
void saveImageWithNonPremultipliedAlpha(axis::Ref* pSender);
|
||||
void addImage(axis::Ref* sender);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void clearImage(ax::Ref* pSender);
|
||||
void clearImageTransparent(ax::Ref* sender);
|
||||
void saveImageWithPremultipliedAlpha(ax::Ref* pSender);
|
||||
void saveImageWithNonPremultipliedAlpha(ax::Ref* pSender);
|
||||
void addImage(ax::Ref* sender);
|
||||
|
||||
private:
|
||||
axis::RenderTexture* _target;
|
||||
axis::Vector<axis::Sprite*> _brushs;
|
||||
ax::RenderTexture* _target;
|
||||
ax::Vector<ax::Sprite*> _brushs;
|
||||
};
|
||||
|
||||
class RenderTextureIssue937 : public RenderTextureTest
|
||||
|
@ -69,26 +69,26 @@ public:
|
|||
CREATE_FUNC(RenderTextureZbuffer);
|
||||
RenderTextureZbuffer();
|
||||
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void renderScreenShot();
|
||||
|
||||
private:
|
||||
axis::SpriteBatchNode* mgr;
|
||||
ax::SpriteBatchNode* mgr;
|
||||
|
||||
axis::Sprite* sp1;
|
||||
axis::Sprite* sp2;
|
||||
axis::Sprite* sp3;
|
||||
axis::Sprite* sp4;
|
||||
axis::Sprite* sp5;
|
||||
axis::Sprite* sp6;
|
||||
axis::Sprite* sp7;
|
||||
axis::Sprite* sp8;
|
||||
axis::Sprite* sp9;
|
||||
ax::Sprite* sp1;
|
||||
ax::Sprite* sp2;
|
||||
ax::Sprite* sp3;
|
||||
ax::Sprite* sp4;
|
||||
ax::Sprite* sp5;
|
||||
ax::Sprite* sp6;
|
||||
ax::Sprite* sp7;
|
||||
ax::Sprite* sp8;
|
||||
ax::Sprite* sp9;
|
||||
};
|
||||
|
||||
class RenderTextureTestDepthStencil : public RenderTextureTest
|
||||
|
@ -99,28 +99,28 @@ public:
|
|||
virtual ~RenderTextureTestDepthStencil();
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override;
|
||||
virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override;
|
||||
|
||||
private:
|
||||
// axis::CallbackCommand _renderCmds[4];
|
||||
// ax::CallbackCommand _renderCmds[4];
|
||||
void onBeforeClear();
|
||||
void onBeforeStencil();
|
||||
void onBeforeDraw();
|
||||
void onAfterDraw();
|
||||
|
||||
private:
|
||||
axis::Renderer* _renderer;
|
||||
axis::backend::DepthStencilDescriptor _dsDesc;
|
||||
axis::RenderTexture* _rtx;
|
||||
axis::Sprite* _spriteDS;
|
||||
axis::Sprite* _spriteDraw;
|
||||
ax::Renderer* _renderer;
|
||||
ax::backend::DepthStencilDescriptor _dsDesc;
|
||||
ax::RenderTexture* _rtx;
|
||||
ax::Sprite* _spriteDS;
|
||||
ax::Sprite* _spriteDraw;
|
||||
};
|
||||
|
||||
class RenderTextureTargetNode : public RenderTextureTest
|
||||
{
|
||||
private:
|
||||
axis::Sprite *sprite1, *sprite2;
|
||||
axis::RenderTexture* renderTexture;
|
||||
ax::Sprite *sprite1, *sprite2;
|
||||
ax::RenderTexture* renderTexture;
|
||||
|
||||
public:
|
||||
CREATE_FUNC(RenderTextureTargetNode);
|
||||
|
@ -130,7 +130,7 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void touched(axis::Ref* sender);
|
||||
void touched(ax::Ref* sender);
|
||||
};
|
||||
|
||||
class RenderTexturePartTest : public RenderTextureTest
|
||||
|
@ -143,34 +143,34 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
|
||||
private:
|
||||
axis::RenderTexture* _rend;
|
||||
axis::Sprite* _spriteDraw;
|
||||
ax::RenderTexture* _rend;
|
||||
ax::Sprite* _spriteDraw;
|
||||
};
|
||||
|
||||
class SpriteRenderTextureBug : public RenderTextureTest
|
||||
{
|
||||
public:
|
||||
class SimpleSprite : public axis::Sprite
|
||||
class SimpleSprite : public ax::Sprite
|
||||
{
|
||||
public:
|
||||
static SimpleSprite* create(const char* filename, const axis::Rect& rect);
|
||||
static SimpleSprite* create(const char* filename, const ax::Rect& rect);
|
||||
SimpleSprite();
|
||||
~SimpleSprite();
|
||||
virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags);
|
||||
virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags);
|
||||
|
||||
public:
|
||||
axis::RenderTexture* _rt;
|
||||
ax::RenderTexture* _rt;
|
||||
};
|
||||
|
||||
public:
|
||||
CREATE_FUNC(SpriteRenderTextureBug);
|
||||
SpriteRenderTextureBug();
|
||||
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
SimpleSprite* addNewSpriteWithCoords(const axis::Vec2& p);
|
||||
SimpleSprite* addNewSpriteWithCoords(const ax::Vec2& p);
|
||||
};
|
||||
|
||||
class Issue16113Test : public RenderTextureTest
|
||||
|
|
|
@ -37,14 +37,14 @@ public:
|
|||
virtual bool init() override;
|
||||
};
|
||||
|
||||
class SpriteLayer : public axis::Layer
|
||||
class SpriteLayer : public ax::Layer
|
||||
{
|
||||
public:
|
||||
virtual void onEnter() override;
|
||||
CREATE_FUNC(SpriteLayer)
|
||||
};
|
||||
|
||||
class TestLayer : public axis::Layer
|
||||
class TestLayer : public ax::Layer
|
||||
{
|
||||
public:
|
||||
virtual void onEnter() override;
|
||||
|
@ -52,7 +52,7 @@ public:
|
|||
CREATE_FUNC(TestLayer)
|
||||
};
|
||||
|
||||
class RotateWorldMainLayer : public axis::Layer
|
||||
class RotateWorldMainLayer : public ax::Layer
|
||||
{
|
||||
public:
|
||||
virtual void onEnter() override;
|
||||
|
|
|
@ -39,11 +39,11 @@ class SkeletonAnimationCullingFix : public SkeletonAnimation
|
|||
public:
|
||||
SkeletonAnimationCullingFix() : SkeletonAnimation() {}
|
||||
|
||||
virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t transformFlags) override
|
||||
virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t transformFlags) override
|
||||
{
|
||||
glDisable(GL_CULL_FACE);
|
||||
SkeletonAnimation::draw(renderer, transform, transformFlags);
|
||||
RenderState::StateBlock::invalidate(axis::RenderState::StateBlock::RS_ALL_ONES);
|
||||
RenderState::StateBlock::invalidate(ax::RenderState::StateBlock::RS_ALL_ONES);
|
||||
}
|
||||
|
||||
static SkeletonAnimationCullingFix* createWithFile(std::string_view skeletonDataFile,
|
||||
|
@ -100,7 +100,7 @@ private:
|
|||
// init in createWorld3D()
|
||||
TextureCube* _textureCube;
|
||||
Skybox* _skyBox;
|
||||
axis::Terrain* _terrain;
|
||||
ax::Terrain* _terrain;
|
||||
Player* _player;
|
||||
Node* _monsters[2];
|
||||
|
||||
|
@ -130,7 +130,7 @@ private:
|
|||
|
||||
std::vector<std::string> _skins[(int)SkinType::MAX_TYPE]; // all skins
|
||||
int _curSkin[(int)SkinType::MAX_TYPE]; // current skin index
|
||||
axis::MeshRenderer* _reskinGirl;
|
||||
ax::MeshRenderer* _reskinGirl;
|
||||
|
||||
// for capture screen
|
||||
static const int SNAPSHOT_TAG = 119;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
DEFINE_TEST_SUITE(SceneTests);
|
||||
|
||||
class SceneTestLayer1 : public axis::Layer
|
||||
class SceneTestLayer1 : public ax::Layer
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(SceneTestLayer1);
|
||||
|
@ -42,12 +42,12 @@ public:
|
|||
virtual void onEnterTransitionDidFinish() override;
|
||||
|
||||
void testDealloc(float dt);
|
||||
void onPushScene(axis::Ref* sender);
|
||||
void onPushSceneTran(axis::Ref* sender);
|
||||
void onQuit(axis::Ref* sender);
|
||||
void onPushScene(ax::Ref* sender);
|
||||
void onPushSceneTran(ax::Ref* sender);
|
||||
void onQuit(ax::Ref* sender);
|
||||
};
|
||||
|
||||
class SceneTestLayer2 : public axis::Layer
|
||||
class SceneTestLayer2 : public ax::Layer
|
||||
{
|
||||
float _timeCounter;
|
||||
|
||||
|
@ -57,12 +57,12 @@ public:
|
|||
SceneTestLayer2();
|
||||
|
||||
void testDealloc(float dt);
|
||||
void onGoBack(axis::Ref* sender);
|
||||
void onReplaceScene(axis::Ref* sender);
|
||||
void onReplaceSceneTran(axis::Ref* sender);
|
||||
void onGoBack(ax::Ref* sender);
|
||||
void onReplaceScene(ax::Ref* sender);
|
||||
void onReplaceSceneTran(ax::Ref* sender);
|
||||
};
|
||||
|
||||
class SceneTestLayer3 : public axis::LayerColor
|
||||
class SceneTestLayer3 : public ax::LayerColor
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(SceneTestLayer3);
|
||||
|
@ -71,10 +71,10 @@ public:
|
|||
|
||||
virtual bool init() override;
|
||||
virtual void testDealloc(float dt);
|
||||
void item0Clicked(axis::Ref* sender);
|
||||
void item1Clicked(axis::Ref* sender);
|
||||
void item2Clicked(axis::Ref* sender);
|
||||
void item3Clicked(axis::Ref* sender);
|
||||
void item0Clicked(ax::Ref* sender);
|
||||
void item1Clicked(ax::Ref* sender);
|
||||
void item2Clicked(ax::Ref* sender);
|
||||
void item3Clicked(ax::Ref* sender);
|
||||
};
|
||||
|
||||
class SceneTestScene : public TestCase
|
||||
|
|
|
@ -1004,7 +1004,7 @@ public:
|
|||
|
||||
~TestNode2()
|
||||
{
|
||||
axis::log("Delete TestNode (should not crash)");
|
||||
ax::log("Delete TestNode (should not crash)");
|
||||
this->unscheduleAllCallbacks();
|
||||
}
|
||||
|
||||
|
@ -1383,7 +1383,7 @@ void SchedulerRemoveEntryWhileUpdate::onExit()
|
|||
SchedulerTestLayer::onExit();
|
||||
}
|
||||
|
||||
SchedulerRemoveEntryWhileUpdate::TestClass::TestClass(int index, TestClass* nextObj, axis::Scheduler* scheduler)
|
||||
SchedulerRemoveEntryWhileUpdate::TestClass::TestClass(int index, TestClass* nextObj, ax::Scheduler* scheduler)
|
||||
: _nextObj(nextObj), _index(index), _scheduler(scheduler)
|
||||
{}
|
||||
|
||||
|
@ -1446,7 +1446,7 @@ void SchedulerRemoveSelectorDuringCall::callback(float)
|
|||
{
|
||||
if (!_scheduled)
|
||||
{
|
||||
axis::log("Error: unscheduled callback must not be called.");
|
||||
ax::log("Error: unscheduled callback must not be called.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ public:
|
|||
void stopUpdate(float dt);
|
||||
};
|
||||
|
||||
class TestNode : public axis::Node
|
||||
class TestNode : public ax::Node
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(TestNode);
|
||||
|
@ -272,9 +272,9 @@ public:
|
|||
void onExit() override;
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
axis::extension::ControlSlider* sliderCtl();
|
||||
void sliderAction(axis::Ref* sender, axis::extension::Control::EventType controlEvent);
|
||||
axis::extension::ControlSlider* _sliderCtl;
|
||||
ax::extension::ControlSlider* sliderCtl();
|
||||
void sliderAction(ax::Ref* sender, ax::extension::Control::EventType controlEvent);
|
||||
ax::extension::ControlSlider* _sliderCtl;
|
||||
};
|
||||
|
||||
class TwoSchedulers : public SchedulerTestLayer
|
||||
|
@ -286,15 +286,15 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void onEnter() override;
|
||||
axis::extension::ControlSlider* sliderCtl();
|
||||
void sliderAction(axis::Ref* sender, axis::extension::Control::EventType controlEvent);
|
||||
axis::Scheduler* sched1;
|
||||
axis::Scheduler* sched2;
|
||||
axis::ActionManager* actionManager1;
|
||||
axis::ActionManager* actionManager2;
|
||||
ax::extension::ControlSlider* sliderCtl();
|
||||
void sliderAction(ax::Ref* sender, ax::extension::Control::EventType controlEvent);
|
||||
ax::Scheduler* sched1;
|
||||
ax::Scheduler* sched2;
|
||||
ax::ActionManager* actionManager1;
|
||||
ax::ActionManager* actionManager2;
|
||||
|
||||
axis::extension::ControlSlider* sliderCtl1;
|
||||
axis::extension::ControlSlider* sliderCtl2;
|
||||
ax::extension::ControlSlider* sliderCtl1;
|
||||
ax::extension::ControlSlider* sliderCtl2;
|
||||
};
|
||||
|
||||
class SchedulerIssue2268 : public SchedulerTestLayer
|
||||
|
@ -309,7 +309,7 @@ public:
|
|||
void update(float dt) override;
|
||||
|
||||
private:
|
||||
axis::Node* testNode;
|
||||
ax::Node* testNode;
|
||||
};
|
||||
|
||||
class SchedulerIssueWithReschedule : public SchedulerTestLayer
|
||||
|
@ -349,7 +349,7 @@ public:
|
|||
|
||||
virtual void update(float dt) override;
|
||||
|
||||
bool onTouchBegan(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchBegan(ax::Touch* touch, ax::Event* event);
|
||||
};
|
||||
|
||||
class SchedulerIssue10232 : public SchedulerTestLayer
|
||||
|
@ -376,7 +376,7 @@ public:
|
|||
void update(float dt) override;
|
||||
|
||||
private:
|
||||
axis::Sprite* _sprite;
|
||||
ax::Sprite* _sprite;
|
||||
};
|
||||
|
||||
class SchedulerIssue17149 : public SchedulerTestLayer
|
||||
|
@ -432,13 +432,13 @@ private:
|
|||
class TestClass
|
||||
{
|
||||
public:
|
||||
TestClass(int index, TestClass* nextObj, axis::Scheduler* scheduler);
|
||||
TestClass(int index, TestClass* nextObj, ax::Scheduler* scheduler);
|
||||
void update(float dt);
|
||||
|
||||
private:
|
||||
TestClass* _nextObj = nullptr;
|
||||
int _index = 0;
|
||||
axis::Scheduler* _scheduler = nullptr;
|
||||
ax::Scheduler* _scheduler = nullptr;
|
||||
bool _cleanedUp = false;
|
||||
};
|
||||
std::vector<TestClass*> _testvector;
|
||||
|
|
|
@ -412,7 +412,7 @@ SpriteBlur* SpriteBlur::create(const char* pszFileName)
|
|||
{
|
||||
SpriteBlur* pRet = new SpriteBlur();
|
||||
bool result = pRet->initWithFile("");
|
||||
axis::log("Test call Sprite::initWithFile with bad file name result is : %s", result ? "true" : "false");
|
||||
ax::log("Test call Sprite::initWithFile with bad file name result is : %s", result ? "true" : "false");
|
||||
|
||||
if (pRet->initWithFile(pszFileName))
|
||||
{
|
||||
|
|
|
@ -112,13 +112,13 @@ public:
|
|||
virtual std::string subtitle() const override;
|
||||
virtual bool init() override;
|
||||
void createSliderCtls();
|
||||
void onRadiusChanged(axis::Ref* sender, axis::extension::Control::EventType controlEvent);
|
||||
void onSampleNumChanged(axis::Ref* sender, axis::extension::Control::EventType controlEvent);
|
||||
void onRadiusChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent);
|
||||
void onSampleNumChanged(ax::Ref* sender, ax::extension::Control::EventType controlEvent);
|
||||
|
||||
protected:
|
||||
SpriteBlur* _blurSprite;
|
||||
axis::extension::ControlSlider* _sliderRadiusCtl;
|
||||
axis::extension::ControlSlider* _sliderNumCtrl;
|
||||
ax::extension::ControlSlider* _sliderRadiusCtl;
|
||||
ax::extension::ControlSlider* _sliderNumCtrl;
|
||||
};
|
||||
|
||||
class ShaderRetroEffect : public ShaderTestDemo
|
||||
|
@ -132,19 +132,19 @@ public:
|
|||
virtual void update(float dt) override;
|
||||
|
||||
protected:
|
||||
axis::Label* _label;
|
||||
ax::Label* _label;
|
||||
float _accum;
|
||||
};
|
||||
|
||||
class ShaderNode : public axis::Node
|
||||
class ShaderNode : public ax::Node
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(ShaderNode);
|
||||
static ShaderNode* shaderNodeWithVertex(std::string_view vert, std::string_view frag);
|
||||
|
||||
virtual void update(float dt) override;
|
||||
virtual void setPosition(const axis::Vec2& newPosition) override;
|
||||
virtual void draw(axis::Renderer* renderer, const axis::Mat4& transform, uint32_t flags) override;
|
||||
virtual void setPosition(const ax::Vec2& newPosition) override;
|
||||
virtual void draw(ax::Renderer* renderer, const ax::Mat4& transform, uint32_t flags) override;
|
||||
|
||||
protected:
|
||||
ShaderNode();
|
||||
|
@ -153,7 +153,7 @@ protected:
|
|||
bool initWithVertex(std::string_view vert, std::string_view frag);
|
||||
void loadShaderVertex(std::string_view vert, std::string_view frag);
|
||||
|
||||
virtual bool setProgramState(axis::backend::ProgramState* programState, bool needsRetain = true) override
|
||||
virtual bool setProgramState(ax::backend::ProgramState* programState, bool needsRetain = true) override
|
||||
{
|
||||
if (Node::setProgramState(programState, needsRetain))
|
||||
{
|
||||
|
@ -166,20 +166,20 @@ protected:
|
|||
|
||||
void updateUniforms();
|
||||
|
||||
axis::Vec2 _center;
|
||||
axis::Vec2 _resolution;
|
||||
ax::Vec2 _center;
|
||||
ax::Vec2 _resolution;
|
||||
float _time;
|
||||
std::string _vertFileName;
|
||||
std::string _fragFileName;
|
||||
axis::CustomCommand _customCommand;
|
||||
ax::CustomCommand _customCommand;
|
||||
|
||||
axis::backend::UniformLocation _locResolution;
|
||||
axis::backend::UniformLocation _locCenter;
|
||||
axis::backend::UniformLocation _locMVP;
|
||||
axis::backend::UniformLocation _locTime;
|
||||
axis::backend::UniformLocation _locSinTime;
|
||||
axis::backend::UniformLocation _locCosTime;
|
||||
axis::backend::UniformLocation _locScreenSize;
|
||||
ax::backend::UniformLocation _locResolution;
|
||||
ax::backend::UniformLocation _locCenter;
|
||||
ax::backend::UniformLocation _locMVP;
|
||||
ax::backend::UniformLocation _locTime;
|
||||
ax::backend::UniformLocation _locSinTime;
|
||||
ax::backend::UniformLocation _locCosTime;
|
||||
ax::backend::UniformLocation _locScreenSize;
|
||||
};
|
||||
|
||||
class ShaderLensFlare : public ShaderTestDemo
|
||||
|
@ -211,10 +211,10 @@ class ShaderMultiTexture : public ShaderTestDemo
|
|||
public:
|
||||
CREATE_FUNC(ShaderMultiTexture);
|
||||
ShaderMultiTexture();
|
||||
axis::ui::Slider* createSliderCtl();
|
||||
void changeTexture(axis::Ref*);
|
||||
ax::ui::Slider* createSliderCtl();
|
||||
void changeTexture(ax::Ref*);
|
||||
int _changedTextureId;
|
||||
axis::Sprite* _sprite;
|
||||
ax::Sprite* _sprite;
|
||||
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
|
|
@ -41,20 +41,20 @@ public:
|
|||
//
|
||||
class EffectSprite;
|
||||
|
||||
class Effect : public axis::Ref
|
||||
class Effect : public ax::Ref
|
||||
{
|
||||
public:
|
||||
axis::backend::ProgramState* getProgramState() const { return _programState; }
|
||||
ax::backend::ProgramState* getProgramState() const { return _programState; }
|
||||
virtual void setTarget(EffectSprite* sprite) {}
|
||||
|
||||
protected:
|
||||
bool initProgramState(std::string_view fragmentFilename);
|
||||
Effect();
|
||||
virtual ~Effect();
|
||||
axis::backend::ProgramState* _programState = nullptr;
|
||||
ax::backend::ProgramState* _programState = nullptr;
|
||||
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
||||
std::string _fragSource;
|
||||
axis::EventListenerCustom* _backgroundListener;
|
||||
ax::EventListenerCustom* _backgroundListener;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -68,7 +68,7 @@ public:
|
|||
|
||||
protected:
|
||||
ssize_t _vectorIndex;
|
||||
axis::Vector<Effect*> _effects;
|
||||
ax::Vector<Effect*> _effects;
|
||||
EffectSprite* _sprite;
|
||||
};
|
||||
|
||||
|
@ -81,14 +81,14 @@ public:
|
|||
virtual std::string subtitle() const { return "Sprite Lamp effects"; }
|
||||
// callback
|
||||
public:
|
||||
virtual void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* unused_event);
|
||||
virtual void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* unused_event);
|
||||
virtual void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* unused_event);
|
||||
virtual void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* unused_event);
|
||||
virtual void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* unused_event);
|
||||
virtual void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* unused_event);
|
||||
|
||||
protected:
|
||||
EffectSprite* _sprite;
|
||||
Effect* _effect;
|
||||
axis::Sprite* _lightSprite;
|
||||
ax::Sprite* _lightSprite;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -103,7 +103,7 @@ bool SpineTestLayer::init()
|
|||
return false;
|
||||
|
||||
EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create();
|
||||
listener->onTouchBegan = [this](Touch* touch, axis::Event* event) -> bool {
|
||||
listener->onTouchBegan = [this](Touch* touch, ax::Event* event) -> bool {
|
||||
if (!skeletonNode)
|
||||
return true;
|
||||
_touchIndex = (_touchIndex + 1) % 3;
|
||||
|
@ -262,7 +262,7 @@ bool IKExample::init()
|
|||
// the current mouse location. The location is converted
|
||||
// to the skeleton's coordinate system.
|
||||
EventListenerMouse* mouseListener = EventListenerMouse::create();
|
||||
mouseListener->onMouseMove = [this](axis::Event* event) -> void {
|
||||
mouseListener->onMouseMove = [this](ax::Event* event) -> void {
|
||||
// convert the mosue location to the skeleton's coordinate space
|
||||
// and store it.
|
||||
EventMouse* mouseEvent = dynamic_cast<EventMouse*>(event);
|
||||
|
|
|
@ -103,7 +103,7 @@ public:
|
|||
virtual bool init();
|
||||
|
||||
private:
|
||||
axis::Vec2 position;
|
||||
ax::Vec2 position;
|
||||
};
|
||||
|
||||
class MixAndMatchExample : public SpineTestLayer
|
||||
|
@ -144,7 +144,7 @@ public:
|
|||
|
||||
private:
|
||||
spine::SkeletonRenderer* frontNode;
|
||||
axis::DrawNode* betweenNode;
|
||||
ax::DrawNode* betweenNode;
|
||||
};
|
||||
|
||||
class SpineboyExample : public SpineTestLayer
|
||||
|
|
|
@ -48,7 +48,7 @@ SpriteFrameCachePixelFormatTest::SpriteFrameCachePixelFormatTest()
|
|||
|
||||
infoLabel = Label::create();
|
||||
infoLabel->setAnchorPoint(Point(0.5f, 1.0f));
|
||||
infoLabel->setAlignment(axis::TextHAlignment::CENTER);
|
||||
infoLabel->setAlignment(ax::TextHAlignment::CENTER);
|
||||
infoLabel->setPosition(screenSize.width * 0.5f, screenSize.height * 0.7f);
|
||||
addChild(infoLabel);
|
||||
|
||||
|
@ -77,7 +77,7 @@ SpriteFrameCachePixelFormatTest::SpriteFrameCachePixelFormatTest()
|
|||
}
|
||||
|
||||
void SpriteFrameCachePixelFormatTest::loadSpriteFrames(std::string_view file,
|
||||
axis::backend::PixelFormat expectedFormat)
|
||||
ax::backend::PixelFormat expectedFormat)
|
||||
{
|
||||
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file);
|
||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("sprite_frames_test/grossini.png");
|
||||
|
@ -108,7 +108,7 @@ SpriteFrameCacheLoadMultipleTimes::SpriteFrameCacheLoadMultipleTimes()
|
|||
}
|
||||
|
||||
void SpriteFrameCacheLoadMultipleTimes::loadSpriteFrames(std::string_view file,
|
||||
axis::backend::PixelFormat expectedFormat)
|
||||
ax::backend::PixelFormat expectedFormat)
|
||||
{
|
||||
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file);
|
||||
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("sprite_frames_test/grossini.png");
|
||||
|
@ -126,7 +126,7 @@ SpriteFrameCacheFullCheck::SpriteFrameCacheFullCheck()
|
|||
loadSpriteFrames("Images/test_polygon.plist", backend::PixelFormat::RGBA8);
|
||||
}
|
||||
|
||||
void SpriteFrameCacheFullCheck::loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat)
|
||||
void SpriteFrameCacheFullCheck::loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat)
|
||||
{
|
||||
auto cache = SpriteFrameCache::getInstance();
|
||||
|
||||
|
@ -477,7 +477,7 @@ SpriteFrameCacheJsonAtlasTest::SpriteFrameCacheJsonAtlasTest()
|
|||
|
||||
infoLabel = Label::create();
|
||||
infoLabel->setAnchorPoint(Point(0.5f, 1.0f));
|
||||
infoLabel->setAlignment(axis::TextHAlignment::CENTER);
|
||||
infoLabel->setAlignment(ax::TextHAlignment::CENTER);
|
||||
infoLabel->setPosition(screenSize.width * 0.5f, screenSize.height * 0.7f);
|
||||
addChild(infoLabel);
|
||||
|
||||
|
@ -491,7 +491,7 @@ SpriteFrameCacheJsonAtlasTest::~SpriteFrameCacheJsonAtlasTest()
|
|||
}
|
||||
|
||||
void SpriteFrameCacheJsonAtlasTest::loadSpriteFrames(std::string_view file,
|
||||
axis::backend::PixelFormat expectedFormat)
|
||||
ax::backend::PixelFormat expectedFormat)
|
||||
{
|
||||
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file, GenericJsonArraySpriteSheetLoader::FORMAT);
|
||||
SpriteFrame* spriteFrame =
|
||||
|
|
|
@ -41,10 +41,10 @@ public:
|
|||
SpriteFrameCachePixelFormatTest();
|
||||
|
||||
private:
|
||||
void loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat);
|
||||
void loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat);
|
||||
|
||||
private:
|
||||
axis::Label* infoLabel;
|
||||
ax::Label* infoLabel;
|
||||
};
|
||||
|
||||
class SpriteFrameCacheLoadMultipleTimes : public TestCase
|
||||
|
@ -58,7 +58,7 @@ public:
|
|||
SpriteFrameCacheLoadMultipleTimes();
|
||||
|
||||
private:
|
||||
void loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat);
|
||||
void loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat);
|
||||
};
|
||||
|
||||
class SpriteFrameCacheFullCheck : public TestCase
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
SpriteFrameCacheFullCheck();
|
||||
|
||||
private:
|
||||
void loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat);
|
||||
void loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat);
|
||||
};
|
||||
|
||||
class SpriteFrameCacheJsonAtlasTest : public TestCase
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
~SpriteFrameCacheJsonAtlasTest() override;
|
||||
|
||||
private:
|
||||
void loadSpriteFrames(std::string_view file, axis::backend::PixelFormat expectedFormat);
|
||||
void loadSpriteFrames(std::string_view file, ax::backend::PixelFormat expectedFormat);
|
||||
|
||||
axis::Label* infoLabel;
|
||||
ax::Label* infoLabel;
|
||||
};
|
||||
|
|
|
@ -301,7 +301,7 @@ bool SpritePolygonTestSlider::init()
|
|||
void SpritePolygonTestSlider::initSliders()
|
||||
{
|
||||
auto vsize = Director::getInstance()->getVisibleSize();
|
||||
axis::ui::Slider* slider = axis::ui::Slider::create();
|
||||
ax::ui::Slider* slider = ax::ui::Slider::create();
|
||||
slider->loadBarTexture("cocosui/sliderTrack.png");
|
||||
slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", "");
|
||||
slider->loadProgressBarTexture("cocosui/sliderProgress.png");
|
||||
|
@ -328,11 +328,11 @@ void SpritePolygonTestSlider::makeSprites(const std::string* list, const int cou
|
|||
}
|
||||
}
|
||||
|
||||
void SpritePolygonTestSlider::changeEpsilon(axis::Ref* pSender, axis::ui::Slider::EventType type)
|
||||
void SpritePolygonTestSlider::changeEpsilon(ax::Ref* pSender, ax::ui::Slider::EventType type)
|
||||
{
|
||||
if (type == axis::ui::Slider::EventType::ON_PERCENTAGE_CHANGED)
|
||||
if (type == ax::ui::Slider::EventType::ON_PERCENTAGE_CHANGED)
|
||||
{
|
||||
axis::ui::Slider* slider = dynamic_cast<axis::ui::Slider*>(pSender);
|
||||
ax::ui::Slider* slider = dynamic_cast<ax::ui::Slider*>(pSender);
|
||||
float epsilon = powf(slider->getPercent() / 100.0, 2) * 19.0f + 1.0f;
|
||||
for (auto&&child : _children)
|
||||
{
|
||||
|
@ -350,7 +350,7 @@ void SpritePolygonTestSlider::changeEpsilon(axis::Ref* pSender, axis::ui::Slider
|
|||
}
|
||||
}
|
||||
|
||||
void SpritePolygonTestSlider::updateLabel(const axis::Sprite* sp, const PolygonInfo& pinfo)
|
||||
void SpritePolygonTestSlider::updateLabel(const ax::Sprite* sp, const PolygonInfo& pinfo)
|
||||
{
|
||||
Label* label = (Label*)(sp->getChildByName(sp->getName()));
|
||||
auto filename = sp->getName();
|
||||
|
|
|
@ -36,7 +36,7 @@ protected:
|
|||
std::string _subtitle;
|
||||
bool _isDebugDraw;
|
||||
bool _isNeedDebugMenu;
|
||||
axis::Vector<axis::DrawNode*> _drawNodes;
|
||||
ax::Vector<ax::DrawNode*> _drawNodes;
|
||||
virtual std::string title() const override { return _title; };
|
||||
virtual std::string subtitle() const override { return _subtitle; };
|
||||
virtual bool init() override;
|
||||
|
@ -50,9 +50,9 @@ protected:
|
|||
class SpritePolygonTestDemo : public SpritePolygonTestCase
|
||||
{
|
||||
protected:
|
||||
axis::Sprite* _polygonSprite;
|
||||
axis::Sprite* _polygonSprite_fix;
|
||||
axis::Sprite* _normalSprite;
|
||||
ax::Sprite* _polygonSprite;
|
||||
ax::Sprite* _polygonSprite_fix;
|
||||
ax::Sprite* _normalSprite;
|
||||
virtual bool init() override;
|
||||
virtual void initSprites(){};
|
||||
void initTouches();
|
||||
|
@ -77,15 +77,15 @@ public:
|
|||
class SpritePolygonTestSlider : public SpritePolygonTestCase
|
||||
{
|
||||
protected:
|
||||
axis::Label* _epsilonLabel;
|
||||
ax::Label* _epsilonLabel;
|
||||
int _tagIndex;
|
||||
axis::Sprite* makeSprite(std::string_view filename, const axis::Vec2& pos);
|
||||
ax::Sprite* makeSprite(std::string_view filename, const ax::Vec2& pos);
|
||||
virtual bool init() override;
|
||||
void initSliders();
|
||||
virtual void initSprites(){};
|
||||
void makeSprites(const std::string* list, const int count, const float y);
|
||||
void changeEpsilon(Ref* pSender, axis::ui::Slider::EventType type);
|
||||
void updateLabel(const axis::Sprite* sp, const axis::PolygonInfo& pinfo);
|
||||
void changeEpsilon(Ref* pSender, ax::ui::Slider::EventType type);
|
||||
void updateLabel(const ax::Sprite* sp, const ax::PolygonInfo& pinfo);
|
||||
};
|
||||
|
||||
class SpritePolygonTest3 : public SpritePolygonTestSlider
|
||||
|
@ -114,11 +114,11 @@ protected:
|
|||
virtual bool init() override;
|
||||
void initTouch();
|
||||
void loadDefaultSprites();
|
||||
void addSpritePolygon(const axis::Vec2& pos);
|
||||
void addSpritePolygon(const ax::Vec2& pos);
|
||||
void update(float dt) override;
|
||||
|
||||
private:
|
||||
axis::PolygonInfo _polygonInfo;
|
||||
ax::PolygonInfo _polygonInfo;
|
||||
int _tagIndex;
|
||||
};
|
||||
|
||||
|
@ -134,7 +134,7 @@ protected:
|
|||
int _triCount;
|
||||
int _pixelCount;
|
||||
float _elapsedTime;
|
||||
axis::Label* _perfLabel;
|
||||
ax::Label* _perfLabel;
|
||||
int _continuousLowDt;
|
||||
float _continuousHighDtTime;
|
||||
float _waitingTime;
|
||||
|
@ -167,8 +167,8 @@ public:
|
|||
SpritePolygonPerformanceTestDynamic();
|
||||
|
||||
protected:
|
||||
axis::Sprite* makeSprite() override;
|
||||
axis::PolygonInfo _pinfo;
|
||||
ax::Sprite* makeSprite() override;
|
||||
ax::PolygonInfo _pinfo;
|
||||
virtual void initIncrementStats() override;
|
||||
};
|
||||
|
||||
|
@ -179,7 +179,7 @@ public:
|
|||
SpritePerformanceTestDynamic();
|
||||
|
||||
protected:
|
||||
virtual axis::Sprite* makeSprite() override;
|
||||
virtual ax::Sprite* makeSprite() override;
|
||||
virtual void initIncrementStats() override;
|
||||
};
|
||||
|
||||
|
@ -255,7 +255,7 @@ protected:
|
|||
float _maDt = 1.0f / 60.0f;
|
||||
float _rmaDt = 1.0f / 60.0f;
|
||||
const float DEST_DT_30FPS = 1.0f / 30.0f;
|
||||
axis::Label* _totalSprites = nullptr;
|
||||
ax::Label* _totalSprites = nullptr;
|
||||
Ticker _contSlow = Ticker(20);
|
||||
Ticker _contFast = Ticker(2);
|
||||
Ticker _around30fps = Ticker(60 * 3);
|
||||
|
|
|
@ -48,8 +48,8 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
void addNewSpriteWithCoords(axis::Vec2 p);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void addNewSpriteWithCoords(ax::Vec2 p);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
};
|
||||
|
||||
class SpriteBatchNode1 : public SpriteTestDemo
|
||||
|
@ -57,8 +57,8 @@ class SpriteBatchNode1 : public SpriteTestDemo
|
|||
public:
|
||||
CREATE_FUNC(SpriteBatchNode1);
|
||||
SpriteBatchNode1();
|
||||
void addNewSpriteWithCoords(axis::Vec2 p);
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void addNewSpriteWithCoords(ax::Vec2 p);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
};
|
||||
|
@ -151,13 +151,13 @@ public:
|
|||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void reorderSprite(float dt);
|
||||
axis::Sprite* makeSpriteZ(int aZ);
|
||||
ax::Sprite* makeSpriteZ(int aZ);
|
||||
|
||||
private:
|
||||
axis::SpriteBatchNode* batchNode;
|
||||
axis::Sprite* sprite1;
|
||||
axis::Sprite* sprite2;
|
||||
axis::Sprite* sprite3;
|
||||
ax::SpriteBatchNode* batchNode;
|
||||
ax::Sprite* sprite1;
|
||||
ax::Sprite* sprite2;
|
||||
ax::Sprite* sprite3;
|
||||
};
|
||||
|
||||
class SpriteBatchNodeReorderIssue767 : public SpriteTestDemo
|
||||
|
@ -293,14 +293,14 @@ public:
|
|||
SpriteNewTexture();
|
||||
virtual ~SpriteNewTexture();
|
||||
void addNewSprite();
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
protected:
|
||||
bool _usingTexture1;
|
||||
axis::Texture2D* _texture1;
|
||||
axis::Texture2D* _texture2;
|
||||
ax::Texture2D* _texture1;
|
||||
ax::Texture2D* _texture2;
|
||||
};
|
||||
|
||||
class SpriteBatchNodeNewTexture : public SpriteTestDemo
|
||||
|
@ -310,13 +310,13 @@ public:
|
|||
SpriteBatchNodeNewTexture();
|
||||
virtual ~SpriteBatchNodeNewTexture();
|
||||
void addNewSprite();
|
||||
void onTouchesEnded(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
protected:
|
||||
axis::Texture2D* _texture1;
|
||||
axis::Texture2D* _texture2;
|
||||
ax::Texture2D* _texture1;
|
||||
ax::Texture2D* _texture2;
|
||||
};
|
||||
|
||||
class SpriteFrameTest : public SpriteTestDemo
|
||||
|
@ -332,8 +332,8 @@ public:
|
|||
void flipSprites(float dt);
|
||||
|
||||
private:
|
||||
axis::Sprite* _sprite1;
|
||||
axis::Sprite* _sprite2;
|
||||
ax::Sprite* _sprite1;
|
||||
ax::Sprite* _sprite2;
|
||||
int _counter;
|
||||
};
|
||||
|
||||
|
@ -655,12 +655,12 @@ public:
|
|||
void reorderSprite(float dt);
|
||||
|
||||
private:
|
||||
axis::Node* _node;
|
||||
axis::Sprite* _sprite1;
|
||||
axis::Sprite* _sprite2;
|
||||
axis::Sprite* _sprite3;
|
||||
axis::Sprite* _sprite4;
|
||||
axis::Sprite* _sprite5;
|
||||
ax::Node* _node;
|
||||
ax::Sprite* _sprite1;
|
||||
ax::Sprite* _sprite2;
|
||||
ax::Sprite* _sprite3;
|
||||
ax::Sprite* _sprite4;
|
||||
ax::Sprite* _sprite5;
|
||||
};
|
||||
|
||||
class SpriteBatchNodeReorderSameIndex : public SpriteTestDemo
|
||||
|
@ -674,12 +674,12 @@ public:
|
|||
void reorderSprite(float dt);
|
||||
|
||||
private:
|
||||
axis::SpriteBatchNode* _batchNode;
|
||||
axis::Sprite* _sprite1;
|
||||
axis::Sprite* _sprite2;
|
||||
axis::Sprite* _sprite3;
|
||||
axis::Sprite* _sprite4;
|
||||
axis::Sprite* _sprite5;
|
||||
ax::SpriteBatchNode* _batchNode;
|
||||
ax::Sprite* _sprite1;
|
||||
ax::Sprite* _sprite2;
|
||||
ax::Sprite* _sprite3;
|
||||
ax::Sprite* _sprite4;
|
||||
ax::Sprite* _sprite5;
|
||||
};
|
||||
|
||||
class SpriteBatchNodeReorderOneChild : public SpriteTestDemo
|
||||
|
@ -691,8 +691,8 @@ public:
|
|||
virtual std::string title() const override;
|
||||
|
||||
private:
|
||||
axis::SpriteBatchNode* _batchNode;
|
||||
axis::Sprite* _reorderSprite;
|
||||
ax::SpriteBatchNode* _batchNode;
|
||||
ax::Sprite* _reorderSprite;
|
||||
};
|
||||
|
||||
class SpriteBatchNodeSkewNegativeScaleChildren : public SpriteTestDemo
|
||||
|
@ -791,10 +791,10 @@ public:
|
|||
virtual std::string subtitle() const override { return "Rotation should based on the anchor point"; };
|
||||
|
||||
protected:
|
||||
axis::Sprite* sprite1;
|
||||
axis::Sprite* sprite2;
|
||||
ax::Sprite* sprite1;
|
||||
ax::Sprite* sprite2;
|
||||
|
||||
axis::Vec3 rotation;
|
||||
ax::Vec3 rotation;
|
||||
};
|
||||
|
||||
class SpriteSlice9Test1 : public SpriteTestDemo
|
||||
|
@ -844,7 +844,7 @@ public:
|
|||
virtual void update(float dt) override;
|
||||
|
||||
private:
|
||||
axis::Sprite* _sprites[3];
|
||||
ax::Sprite* _sprites[3];
|
||||
float _elapsed;
|
||||
};
|
||||
|
||||
|
@ -859,7 +859,7 @@ public:
|
|||
virtual void update(float dt) override;
|
||||
|
||||
private:
|
||||
axis::Sprite* _sprites[3];
|
||||
ax::Sprite* _sprites[3];
|
||||
float _elapsed;
|
||||
};
|
||||
|
||||
|
@ -920,10 +920,10 @@ public:
|
|||
|
||||
protected:
|
||||
float _accum;
|
||||
axis::Sprite* _s1;
|
||||
axis::Sprite* _s2;
|
||||
axis::Sprite* _s3;
|
||||
axis::Sprite* _s4;
|
||||
ax::Sprite* _s1;
|
||||
ax::Sprite* _s2;
|
||||
ax::Sprite* _s3;
|
||||
ax::Sprite* _s4;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -78,7 +78,7 @@ std::string TerrainSimple::subtitle() const
|
|||
return "Drag to walkThru";
|
||||
}
|
||||
|
||||
void TerrainSimple::onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void TerrainSimple::onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
float delta = Director::getInstance()->getDeltaTime();
|
||||
auto touch = touches[0];
|
||||
|
@ -168,9 +168,9 @@ TerrainWalkThru::TerrainWalkThru()
|
|||
addChild(_terrain);
|
||||
}
|
||||
|
||||
void TerrainWalkThru::onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event) {}
|
||||
void TerrainWalkThru::onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event) {}
|
||||
|
||||
void TerrainWalkThru::onTouchesEnd(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void TerrainWalkThru::onTouchesEnd(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
auto touch = touches[0];
|
||||
auto location = touch->getLocationInView();
|
||||
|
@ -372,7 +372,7 @@ std::string TerrainWithLightMap::subtitle() const
|
|||
{
|
||||
return "Drag to walkThru";
|
||||
}
|
||||
void TerrainWithLightMap::onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event)
|
||||
void TerrainWithLightMap::onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event)
|
||||
{
|
||||
float delta = Director::getInstance()->getDeltaTime();
|
||||
auto touch = touches[0];
|
||||
|
|
|
@ -46,11 +46,11 @@ public:
|
|||
TerrainSimple();
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
axis::Terrain* _terrain;
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
ax::Terrain* _terrain;
|
||||
|
||||
protected:
|
||||
axis::Camera* _camera;
|
||||
ax::Camera* _camera;
|
||||
};
|
||||
|
||||
# define PLAYER_STATE_LEFT 0
|
||||
|
@ -59,10 +59,10 @@ protected:
|
|||
# define PLAYER_STATE_FORWARD 3
|
||||
# define PLAYER_STATE_BACKWARD 4
|
||||
|
||||
class Player : public axis::MeshRenderer
|
||||
class Player : public ax::MeshRenderer
|
||||
{
|
||||
public:
|
||||
static Player* create(const char* file, axis::Camera* cam, axis::Terrain* terrain);
|
||||
static Player* create(const char* file, ax::Camera* cam, ax::Terrain* terrain);
|
||||
virtual bool isDone() const;
|
||||
virtual void update(float dt);
|
||||
|
||||
|
@ -71,14 +71,14 @@ public:
|
|||
void forward();
|
||||
void backward();
|
||||
void idle();
|
||||
axis::Vec3 _targetPos;
|
||||
ax::Vec3 _targetPos;
|
||||
void updateState();
|
||||
float _headingAngle;
|
||||
axis::Vec3 _headingAxis;
|
||||
ax::Vec3 _headingAxis;
|
||||
|
||||
private:
|
||||
axis::Terrain* _terrain;
|
||||
axis::Camera* _cam;
|
||||
ax::Terrain* _terrain;
|
||||
ax::Camera* _cam;
|
||||
int _playerState;
|
||||
};
|
||||
|
||||
|
@ -89,12 +89,12 @@ public:
|
|||
TerrainWalkThru();
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void onTouchesBegan(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesEnd(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesBegan(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
void onTouchesEnd(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
axis::Camera* _camera;
|
||||
axis::Terrain* _terrain;
|
||||
ax::Camera* _camera;
|
||||
ax::Terrain* _terrain;
|
||||
Player* _player;
|
||||
};
|
||||
|
||||
|
@ -105,11 +105,11 @@ public:
|
|||
TerrainWithLightMap();
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
void onTouchesMoved(const std::vector<axis::Touch*>& touches, axis::Event* event);
|
||||
void onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event);
|
||||
|
||||
protected:
|
||||
axis::Terrain* _terrain;
|
||||
axis::Camera* _camera;
|
||||
ax::Terrain* _terrain;
|
||||
ax::Camera* _camera;
|
||||
};
|
||||
|
||||
#endif // !TERRAIN_TESH_H
|
||||
|
|
|
@ -35,21 +35,21 @@ DEFINE_TEST_SUITE(TextInputTests);
|
|||
// KeyboardNotificationLayer for test IME keyboard notification.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class KeyboardNotificationLayer : public TestCase, public axis::IMEDelegate
|
||||
class KeyboardNotificationLayer : public TestCase, public ax::IMEDelegate
|
||||
{
|
||||
public:
|
||||
KeyboardNotificationLayer();
|
||||
virtual std::string title() const override;
|
||||
virtual void onClickTrackNode(bool bClicked, const axis::Vec2& touchPos) = 0;
|
||||
virtual void onClickTrackNode(bool bClicked, const ax::Vec2& touchPos) = 0;
|
||||
|
||||
virtual void keyboardWillShow(axis::IMEKeyboardNotificationInfo& info) override;
|
||||
virtual void keyboardWillShow(ax::IMEKeyboardNotificationInfo& info) override;
|
||||
|
||||
bool onTouchBegan(axis::Touch* touch, axis::Event* event);
|
||||
void onTouchEnded(axis::Touch* touch, axis::Event* event);
|
||||
bool onTouchBegan(ax::Touch* touch, ax::Event* event);
|
||||
void onTouchEnded(ax::Touch* touch, ax::Event* event);
|
||||
|
||||
protected:
|
||||
axis::Node* _trackNode;
|
||||
axis::Vec2 _beginPos;
|
||||
ax::Node* _trackNode;
|
||||
ax::Vec2 _beginPos;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -62,7 +62,7 @@ public:
|
|||
CREATE_FUNC(TextFieldTTFDefaultTest);
|
||||
// KeyboardNotificationLayer
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void onClickTrackNode(bool bClicked, const axis::Vec2& touchPos) override;
|
||||
virtual void onClickTrackNode(bool bClicked, const ax::Vec2& touchPos) override;
|
||||
|
||||
// Layer
|
||||
virtual void onEnter() override;
|
||||
|
@ -72,10 +72,10 @@ public:
|
|||
// TextFieldTTFActionTest
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class TextFieldTTFActionTest : public KeyboardNotificationLayer, public axis::TextFieldDelegate
|
||||
class TextFieldTTFActionTest : public KeyboardNotificationLayer, public ax::TextFieldDelegate
|
||||
{
|
||||
axis::TextFieldTTF* _textField;
|
||||
axis::Action* _textFieldAction;
|
||||
ax::TextFieldTTF* _textField;
|
||||
ax::Action* _textFieldAction;
|
||||
bool _action;
|
||||
size_t _charLimit; // the textfield max char limit
|
||||
|
||||
|
@ -85,18 +85,18 @@ public:
|
|||
|
||||
// KeyboardNotificationLayer
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void onClickTrackNode(bool bClicked, const axis::Vec2& touchPos) override;
|
||||
virtual void onClickTrackNode(bool bClicked, const ax::Vec2& touchPos) override;
|
||||
|
||||
// Layer
|
||||
virtual void onEnter() override;
|
||||
virtual void onExit() override;
|
||||
|
||||
// TextFieldDelegate
|
||||
virtual bool onTextFieldAttachWithIME(axis::TextFieldTTF* sender) override;
|
||||
virtual bool onTextFieldDetachWithIME(axis::TextFieldTTF* sender) override;
|
||||
virtual bool onTextFieldInsertText(axis::TextFieldTTF* sender, const char* text, size_t nLen) override;
|
||||
virtual bool onTextFieldDeleteBackward(axis::TextFieldTTF* sender, const char* delText, size_t nLen) override;
|
||||
virtual bool onDraw(axis::TextFieldTTF* sender);
|
||||
virtual bool onTextFieldAttachWithIME(ax::TextFieldTTF* sender) override;
|
||||
virtual bool onTextFieldDetachWithIME(ax::TextFieldTTF* sender) override;
|
||||
virtual bool onTextFieldInsertText(ax::TextFieldTTF* sender, const char* text, size_t nLen) override;
|
||||
virtual bool onTextFieldDeleteBackward(ax::TextFieldTTF* sender, const char* delText, size_t nLen) override;
|
||||
virtual bool onDraw(ax::TextFieldTTF* sender);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -123,7 +123,7 @@ public:
|
|||
CREATE_FUNC(TextFieldTTSetCursorFromPoint);
|
||||
// KeyboardNotificationLayer
|
||||
virtual std::string subtitle() const override;
|
||||
virtual void onClickTrackNode(bool bClicked, const axis::Vec2& touchPos) override;
|
||||
virtual void onClickTrackNode(bool bClicked, const ax::Vec2& touchPos) override;
|
||||
|
||||
// Layer
|
||||
virtual void onEnter() override;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue