Example #1
0
File: osgcopy.cpp Project: 3dcl/osg
 virtual osg::Referenced*     operator() (const osg::Referenced* ref) const
 {
     writeIndent(); std::cout << "copying Referenced "<<ref<<std::endl;
     moveIn();
     osg::Referenced* ret_ref = CopyOp::operator()(ref);
     moveOut();
     return ret_ref;
 }
Example #2
0
File: osgcopy.cpp Project: 3dcl/osg
 virtual osg::StateSet*       operator() (const osg::StateSet* stateset) const
 {
     writeIndent(); std::cout << "copying StateSet "<<stateset;
     if (stateset) std::cout<<" "<<stateset->className();
     std::cout<<std::endl;
     moveIn();
     osg::StateSet* ret_stateset = CopyOp::operator()(stateset);
     moveOut();
     return ret_stateset;
 }
Example #3
0
File: osgcopy.cpp Project: 3dcl/osg
 virtual osg::Drawable*       operator() (const osg::Drawable* drawable) const
 {
     writeIndent(); std::cout << "copying Drawable "<<drawable;
     if (drawable) std::cout<<" "<<drawable->className();
     std::cout<<std::endl;
     moveIn();
     osg::Drawable* ret_drawable = CopyOp::operator()(drawable);
     moveOut();
     return ret_drawable;
 }
Example #4
0
File: osgcopy.cpp Project: 3dcl/osg
 virtual osg::Node*           operator() (const osg::Node* node) const
 {
     writeIndent(); std::cout << "copying Node "<<node;
     if (node) std::cout<<" "<<node->className()<<" '"<<node->getName()<<"'";
     std::cout<<std::endl;
     moveIn();
     osg::Node* ret_node = CopyOp::operator()(node);
     moveOut();
     return ret_node;
 }
Example #5
0
File: osgcopy.cpp Project: 3dcl/osg
 virtual osg::Object*         operator() (const osg::Object* obj) const
 {
     writeIndent(); std::cout << "copying Object "<<obj;
     if (obj) std::cout<<" "<<obj->className();
     std::cout<<std::endl;
     moveIn();
     osg::Object* ret_obj = CopyOp::operator()(obj);
     moveOut();
     return ret_obj;
 }
Example #6
0
File: osgcopy.cpp Project: 3dcl/osg
 virtual osg::Image*          operator() (const osg::Image* image) const
 {
     writeIndent(); std::cout << "copying Image "<<image;
     if (image) std::cout<<" "<<image->className();
     std::cout<<std::endl;
     moveIn();
     osg::Image* ret_image = CopyOp::operator()(image);
     moveOut();
     return ret_image;
 }
Example #7
0
File: osgcopy.cpp Project: 3dcl/osg
 virtual osg::Texture*        operator() (const osg::Texture* text) const
 {
     writeIndent(); std::cout << "copying Texture "<<text;
     if (text) std::cout<<" "<<text->className();
     std::cout<<std::endl;
     moveIn();
     osg::Texture* ret_text = CopyOp::operator()(text);
     moveOut();
     return ret_text;
 }
Example #8
0
File: osgcopy.cpp Project: 3dcl/osg
 virtual osg::StateAttribute* operator() (const osg::StateAttribute* attr) const
 {
     writeIndent(); std::cout << "copying StateAttribute "<<attr;
     if (attr) std::cout<<" "<<attr->className();
     std::cout<<std::endl;
     moveIn();
     osg::StateAttribute* ret_attr = CopyOp::operator()(attr);
     moveOut();
     return ret_attr;
 }
Example #9
0
void LevelEditor::wheelScrolled(QWheelEvent *event)
{
    if (currentView == EDITING_LEVEL_VIEW)
    {
        if (event->delta() < 0)
            moveIn();
        else
            moveOut();

        checkMousePosition(lastMouseX, lastMouseY);
    }
}
Example #10
0
bool ShoppingLayer::init()
{
	if (!CCLayer::init())
		return false;
	
	payID = "001";

	moveIn(this);
	//窗口大小
	CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
	//当前层的位置
	CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();

	CCLayerColor* layercolor = CCLayerColor::create(ccc4(0,0,0,150),800,480) ;
	addChild(layercolor) ;

	Shopping& shopping = RunningData::getInstance()->getShopping();
	const ShoppingInfo& si = shopping.getShoppingInfo(shopping.getCatalog(), shopping.getIndex());
	
	ui = TouchGroup::create();
	if(shopping.getCatalog() == k_supply && shopping.getIndex() == k_give_gift)
	{
			ui->addWidget(GUIReader::shareReader()->widgetFromJsonFile("UI/GameMainMenu_1/activateGame.ExportJson"));
			registerTouchEvent(ui, "shop_cancel", this, ShoppingLayer::buttonClicked);
			registerTouchEvent(ui, "shop_buy", this, ShoppingLayer::buttonClicked);
	} else 
	{
		ui->addWidget(GUIReader::shareReader()->widgetFromJsonFile("UI/GameMainMenu_1/Shop.ExportJson"));
		registerTouchEvent(ui, "shop_cancel", this, ShoppingLayer::buttonClicked);
		registerTouchEvent(ui, "shop_buy", this, ShoppingLayer::buttonClicked);

		UIImageView* pShopTitleBig = imageObj_name(ui, "shop_title_big");
		UIImageView* pShopTitleSmalle = imageObj_name(ui, "shop_title_smalle");
		//UILabel* pDescriptionTwo = labelObj_name(ui, "shop_description");
		//UIImageView* pShopNumYuan = imageObj_name(ui, "shop_num_yuan");

		UIImageView* pGoldShow = imageObj_name(ui, "gold_show");
		UIImageView* pUniquekillShow = imageObj_name(ui, "uniquekill_show");
		UIImageView* pShieldShow = imageObj_name(ui, "shield_show");
		pGoldShow->setVisible(false);
		pUniquekillShow->setVisible(false);
		pShieldShow->setVisible(false);
		

		pShopTitleBig->loadTexture(si.title_big.c_str(), UI_TEX_TYPE_PLIST);
	//	pDescriptionTwo->setText(si.shop_description_1);
		//pShopNumYuan->loadTexture(si.num_yuan.c_str());

		if(shopping.getCatalog() == k_supply)
		{
			if(shopping.getIndex() == k_give_gift || shopping.getIndex() == k_give_big_gife)
			{
				pShopTitleSmalle->setVisible(false);

				if( shopping.getIndex() == k_give_big_gife)
				{
					pGoldShow->setVisible(true);
					pUniquekillShow->setVisible(true);
					pShieldShow->setVisible(true);

// 					UILabel* pDescriptionOne = labelObj_name(ui, "shop_description_1");
// 					UILabel* pDescriptionTwo = labelObj_name(ui, "shop_description_2");
// 					UILabel* pDescriptionThree = labelObj_name(ui, "shop_description_3");
// 				
// 					pDescriptionOne->setText(si.shop_description_1);
// 					pDescriptionOne->setPositionY(pGoldShow->getPositionY()-4);
// 					pDescriptionOne->setPositionX(pDescriptionOne->getPositionX() + 116);
// 					pDescriptionOne->setTextHorizontalAlignment(kCCTextAlignmentLeft);
// 
// 					pDescriptionTwo->setText(si.shop_description_2);
// 					pDescriptionTwo->setPositionY(pUniquekillShow->getPositionY()-4);
// 					pDescriptionTwo->setPositionX(pDescriptionTwo->getPositionX() + 116);
// 					pDescriptionTwo->setTextHorizontalAlignment(kCCTextAlignmentLeft);
// 
// 					pDescriptionThree->setText(si.shop_description_3);
// 					pDescriptionThree->setPositionY(pShieldShow->getPositionY()-4);
// 					pDescriptionThree->setPositionX(pDescriptionThree->getPositionX()+116);
// 					pDescriptionThree->setTextHorizontalAlignment(kCCTextAlignmentLeft);

				}

			} else
			{
				if(shopping.getIndex() == k_thinksgiving)
				{
// 					UILabel* pDescriptionThree = labelObj_name(ui, "shop_description_3");
// 					pDescriptionThree->setText(si.shop_description_2);
// 					pDescriptionThree->setPositionY(pDescriptionThree->getPositionY()+4);
				}
			
				if(shopping.getIndex() == k_getGold)
				{
					pShopTitleSmalle->setPositionY(pShopTitleSmalle->getPositionY()-15);
				//	pDescriptionTwo->setPositionY(pDescriptionTwo->getPositionY()-20);
					//pDescriptionTwo->setPositionX(pDescriptionTwo->getPositionX()-3);
				}
  
				if(shopping.getIndex() == k_unique_kill || shopping.getIndex() == k_shield)
				{
					pShopTitleSmalle->setPositionY(pShopTitleSmalle->getPositionY()-15);
				//	pDescriptionTwo->setPositionY(pDescriptionTwo->getPositionY()-20);
				//	pDescriptionTwo->setPositionX(pDescriptionTwo->getPositionX()-3);
				}

				if(shopping.getIndex() == k_rebirth)
				{
					pShopTitleSmalle->setPositionY(pShopTitleSmalle->getPositionY()-15);
					//pDescriptionTwo->setPositionY(pDescriptionTwo->getPositionY()-20);
					//pDescriptionTwo->setPositionX(pDescriptionTwo->getPositionX()+3);
				}

				pShopTitleSmalle->loadTexture(si.title_smalle.c_str(), UI_TEX_TYPE_PLIST);
			}
	
		} else
		{
			pShopTitleSmalle->loadTexture(si.title_smalle.c_str(), UI_TEX_TYPE_PLIST);
	
		}



		if(shopping.getCatalog() == 1)
		{
// 			UILabel* pDescriptionThree = labelObj_name(ui, "shop_description_3");
// 			pDescriptionThree->setText(si.shop_description_2);
// 			pDescriptionThree->setPositionY(pDescriptionThree->getPositionY()+20);
// 			pDescriptionThree->setPositionX(pDescriptionThree->getPositionX()-5);

			//pDescriptionTwo->setPositionY(pDescriptionTwo->getPositionY() + 12);
			//pDescriptionTwo->setPositionX(pDescriptionTwo->getPositionX()-5);
		}

		if(shopping.getCatalog() == k_role)
		{
// 			CCSprite* pRole = CCSprite::createWithSpriteFrameName("shop_lock_1.png");
// 			pRole->setPosition(pShopTitleSmalle->getPosition());
// 
// 			addChild(pRole,100);
// 			CCArray* pFrames = CCArray::createWithCapacity(3);
// 
// 			char tem[50];
// 			for (int i = 1; i < 3; i++)
// 			{
// 				sprintf(tem, "shop_lock_%i.png",i);
// 				CCSpriteFrame *frame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(tem);
// 				pFrames->addObject(frame);
// 			}
// 			CCAnimation *pAnimation = CCAnimation::createWithSpriteFrames(pFrames, 1.0 / 24.0);
// 
// 			pRole->runAction(CCRepeatForever::create(CCAnimate::create(pAnimation)));


	
		}

	}
	
	
	addChild(ui, 2);

	sInstance = this;

	return true;
}
Example #11
0
void LevelEditor::keyPressed(QKeyEvent *event)
{
    if (isMoving)
        return;

    currentError.clear();
    int key = event->key();

    switch (key)
    {
    case Qt::Key_Escape:
        buttonBackTriggered();
        break;

    case Qt::Key_Backspace:
        if (currentView == SET_NAME_VIEW)
        {
            emit playEffect(EFFECT_JUMP);
            currentName = currentName.left(currentName.length() - 1);

            formSetLevelName->~CubeStringList();
            formSetLevelName = new CubeStringList(currentName, 14.0f, 6.0f, alphabet, 2.0f, FORM_SET_LEVEL_NAME);
        }
        else
        {
            buttonBackTriggered();
        }

        break;

    case Qt::Key_Enter:
    case Qt::Key_Return:
        buttonNextTriggered();
        break;

    case Qt::Key_Up:
        if (currentView == SET_PARAM_VIEW)
        {
            lengthen();
        }
        else if (currentView == EDITING_LEVEL_VIEW)
        {
            moveIn();
            checkMousePosition(lastMouseX, lastMouseY);
        }

        break;

    case Qt::Key_Down:
        if (currentView == SET_PARAM_VIEW)
        {
            shorten();
        }
        else if (currentView == EDITING_LEVEL_VIEW)
        {
            moveOut();
            checkMousePosition(lastMouseX, lastMouseY);
        }

        break;

    case Qt::Key_Left:

        if (currentView == SET_PARAM_VIEW)
            reduce();
        else if (currentView == SET_GRAVITY_VIEW)
            gravityMinus();
        break;

    case Qt::Key_Right:


        if (currentView == SET_PARAM_VIEW)
            enlarge();
        else if (currentView == SET_GRAVITY_VIEW)
            gravityPlus();
        break;

    default:
        if ((key >= Qt::Key_A && key <= Qt::Key_Z) || (key >= Qt::Key_0 && key <= Qt::Key_9) || key == Qt::Key_Space)
            letterTyped(key);
        break;
    }
}