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


C++ TFT::stroke方法代码示例

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


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

示例1: drawPellet

// Draw a 9x9 pellet
void Board::drawPellet(Pellet pellet){
  TFTscreen.stroke(56, 3, 200);
  for(int i = -3; i <= 3; i++){
    for(int j = -3; j <= 3; j++){
      TFTscreen.point(pellet.xPos + i, pellet.yPos + j);
    }
  }
  TFTscreen.stroke(0,0,0);
}
开发者ID:IdarV,项目名称:Arduino,代码行数:10,代码来源:board.cpp

示例2: winScreen

void Board::winScreen(uint8_t highscore, bool isNewHighscore){
  // Set background color to random
  TFTscreen.background(random(255), random(255), random(255));

  // Print "game over"
  TFTscreen.setTextSize(3);
  TFTscreen.stroke(255, 255, 255);
  TFTscreen.setCursor(0, 40);
  TFTscreen.print(uwin_str);


  // Print "press joystick to restart"
  TFTscreen.setTextSize(1);
  TFTscreen.setCursor(0, 10);
  TFTscreen.print(pressagain_str);

  // Print score
  TFTscreen.setCursor(0, 80);
  TFTscreen.setTextSize(2);
  TFTscreen.print(score_str);
  TFTscreen.print(": ");
  TFTscreen.print(highscore);

  // If score is new highcore, print "new highscore!"
  if(isNewHighscore){
    TFTscreen.setTextSize(1);
    TFTscreen.setCursor(0, 100);
    TFTscreen.print(newHighscore);
  }
}
开发者ID:IdarV,项目名称:Arduino,代码行数:30,代码来源:board.cpp

示例3: writeWeekDay

// Write weekday to screen
void ClockMaster::writeWeekDay(DateTime time_now){
  tft.stroke(weekdayColor);
  tft.setTextSize(weekdaySize);
  tft.setCursor(weekdayXPos, weekdayYPos);

  tft.print(daysOfTheWeek[time_now.dayOfTheWeek()]);
}
开发者ID:IdarV,项目名称:Arduino,代码行数:8,代码来源:ClockMaster.cpp

示例4: clearPoint

// Clear (draw black) 9x9 square
void Board::clearPoint(int xPoint, int yPoint){
  TFTscreen.stroke(0, 0, 0);
  for(int i = -3; i <= 3; i++){
    for(int j = -3; j <= 3; j++){
      TFTscreen.point(xPoint + i, yPoint + j);
    }
  }
}
开发者ID:IdarV,项目名称:Arduino,代码行数:9,代码来源:board.cpp

示例5: setHighScore

// Prints highscore to screen
void Board::setHighScore(uint8_t highscore){
  TFTscreen.stroke(0, 72, 255);
  TFTscreen.setCursor(0, 70);

  TFTscreen.setTextSize(3);
  TFTscreen.print(highscore);

  TFTscreen.setTextSize(1);
}
开发者ID:IdarV,项目名称:Arduino,代码行数:10,代码来源:board.cpp

示例6: setScore

// Prints score to screen
void Board::setScore(uint8_t score){
  TFTscreen.setTextSize(3);
  TFTscreen.setCursor(0, 20);

  // Write old score as black, which erases it
  if(score != 0){
    TFTscreen.stroke(0, 0, 0);
    TFTscreen.print(score - 1);
  }

  // Write new score in color of snake
  TFTscreen.setCursor(0, 20);
  TFTscreen.stroke(rgbColour[0], rgbColour[1], rgbColour[2]);
  TFTscreen.print(score);

  // Reset cursor size
  TFTscreen.setTextSize(1);
}
开发者ID:IdarV,项目名称:Arduino,代码行数:19,代码来源:board.cpp

示例7: writeMinute

// Write minute to screen
void ClockMaster::writeMinute(DateTime time_now) {
  tft.stroke(minuteColor);
  tft.setTextSize(hourSize);
  tft.setCursor(minuteXPos, minuteYPos);
  if (time_now.minute() < 10) {
    tft.print("0");
  }
  tft.print(time_now.minute());
}
开发者ID:IdarV,项目名称:Arduino,代码行数:10,代码来源:ClockMaster.cpp

示例8: writeSecond

// Write second to screen
void ClockMaster::writeSecond(DateTime time_now) {
  tft.stroke(255, 255, 255);
  tft.setTextSize(secondSize);
  tft.setCursor(secondXPos, secondYPos);
  if (time_now.second() < 10) {
    tft.print("0");
  }
  tft.print(time_now.second());
}
开发者ID:IdarV,项目名称:Arduino,代码行数:10,代码来源:ClockMaster.cpp

示例9: drawPointFast

// Draws snake body as single point(1 pixel)
void Board::drawPointFast(uint8_t xPoint, uint8_t yPoint){
  // Set new stroke
  TFTscreen.stroke(rgbColour[0], rgbColour[1], rgbColour[2]);

  // Draw 9x9 square
  TFTscreen.point(xPoint, yPoint);

  // Set new colors
  updateColors();
}
开发者ID:IdarV,项目名称:Arduino,代码行数:11,代码来源:board.cpp

示例10: writeHour

// Write hour to screen
void ClockMaster::writeHour(DateTime time_now) {
  tft.stroke(255, 255, 255);
  tft.setTextSize(hourSize);
  tft.setCursor(hourXPos, hourYPos);

  if (time_now.hour() < 10) {
    tft.print("0");
  }

  tft.print(time_now.hour());
}
开发者ID:IdarV,项目名称:Arduino,代码行数:12,代码来源:ClockMaster.cpp

示例11: writeDay

// Write day to screen
void ClockMaster::writeDay(DateTime time_now) {
  dayXPos = monthLength + 4; // One space after month
  tft.stroke(255, 255, 255);
  tft.setTextSize(daySize);
  tft.setCursor(dayXPos, dayYPos);

  if (time_now.day() < 10) {
    tft.print("0");
  }

  tft.print(time_now.day());
}
开发者ID:IdarV,项目名称:Arduino,代码行数:13,代码来源:ClockMaster.cpp

示例12: init

void Board::init(){
  // Start screen
  TFTscreen.begin();
  // make the background black
  TFTscreen.background(0, 0, 0);

  // Set starting colors
  rgbColour[0] = 255;
  rgbColour[1] = 0;
  rgbColour[2] = 0;

  // Set which color to be incremented and decremented
  decColour = 0;
  incColour = 1;

  TFTscreen.stroke(255, 255, 255);
  // Draw top border left->right
  TFTscreen.line(boardBorderXLeft, boardBorderYTop, boardBorderXRight, boardBorderYTop);
  // Draw right border top->bottom
  TFTscreen.line(boardBorderXLeft, boardBorderYTop, boardBorderXLeft, boardBoarderYBottom);
  // Draw bottom border left->right
  TFTscreen.line(boardBorderXLeft, boardBoarderYBottom, boardBorderXRight, boardBoarderYBottom);
  // Draw left border
  TFTscreen.line(boardBorderXRight, boardBorderYTop, boardBorderXRight, boardBoarderYBottom);

  // Write score
  TFTscreen.setCursor(10, 10);
  TFTscreen.setTextSize(1);
  TFTscreen.print(score_str);
  setScore(0);

  // Write highscore
  TFTscreen.setTextSize(1);
  TFTscreen.stroke(255, 255, 255);
  TFTscreen.setCursor(10, 50);
  TFTscreen.print(high_str);
  TFTscreen.setCursor(10, 60);
  TFTscreen.print(score_str);
}
开发者ID:IdarV,项目名称:Arduino,代码行数:39,代码来源:board.cpp

示例13: drawPoint

// Draws a 9X9 point with (xPoint, yPoint) as center
void Board::drawPoint(uint8_t xPoint, uint8_t yPoint){
  // set new stroke
  TFTscreen.stroke(rgbColour[0], rgbColour[1], rgbColour[2]);

  //Draw 9x9 square
  for(int i = -3; i <= 3; i++){
    for(int j = -3; j <= 3; j++){
      TFTscreen.point(((int)xPoint) + i, ((int)yPoint) + j);
    }
  }

  // Set new colors
  updateColors();
}
开发者ID:IdarV,项目名称:Arduino,代码行数:15,代码来源:board.cpp

示例14: writeTemp

// Write temperature and Humidity to screen
void ClockMaster::writeTemp(){
  tft.stroke(32, 177, 98);
  tft.setTextSize(2);
  tft.setCursor(tempXPos, tempYPos);
  if(-10 < lastTemp && 10 > lastTemp ){
    tft.print("0");
  }
  tft.print(lastTemp);
  tft.print("C ");
  if(-10 < lastTempF && 10 > lastTempF ){
    tft.print("0");
  }
  tft.print(lastTempF);
  tft.print("F ");
  if(-10 < lastHumidity && 10 > lastHumidity ){
    tft.print("0");
  }
  tft.print(lastHumidity);
  tft.print("h");


}
开发者ID:IdarV,项目名称:Arduino,代码行数:23,代码来源:ClockMaster.cpp

示例15: writeMonth

// Write month to screen
void ClockMaster::writeMonth(DateTime time_now) {
  tft.stroke(255, 255, 255);
  tft.setTextSize(monthSize);
  tft.setCursor(monthXPos, monthYPos);
  tft.print(monthsOfTheYear[time_now.month() - 1]);
}
开发者ID:IdarV,项目名称:Arduino,代码行数:7,代码来源:ClockMaster.cpp


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