zoukankan      html  css  js  c++  java
  • 9.多彩的幕布layer

    • CCLayerCorlor
      bool CCLayerColor::initWithColor(const ccColor4B & color);
      bool CCLayerColor::initWithColor(const ccColor4B & color, GLfloat w, GLfloat h);
      //例子
      CCLayerColor::initWithColor(ccc4(255, 255, 255, 255));
      CCLayerColor::initWithColor(cc4(255, 255, 255), 100, 100);
      ignoreAnchorPointForPosition(false);
    • CCLayerGradient
      bool CCLayerGradient::initWithColor(const ccColor4B & start, const ccColor4B& end);
      bool CCLayerGradient::initWithColor(const ccColor4B & start,const CCLayerGradient, const CCPoint& v);
      //例子
      CCLayerGradient::initWithColor(ccc4(123, 89, 0, 255), ccc4(0, 255, 255, 255), ccp(10));

    代码例子:

     1 class T4ColorLayer:public CCLayerGradient
     2 {
     3 public:
     4     static CCScene *scene();
     5     CREATE_FUNC(T4ColorLayer);
     6     bool init();
     7 };
     8 
     9 bool T4ColorLayer::init()
    10 {
    11     //CCLayerColor::initWithColor(ccc4(255, 255, 255, 255));
    12     CCLayerGradient::initWithColor(ccc4(255, 0, 0, 255), ccc4(0, 0, 255, 255));
    13     return true;
    14 }
    15  

    运行效果:

  • 相关阅读:
    SCRUM第一天
    第八周总结
    第7周总结
    团队项目nabcd
    人月神话1
    课堂练习之四则运算
    第六周总结
    Storm Grouping —— 流分组策略
    抓取网页内容生成Kindle电子书(转)
    浅析PageRank算法(转)
  • 原文地址:https://www.cnblogs.com/xiaochi/p/8350206.html
Copyright © 2011-2022 走看看