当前位置: 首页>>代码示例>>C++>>正文


C++ CImageView::setPosition方法代码示例

本文整理汇总了C++中CImageView::setPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CImageView::setPosition方法的具体用法?C++ CImageView::setPosition怎么用?C++ CImageView::setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CImageView的用法示例。


在下文中一共展示了CImageView::setPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

CImageView *TuiManager::createImage(float tag, const char* file, float scaleX, float scaleY,float x, float y, float rotation){
	CImageView *pImg = m_isUseSpriteFrame ? CImageView::createWithSpriteFrameName(file) : CImageView::create(file);
	Size size = pImg->getContentSize();
	pImg->setPosition(Point(x,-y));
	pImg->setScale(scaleX, scaleY);
	pImg->setRotation(rotation);
	pImg->setTag(tag);
	return pImg;
}
开发者ID:Kudoo,项目名称:Tui-x,代码行数:9,代码来源:TuiManager.cpp

示例2:

CImageView *TuiManager::createImage(float tag, const char* file, float scaleX, float scaleY, int flipX, int flipY, float x, float y, float rotation, int isUseFrame){
	CImageView *pImg = isUseFrame ? CImageView::createWithSpriteFrameName(file) : CImageView::create(file);
	Size size = pImg->getContentSize();
	pImg->setPosition(Vec2(x,-y));
	pImg->setFlippedX(flipX == 1);
	pImg->setFlippedY(flipY == 1);
	pImg->setScale(scaleX, scaleY);
	pImg->setRotation(rotation);
	pImg->setTag(tag);
	return pImg;
}
开发者ID:zh0ub1n,项目名称:Tui-x,代码行数:11,代码来源:TuiManager.cpp

示例3: init

bool CSignLayer::init()
{
	if (BaseLayer::init())
	{
		MaskLayer* lay = MaskLayer::create("CSignLayermask");
		lay->setContentSize(CCSizeMake(2824,640));
		LayerManager::instance()->push(lay);

		m_ui = LoadComponent("Sign.xaml");  //  SelectSkill
		m_ui->setPosition(VCENTER);
		this->addChild(m_ui);
		this->setOpacity(180);

		//背景框
		CImageView* pImageRect = (CImageView*)m_ui->findWidgetById("board_sign");

		//添加一个裁切层
		CCClippingNode* pClip = CCClippingNode::create();
		CImageView* pImage = UICloneMgr::cloneImageView(pImageRect);
		pImage->setAnchorPoint(ccp(0.5f, 0.5f));
		pImage->setPosition(ccp(pImage->getContentSize().width/2, pImage->getContentSize().height/2));
		pClip->setStencil(pImage);
		pClip->setContentSize(pImageRect->getContentSize());
		pClip->setAnchorPoint(pImageRect->getAnchorPoint());
		pClip->setPosition(pImageRect->getPosition());
		pImageRect->getParent()->addChild(pClip, pImageRect->getZOrder()+1);
		m_pClip = pClip;
		
		//展示区图片
		m_show_info_scroll = (CScrollView*)m_ui->findWidgetById("scroll_info");
		m_show_info_scroll->setDirection(eScrollViewDirectionVertical);
		m_show_info_scroll->setBounceable(true);

		m_pInfo1 = (CLabel*)m_ui->findWidgetById("info_1");
		CC_SAFE_RETAIN(m_pInfo1);
		m_pInfo1->removeFromParentAndCleanup(false);
		m_show_info_scroll->getContainer()->addChild(m_pInfo1);
		m_pInfo1->setAnchorPoint(ccp(0, 1));
		CC_SAFE_RELEASE(m_pInfo1);

		m_pInfo2 = (CLabel*)m_ui->findWidgetById("info_2");
		CC_SAFE_RETAIN(m_pInfo2);
		m_pInfo2->removeFromParentAndCleanup(false);
		m_show_info_scroll->getContainer()->addChild(m_pInfo2);
		m_pInfo2->setAnchorPoint(ccp(0, 1));
		CC_SAFE_RELEASE(m_pInfo2);

		updateShowInfoScroll();

		m_show_info_scroll->setVisible(false);

		CCNode* pMaskInfo = (CCNode*)m_ui->findWidgetById("mask_info");
		pMaskInfo->setVisible(false);

		m_pLineEffect = new CLineLightEffect;
		m_pLineEffect->bindUI(m_ui);
		m_pLineEffect->bindRectEffect(pImageRect);
		this->addChild(m_pLineEffect, 999);


		m_pYellowTip = CCSprite::create("sign/lightbox5.png");
		m_pYellowTip->setAnchorPoint(ccp(0.5f, 0.0f));
		m_pYellowTip->setScale(0.8f);
		m_pYellowTip->runAction(CCRepeatForever::create(CCSequence::createWithTwoActions(CCMoveBy::create(0.3f, ccp(0, -10)), CCMoveBy::create(0.3f, ccp(0, 10)))));
		m_ui->addChild(m_pYellowTip, 50);
		m_pYellowTipText = UICloneMgr::cloneLable((CLabel*)m_ui->findWidgetById("day1"));
		m_pYellowTipText->setAnchorPoint(ccp(0.5f, 0.5f));
		m_pYellowTipText->setPosition(ccp(m_pYellowTip->getContentSize().width/2, m_pYellowTip->getContentSize().height/2+12));
		m_pYellowTipText->setScale(1.2f);
		m_pYellowTip->addChild(m_pYellowTipText);
		m_pYellowTip->setVisible(false);

		return true;
	}
	return false;

}
开发者ID:54993306,项目名称:Classes,代码行数:77,代码来源:SignLayer.cpp


注:本文中的CImageView::setPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。