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


C++ LayerColor::getPositionY方法代码示例

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


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

示例1: initTitulo

void Ajustes::initTitulo(){
    LayerColor *capaPosTitulo = LayerColor::create(Color4B(23, 70, 108, 210), cuadroJuego->getContentSize().width-(espacioBordesCuadro*escala*2), 200*escala);
    capaPosTitulo->setAnchorPoint(Vec2(0,1));
    capaPosTitulo->setPosition(anchoLateralCE+(espacioSuperiorBtAtras*escala),visibleSize.height-(200*escala)-(espacioSuperiorBtAtras*escala));
    capaPosTitulo->setZOrder(1);
    this->addChild(capaPosTitulo);
    

    tituloEscena = CCLabelTTF::create(LanguageManager::getInstance()->getString("AjustesLbTitulo"), "HVD_Comic_Serif_Pro.ttf", 130*escala,CCSizeMake(anchoNoLateralCE, capaPosTitulo->getContentSize().height), TextHAlignment::CENTER);
    tituloEscena->setColor(Color3B(216,254,51));
    tituloEscena->setVerticalAlignment(TextVAlignment::CENTER);
    tituloEscena->setAnchorPoint(Vec2(0, 0));
    tituloEscena->setPosition(anchoLateralCE,capaPosTitulo->getPositionY());
    tituloEscena->setZOrder(10);
    this->addChild(tituloEscena, 1);
    tituloEscena->retain();

}
开发者ID:si2info,项目名称:info.si2.mostrosity,代码行数:18,代码来源:Ajustes.cpp

示例2: buildScene

void FriendListScene::buildScene()
{
    _friendDictionary.clear();
    _friendList.clear();
    _tableView = NULL;
    _downloadCount = 0;
    
    const char* headerString = "";
    
    switch (_selectedFriendCircle)
    {
        case ALL_FRIENDS:
            headerString = "All Friends";
            break;
        
        case INSTALLED_ONLY:
            headerString = "Friends Playing Game";
            break;
            
        case NON_PLAYING_ONLY:
            headerString = "Friends not Playing Game";
            break;
            
        case MY_DEVICE_ONLY:
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
            headerString = "Friends playing on iOS Device";
#else
            headerString = "Friends playing on Android Device";
#endif
        default:
            break;
    }
    
    //_friendList = CCArray::createWithCapacity(5);
    //_friendList->retain();
    CCLOG("ALL Request count = %lu", _friendList.size());
    
    // Add background layers to the scene.
    LayerColor *bg = LayerColor::create(Color4B(255, 255, 255, 255), AppDelegate::SCREEN_WIDTH, AppDelegate::SCREEN_HEIGHT);
    this->addChild(bg);
    
    LayerColor *secondBG = LayerColor::create(Color4B(95, 95, 95, 255),
                                                  AppDelegate::SCREEN_WIDTH - SCALED_VALUE(20.0f),
                                                  AppDelegate::SCREEN_HEIGHT - SCALED_VALUE(20.0f));
    
    secondBG->setPosition(Point(SCALED_VALUE(10.0f), SCALED_VALUE(10.0f)));
    this->addChild(secondBG);
    
    // Set the table header.
    LayerColor *header = LayerColor::create(Color4B(66, 66, 66, 255),
                                                AppDelegate::SCREEN_WIDTH - SCALED_VALUE(20.0f),
                                                SCALED_VALUE(100.0f));
    header->setAnchorPoint(Point(0, 0));
    header->setPosition(Point(SCALED_VALUE(10.0f), AppDelegate::SCREEN_HEIGHT - SCALED_VALUE(110.0f)));
    this->addChild(header);
    
    // Set the header text.
    auto headerText = LabelTTF::create(headerString, "Arial", SCALED_VALUE(40.0f));
    headerText->setAnchorPoint(Point(0.0f, 0.5f));
    header->addChild(headerText);
    headerText->setPositionX(SCALED_VALUE(28.0f));
    headerText->setPositionY(header->getContentSize().height/2);
    
    // Add back button go back to previous scene
    MenuItemImage *backButton = MenuItemImage::create();
    backButton->setNormalSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("btn_table_back_nrl"));
    backButton->setSelectedSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("btn_table_back_prd"));
    
    backButton->setCallback(CC_CALLBACK_1(FriendListScene::backButtonPressed, this));

    backButton->setAnchorPoint(Point(1.0f, 0.5));
    Menu* backMenu = Menu::create(backButton, NULL);
    header->addChild(backMenu);
    backMenu->setPositionX(header->getContentSize().width - SCALED_VALUE(20.0f));
    backMenu->setPositionY(header->getContentSize().height/2);
    
    
    // Create the table view.
    float tableHeight = bg->getContentSize().height - secondBG->getPositionY() - (header->getContentSize().height) - SCALED_VALUE(10);
    _tableView = TableView::create(this, Size(secondBG->getContentSize().width, tableHeight));
    _tableView->setAnchorPoint(Point(0, 0.0));
    _tableView->setDirection(ScrollView::Direction::VERTICAL);
    _tableView->setPosition(Point(SCALED_VALUE(10.0f), SCALED_VALUE(10)));
    _tableView->setDelegate(this);
    this->addChild(_tableView);
}
开发者ID:ezibyte,项目名称:EziSocialDemo-Cocos2dx-3x,代码行数:86,代码来源:FriendListScene.cpp


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