本文整理汇总了C++中ccc4函数的典型用法代码示例。如果您正苦于以下问题:C++ ccc4函数的具体用法?C++ ccc4怎么用?C++ ccc4使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ccc4函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CCDictionary
NS_CC_BEGIN
#pragma CATableView
CATableView::CATableView()
:m_pTableHeaderView(NULL)
,m_pTableFooterView(NULL)
,m_pTablePullDownView(NULL)
,m_pTablePullUpView(NULL)
,m_separatorColor(ccc4(127, 127, 127, 255))
,m_nTableHeaderHeight(0)
,m_nTableFooterHeight(0)
,m_nTablePullViewHeight(0)
,m_pTableViewDataSource(NULL)
,m_pTableViewDelegate(NULL)
,m_pBackGroundView(NULL)
,m_pHighlightedTableCells(NULL)
,m_bAllowsSelection(false)
,m_bAllowsMultipleSelection(false)
{
m_pCellDict = new CCDictionary();
}
示例2: initWithMapInformation
void GameScene::initWithMapInformation(int leve, int status, int life)
{
// 开始音乐
CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("start.aif");
// 创建一个颜色层
CCLayerColor *backColor = CCLayerColor::create(ccc4(192, 192, 192, 255));
this->addChild(backColor, 1);
// 精灵帧类,提高效率
CCSpriteFrameCache *frameCache = CCSpriteFrameCache::sharedSpriteFrameCache();
frameCache->addSpriteFramesWithFile("images/images.plist");
// 场景内一些精灵的创建
CCSize wSize = CCDirector::sharedDirector()->getWinSize();
CCSprite *ipLife = CCSprite::createWithSpriteFrameName("IP.png");
ipLife->setPosition(ccp(30, wSize.height - 50));
ipLife->setScale(1.0f);
this->addChild(ipLife, 1);
CCSprite *ipLifeIock = CCSprite::createWithSpriteFrameName("p1.png");
ipLifeIock->setPosition(ccp(20, wSize.height - 70));
ipLifeIock->setScale(0.5f);
this->addChild(ipLifeIock, 1);
this->showLife(life);
CCSprite *flag = CCSprite::createWithSpriteFrameName("flag.png");
flag->setPosition(ccp(wSize.width - 50, wSize.height - 200));
flag->setScale(1.0f);
this->addChild(flag, 1);
this->showLeve(leve);
_mapLayer = MapLayer::create();
_mapLayer->initWithMap(leve, status, life);
_mapLayer->setPosition(ccp(wSize.width/6, 0));
this->addChild(_mapLayer, 1);
}
示例3: UpdateDownPicture
void DirectKey::OnTouchDown(KeyDirect type)
{
if (m_touchDown) return;
m_touchDown = true;
m_keyDirect = type;
UpdateDownPicture();
DealKey(m_keyDirect);
m_timer->SetTimer(this, 1, 1.0f / 60.0f);
if (AutoPathTipObj.IsWorking())
AutoPathTipObj.Stop();
if (m_picCenterNormal)
{
m_picCenterNormal->SetColor(ccc4(255, 255, 255, 255));
}
}
示例4: init
bool MDPauseMenu::init(MDPauseMenuInterfaz* target)
{
if (CCLayerColor::initWithColor(ccc4(0, 0, 0, 200)) )
{
mTarget = target;
Size visibleSize = Director::getInstance()->getVisibleSize();
// Menu items
MenuItemFont *btResume = MenuItemFont::create("Resume",
this,
menu_selector(MDPauseMenu::resumeGame));
btResume->setColor(ccc3(255, 255, 255));
btResume->setAnchorPoint(ccp(0.5, 1));
btResume->setPosition(ccp(0, 0));
MenuItemFont *btRetry = MenuItemFont::create("Retry",
this,
menu_selector(MDPauseMenu::retryGame));
btRetry->setColor(ccc3(255, 255, 255));
btRetry->setAnchorPoint(ccp(0.5, 1));
btRetry->setPosition(ccp(0, btResume->getPosition().y - btResume->getContentSize().height - MENU_ITEMS_SPACING));
MenuItemFont *btExit = MenuItemFont::create("Exit",
this,
menu_selector(MDPauseMenu::quitGame));
btExit->setColor(ccc3(255, 255, 255));
btExit->setAnchorPoint(ccp(0.5, 1));
btExit->setPosition(ccp(0, btRetry->getPosition().y - btRetry->getContentSize().height - MENU_ITEMS_SPACING));
// Menu
Menu *menu = Menu::create(btResume, btRetry, btExit, NULL);
menu->setPosition(ccp(visibleSize.width / 2, visibleSize.height / 2));
addChild(menu);
return true;
}
return false;
}
示例5: ccc4
void ExtensionsTest::viewDidLoad()
{
this->getNavigationBarItem()->setTitle("Json analysis");
size = this->getView()->getBounds().size;
table = CATableView::createWithCenter(CADipRect(size.width*0.5, size.height*0.5, size.width, size.height));
table->setTableViewDataSource(this);
table->setTableViewDelegate(this);
table->setAllowsSelection(true);
table->setSeparatorViewHeight(1);
this->getView()->addSubview(table);
CADipSize nSize = this->getNavigationController()->getNavigationBar()->getBounds().size;
next = CAButton::createWithCenter(CADipRect(nSize.width*0.905, nSize.height*0.5, nSize.height*0.9, nSize.height*0.8), CAButtonTypeCustom);
next->setTag(1000);
next->setImageForState(CAControlStateNormal, CAImage::create("source_material/btn_right_white.png"));
next->setImageColorForState(CAControlStateHighlighted, ccc4(0, 255, 200, 255));
next->addTarget(this, CAControl_selector(ExtensionsTest::nextViewController), CAControlEventTouchUpInSide);
this->getNavigationController()->getNavigationBar()->addSubview(next);
loadJsonData();
}
示例6: SetFrameRect
void DramaRightChat::Initialization()
{
DramaChatLayer::Initialization();
CCSize winsize = CCDirector::sharedDirector()->getWinSizeInPixels();
SetFrameRect(CCRectMake(0, 0, winsize.width, winsize.height));
//ÉèÖñ³¾°
NDUILayer *backlayer = new NDUILayer;
backlayer->Initialization();
backlayer->SetFrameRect(CCRectMake(0, 0, winsize.width*0.9, winsize.height*0.3));
backlayer->SetBackgroundColor(ccc4(0,0,0,60));
AddChild(backlayer, -1);
NDUILoad uiload;
uiload.Load("dramaini/DLG_R.ini", this, NULL);
SetFigureTag(ID_DLG_R_CTRL_PICTURE_PLAYER);
SetTitleTag(ID_DLG_R_CTRL_TEXT_TITAL);
SetContentTag(ID_DLG_R_CTRL_TEXT_DLG);
}
示例7: showHUD
void CommonProgressHUD::showHUD(CCObject* sender) {
CCProgressHUD* hud = CCProgressHUD::show("Loading...");
hud->setPanelColor(ccc4(255, 0, 0, 200));
runAction(CCSequence::create(CCDelayTime::create(2),
CCCallFunc::create(this, callfunc_selector(CommonProgressHUD::changeMessage)),
CCDelayTime::create(2),
CCCallFunc::create(this, callfunc_selector(CommonProgressHUD::changeRichMessage)),
CCDelayTime::create(2),
CCCallFunc::create(this, callfunc_selector(CommonProgressHUD::changePanelColor)),
CCDelayTime::create(2),
CCCallFunc::create(this, callfunc_selector(CommonProgressHUD::changeDimColor)),
CCDelayTime::create(2),
CCCallFunc::create(this, callfunc_selector(CommonProgressHUD::forceSquare)),
CCDelayTime::create(2),
CCCallFunc::create(this, callfunc_selector(CommonProgressHUD::changeIcon)),
CCDelayTime::create(2),
CCCallFunc::create(this, callfunc_selector(CommonProgressHUD::beforeHide)),
CCDelayTime::create(2),
CCCallFunc::create(this, callfunc_selector(CommonProgressHUD::hide)),
NULL));
}
示例8: while
void HallPage::onSendMsgClicked()
{
if(m_sendMsgDialog != 0){
m_sendMsgDialog->destroy();
m_sendMsgDialog = 0;
}
CCNode *root = this->getParent();
while(root->getParent())
root = root->getParent();
if(m_sendMsgDialog == 0){
m_sendMsgDialog = new SendMsgDialog(root,ccc4(0,0,0,128));
m_sendMsgDialog->setCloseCB(this,callfuncND_selector(HallPage::onSendMsgCloseClicked));
m_sendMsgDialog->setSendCB(this,callfuncND_selector(HallPage::onSendMsgSendClicked));
m_sendMsgDialog->setInitShowPage(true);
m_sendMsgDialog->setInitPage(true,false);
std::string name = m_headNick;
if(name.empty())
mailToNickName(m_headMail,name);
m_sendMsgDialog->setRecInfo(m_headId,name,"");
m_sendMsgDialog->exec();
}
}
示例9: init
bool GameOver::init(){
if(!CCLayerColor::initWithColor(ccc4(0, 0, 0, 150))){
return false;
}
setTouchEnabled(true);
CCSize size= CCDirector::sharedDirector()->getWinSize();
label1=CCLabelTTF::create("+10", "黑体", 35);
label1->setPosition(ccp(size.width/2, size.height/2-25));
this->addChild(label1,2);
CCSprite *bg= CCSprite::create("over_bg.png");
bg->setPosition(ccp(size.width/2, size.height/2));
this->addChild(bg,0);
CCMenuItemImage * item=CCMenuItemImage::create("back_up.png", "back_down.png", this, menu_selector(GameOver::goback));
item->setPosition(ccp(0, -200));
menu=CCMenu::create(item,NULL);
this->addChild(menu,1);
return true;
}
示例10: showAlert
void SessionsViewController::initMsgTableView()
{
if (m_msg.empty())
{
showAlert();
return;
}
if (m_msgTableView != NULL)
{
this->getView()->removeSubview(m_msgTableView);
m_msgTableView = NULL;
}
m_msgTableView = CATableView::createWithFrame(DRect(0, _px(120), m_winSize.width, m_winSize.height - _px(120)));
m_msgTableView->setTableViewDataSource(this);
m_msgTableView->setTableViewDelegate(this);
m_msgTableView->setScrollViewDelegate(this);
m_msgTableView->setAllowsSelection(true);
m_msgTableView->setSeparatorColor(ccc4(200, 200, 200, 80));
//m_msgTableView->setSeparatorViewHeight(_px(2));
this->getView()->addSubview(m_msgTableView);
}
示例11: switch
ccColor4B CUIChatText::GetColorByTag(int tag)
{
switch(tag){
case QUALITY_WHITE:
return ccc4(255,255,255,255);
case QUALITY_GREEN:
return ccc4(0,255,0,255);
case QUALITY_BLUE:
return ccc4(0,0,255,255);
case QUALITY_PURPLE:
return ccc4(167,87,168,255);
case QUALITY_GOLDEN:
return ccc4(255,215,0,255);
default:
return ccc4(255,255,255,255);
}
}
示例12: setTouchEnabled
// on "init" you need to initialize your instance
bool Bug914Layer::init()
{
// always call "super" init
// Apple recommends to re-assign "self" with the "super" return value
if (BugsTestBaseLayer::init())
{
setTouchEnabled(true);
// ask director the the window size
CCSize size = CCDirector::sharedDirector()->getWinSize();
CCLayerColor *layer;
for( int i=0;i < 5;i++)
{
layer = CCLayerColor::create(ccc4(i*20, i*20, i*20,255));
layer->setContentSize(CCSizeMake(i*100, i*100));
layer->setPosition(ccp(size.width/2, size.height/2));
layer->setAnchorPoint(ccp(0.5f, 0.5f));
layer->setIsRelativeAnchorPoint(true);
addChild(layer, -1-i);
}
// create and initialize a Label
CCLabelTTF *label = CCLabelTTF::create("Hello World", "Marker Felt", 64);
CCMenuItem *item1 = CCMenuItemFont::create("restart", this, menu_selector(Bug914Layer::restart));
CCMenu *menu = CCMenu::create(item1, NULL);
menu->alignItemsVertically();
menu->setPosition(ccp(size.width/2, 100));
addChild(menu);
// position the label on the center of the screen
label->setPosition(ccp( size.width /2 , size.height/2 ));
// add the label as a child to this Layer
addChild(label);
return true;
}
return false;
}
示例13: init
bool RootWindow::init()
{
if (!CAWindow::init())
{
return false;
}
this->setColor(ccc4(87, 154, 244, 255));
DMTabBarController* tabBarController = new DMTabBarController();
tabBarController->initWithTabBarController();
CANavigationController* nav = new CANavigationController();
nav->initWithRootViewController(tabBarController);
nav->setNavigationBarHidden(true, false);
DMClassificationViewController* classificationViewController = DMClassificationViewController::create();
CADrawerController* drawer = new CADrawerController();
drawer->initWithController(classificationViewController, nav, this->getBounds().size.width * 5/6.0f);
drawer->setBackgroundView(CAView::createWithColor(CAColor_black));
tabBarController->release();
nav->release();
CCRect rect = this->getBounds();
rect.size.height /= 2;
rect.origin.y = rect.size.height;
drawer->getBackgroundView()->addSubview(CAView::createWithFrame(rect));
this->setRootViewController(drawer);
drawer->release();
m_pRootTabBarController = tabBarController;
m_pRootNavigationController = nav;
m_pRootDrawerController = drawer;
return true;
}
示例14: tableCellAtIndex
CATableViewCell* FirstViewController::tableCellAtIndex(CATableView* table, const CCSize& cellSize, unsigned int section, unsigned int row)
{
CADipSize _size = cellSize;
CATableViewCell* cell = table->dequeueReusableCellWithIdentifier("CrossApp");
if (cell == NULL)
{
cell = CATableViewCell::create("CrossApp");
CALabel* test = CALabel::createWithCenter(CADipRect(_size.width*0.5,
_size.height*0.5,
_size.width*0.8,
_size.height));
test->setColor(ccc4(51, 204, 255, 255));
test->setTextAlignment(CATextAlignmentCenter);
test->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
test->setFontSize(_px(40));
test->setTag(100);
cell->addSubview(test);
}
CALabel* test = (CALabel*)cell->getSubviewByTag(100);
test->setText(testList.at(row));
return cell;
}
示例15: viewDidLoad
void ActivityIndicatorViewTest::viewDidLoad()
{
size = this->getView()->getBounds().size;
this->getView()->setColor(ccc4(58,210,129,255));
whiteLarge = CAActivityIndicatorView::createWithCenter(CCRect(size.width*0.5, size.height*0.25,
size.width*0.2, size.width*0.2));
whiteLarge->setStyle(CAActivityIndicatorViewStyleWhiteLarge);
this->getView()->addSubview(whiteLarge);
whiteLarge->startAnimating();
white = CAActivityIndicatorView::createWithCenter(CCRect(size.width*0.5, size.height*0.5,
size.width*0.2,size.width*0.2));
white->setStyle(CAActivityIndicatorViewStyleWhite);
this->getView()->addSubview(white);
white->startAnimating();
gray = CAActivityIndicatorView::createWithCenter(CCRect(size.width*0.5, size.height*0.75,
size.width*0.2, size.width*0.2));
gray->setStyle(CAActivityIndicatorViewStyleGray);
this->getView()->addSubview(gray);
gray->startAnimating();
}