PuzzleSDK
TMXIsoVertexZNew类 参考

#include <TileMapTest2.h>

+ 类 TMXIsoVertexZNew 继承关系图:
+ TMXIsoVertexZNew 的协作图:

Public 成员函数

 CREATE_FUNC (TMXIsoVertexZNew)
 
 TMXIsoVertexZNew ()
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
 ~TMXIsoVertexZNew ()
 
void repositionSprite (float dt)
 
virtual void onEnter () override
 
virtual void onExit () override
 
- Public 成员函数 继承自 TileDemoNew
 TileDemoNew ()
 
virtual ~TileDemoNew ()
 
void onTouchesMoved (const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 

Private 属性

cocos2d::Sprite * _tamara
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 TileMapTest2.h219 行定义.

构造及析构函数说明

◆ TMXIsoVertexZNew()

TMXIsoVertexZNew::TMXIsoVertexZNew ( )

在文件 TileMapTest2.cpp923 行定义.

924{
925 auto map = cocos2d::FastTMXTiledMap::create("TileMaps/iso-test-vertexz.tmx");
926 addChild(map, 0, kTagTileMap);
927
928 auto s = map->getContentSize();
929 map->setPosition( Vec2(-s.width/2,0.0f) );
930 CCLOG("ContentSize: %f, %f", s.width,s.height);
931
932 // because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you
933 // can use any Sprite and it will work OK.
934 auto layer = map->getLayer("Trees");
935 _tamara = layer->getTileAt( Vec2(29.0f,29.0f) );
936 _tamara->retain();
937
938 auto move = MoveBy::create(10, Vec2(300,250) * (1/CC_CONTENT_SCALE_FACTOR()));
939 auto back = move->reverse();
940 auto seq = Sequence::create(move, back,nullptr);
941 _tamara->runAction( RepeatForever::create(seq) );
942
943 schedule( CC_SCHEDULE_SELECTOR(TMXIsoVertexZNew::repositionSprite));
944
945}
@ kTagTileMap
void repositionSprite(float dt)
cocos2d::Sprite * _tamara
Definition: TileMapTest2.h:221

引用了 _tamara, kTagTileMap , 以及 repositionSprite().

+ 函数调用图:

◆ ~TMXIsoVertexZNew()

TMXIsoVertexZNew::~TMXIsoVertexZNew ( )

在文件 TileMapTest2.cpp947 行定义.

948{
949 _tamara->release();
950}

引用了 _tamara.

成员函数说明

◆ CREATE_FUNC()

TMXIsoVertexZNew::CREATE_FUNC ( TMXIsoVertexZNew  )

◆ onEnter()

void TMXIsoVertexZNew::onEnter ( )
overridevirtual

重载 TestCase .

在文件 TileMapTest2.cpp962 行定义.

963{
965
966 // TIP: 2d projection should be used
967 Director::getInstance()->setProjection(Director::Projection::_2D);
968 Director::getInstance()->getRenderer()->setDepthTest(true);
969 Director::getInstance()->getRenderer()->setDepthWrite(true);
970}
virtual void onEnter() override
Definition: BaseTest.cpp:430

引用了 TestCase::onEnter().

+ 函数调用图:

◆ onExit()

void TMXIsoVertexZNew::onExit ( )
overridevirtual

重载 TileDemoNew .

在文件 TileMapTest2.cpp972 行定义.

973{
974 // At exit use any other projection.
975 Director::getInstance()->setProjection(Director::Projection::DEFAULT);
976 Director::getInstance()->getRenderer()->setDepthTest(false);
977 Director::getInstance()->getRenderer()->setDepthWrite(false);
979}
virtual void onExit() override

引用了 TileDemoNew::onExit().

+ 函数调用图:

◆ repositionSprite()

void TMXIsoVertexZNew::repositionSprite ( float  dt)

在文件 TileMapTest2.cpp952 行定义.

953{
954 // tile height is 64x32
955 // map size: 30x30
956 auto p = _tamara->getPosition();
957 p = CC_POINT_POINTS_TO_PIXELS(p);
958 float newZ = -(p.y+32) /16;
959 _tamara->setPositionZ( newZ );
960}

引用了 _tamara.

被这些函数引用 TMXIsoVertexZNew().

+ 这是这个函数的调用关系图:

◆ subtitle()

std::string TMXIsoVertexZNew::subtitle ( ) const
overridevirtual

重载 TileDemoNew .

在文件 TileMapTest2.cpp986 行定义.

987{
988 return "Doesn't support yet";
989}

◆ title()

std::string TMXIsoVertexZNew::title ( ) const
overridevirtual

重载 TileDemoNew .

在文件 TileMapTest2.cpp981 行定义.

982{
983 return "TMX Iso VertexZ";
984}

类成员变量说明

◆ _tamara

cocos2d::Sprite* TMXIsoVertexZNew::_tamara
private

在文件 TileMapTest2.h221 行定义.

被这些函数引用 repositionSprite(), TMXIsoVertexZNew() , 以及 ~TMXIsoVertexZNew().


该类的文档由以下文件生成: