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


C++ Plotter::setColor方法代码示例

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


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

示例1: draw

 void paddleType::draw (Plotter& g)
 {
     if (oldLoc.getX() != loc.getX())
     {
         g.setColor(color);
         for(int i = -width/2; i <= width/2; i ++)
         {
             g.plot(loc.getX() + i, loc.getY(), SQUARE);
         }
     }
     oldLoc = loc;
 }
开发者ID:Chuks101,项目名称:BREAK_____GAME,代码行数:12,代码来源:paddle.cpp

示例2: backgroundIntro

//Function that prints names
bool backgroundIntro()
{
    ifstream data;
    POINT p;
    Plotter screen;
/*    HWND consoleWnd = GetConsoleWindow();*/

    Sleep(100);
    //PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(yellow);
    screen.move(30,23);
    cout<<"Created By:";
    Sleep(2000);


    Sleep(100);
    //PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(green);
    screen.move(30,25);
    cout<<"Abril Resendiz";
    Sleep(2000);


    // PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(yellow);
    screen.move(30,27);
    cout<<"Daniel Holt";
    Sleep(2000);


  //  PlaySound("C:\\Users\\Alex\\Desktop\\CB\\ProjectFinal\\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(green);
    screen.move(30,29);
    cout<<"Maggie Schmeltekopf";
    Sleep(2000);



    //  PlaySound("C:\\Users\\Alex\\Desktop\\CB\\ProjectFinal\\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(yellow);
    screen.move(30,31);
    cout<<"Victoria Robinson";
    Sleep(2000);


    // PlaySound("C:\Users\Abril Resendiz\SkyDrive\Documents\ProjectFinal\ProjectFinal\\357mag.wav", NULL, SND_ASYNC);
    screen.setColor(green);
    screen.move(30,33);
    cout<<"Emily Peirce";
    Sleep(2000);
    screen.clear();

    return exit;

}
开发者ID:maggieschmeltekopf,项目名称:1430groupproject,代码行数:56,代码来源:Picture.cpp

示例3: Draw

void Ship::Draw(double x, double y)
{
    // draw ship
    Plotter p;




    for (int r = 0; r < 5; r++)
    {
        for (int c = 0; c < 5; c++)
        {
            p.setColor(rocket[r][c]);
            p.plot(x + c, y + r, SQUARE);
        }
    }

}
开发者ID:maggieschmeltekopf,项目名称:1430groupproject,代码行数:18,代码来源:Ship.cpp

示例4: printPicture

//Picture that prints rocket
void printPicture(char ch)
{
    Plotter screen;
    int x=200;
    int y=200;

    if(ch=='@')
      {
          screen.setColor(darkgreen);
          screen.plot(x,y,SQUARE);
          x++;
          y++;
      }
      else if(ch=='0')
      {
          screen.setColor(darkgreen);
          screen.plot(x,y,SQUARE);
          x++;
          y++;

      }
       else if(ch=='8')
      {
          screen.setColor(green);
          screen.plot(x,y,SQUARE);
          x++;
          y++;

      }
       else if(ch=='b')
      {
          screen.setColor(blue);
          screen.plot(x,y,SQUARE);
          x++;
          y++;

      }
       else if(ch=='C')
      {
          screen.setColor(yellow);
          screen.plot(x,y,SQUARE);
          x++;
          y++;

      }
       else if(ch=='G')
      {
          screen.setColor(darkyellow);
          screen.plot(x,y,SQUARE);
          x++;
          y++;

      }
      else if(ch=='O')
      {
          screen.setColor(black);
          screen.plot(x,y,SQUARE);
          x++;
          y++;
      }


      else if(ch=='#')
      {
          screen.setColor(red);
          screen.plot(x,y,SQUARE);
          x++;
          y++;
      }
      else if (ch==';')
      {
          screen.setColor(red);
          screen.plot(x,y,SQUARE);
          x++;
          y++;
      }

      else if(ch==',')
      {
          screen.setColor(white);
          screen.plot(x,y,SQUARE);
          x++;
          y++;
      }

      else if(ch=='+')
      {
        screen.setColor(grey);
         screen.plot(x,y,SQUARE);
         x++;
          y++;
      }
      else if(ch=='`')
      {
         screen.setColor(grey);
         screen.plot(x,y,SQUARE);
         x++;
         y++;
      }
//.........这里部分代码省略.........
开发者ID:maggieschmeltekopf,项目名称:1430groupproject,代码行数:101,代码来源:Picture.cpp


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