C++ (Cpp) wySprite Example

Introduction

The c++ (cpp) wysprite example is extracted from the most popular open source projects, you can refer to the following example for usage.

Programming language: C++ (Cpp)

Class/type: wySprite

Example#1
File: GridActionDemos.cppProject: AllenChanAncA/WiEngine

        wyActionTestLayer() {
            m_Sprite = wySprite::make(wyTexture2D::make(RES("R.drawable.grossini")));
            m_Sprite->retain();
            addChildLocked(m_Sprite, 2);
            m_Sprite->setPosition(wyDevice::winWidth / 2, wyDevice::winHeight/ 2);
			m_Sprite->setScale(4);

        	wySprite* bg = wySprite::make(wyTexture2D::make(RES("R.drawable.background")));
        	bg->setPosition(wyDevice::winWidth / 2, wyDevice::winHeight / 2);
        	addChildLocked(bg, -1);
        }

Example#2
File: EaseActionDemos.cppProject: widerules/droidloft

 wyEaseTestLayer(){
     m_Sprite = wySprite::make(wyTexture2D::makePNG(RES("R.drawable.grossini")));
     m_Sprite->retain();
     addChildLocked(m_Sprite);
     m_Sprite->setPosition(60, wyDevice::winHeight/ 2);
 };