Exemplo n.º 1
0
extern void showDefaultLayout(MI0283QT9 lcd){
	
	lcd.fillScreen(ROADCOLOR);
	lcd.drawRect(0, 0, 20, 320, GRASSCOLOR);
	lcd.drawRect(220, 0, 20, 320, GRASSCOLOR);
		
}
Exemplo n.º 2
0
void showPlayerColor(MI0283QT9 lcd){
	
	while(1){
	
		lcd.drawText(0, 15, "Color", OBJECTCOLOR, BACKGROUND, 3);

		red = drawSlider(lcd, 60, red, red, 0,0);

		green = drawSlider(lcd, 100, green , 0 , green, 0);
		
		blue = drawSlider(lcd, 140, blue, 0, 0 , blue);
		
		//draw a car
		lcd.drawRect(100, 180, 40, 64, RGB(red,green,blue));
		lcd.drawLine(100+1,180+16,100+10, 180+26, RGB(red,green,blue));
		lcd.drawLine(100+39,180+16,100+30, 180+26, RGB(red,green,blue));
		lcd.drawLine(100+10,180+26,100+30, 180+26, RGB(red,green,blue));
		lcd.drawLine(100+10,180+38,100+30, 180+38, RGB(red,green,blue));
		lcd.drawLine(100+1,180+48,100+10, 180+38, RGB(red,green,blue));
		lcd.drawLine(100+39,180+48,100+30, 180+38, RGB(red,green,blue));
		lcd.drawLine(100+10,180+26,100+10, 180+38, RGB(red,green,blue));
		lcd.drawLine(100+30,180+26,100+30, 180+38, RGB(red,green,blue));
		lcd.drawLine(100,180+16,100+38, 180+16, RGB(red,green,blue));
		lcd.drawLine(100,180+48,100+38, 180+48, RGB(red,green,blue));
	
		if(drawButton(lcd, "Accept", 20, 270, 200, 40)){
			lcd.fillScreen(BACKGROUND);
			break;
		}
	}
}
Exemplo n.º 3
0
extern void showGridLayout(MI0283QT9 lcd, MY_USART serial){
	
	for(int i=0; i<5; i++){
		for(int i2 =0; i2<5; i2++){
			lcd.drawRect(pixelPosX(i2), pixelPosY(i), 20+200/GRIDXLENGTH, 320/GRIDYLENGTH, RGB(255,255,255));
		}
	}
}
Exemplo n.º 4
0
//this function draws the boat dynamic on the LCD panel
void drawBoat(MI0283QT9 lcd, int x, int y) {
	uint8_t width = 15;
	uint8_t length = 25;
	//draw square
	lcd.drawRect(x, y, width, length, RGB(0, 0, 0));
	//draws line around the square
	lcd.fillRect(x + 1, y + 1, width - 2, length - 2, RGB(156, 102, 31));
	//can place the mast further backward on the boat
	int8_t mastPosition = -2;
	// draws mast
	lcd.fillCircle(x + width / 2, y + length / 2 + mastPosition, (width + length) / 12, RGB(82, 82, 82));
	//draws sail
	lcd.fillTriangle(x, y + length / 2 - (width + length) / 12 + mastPosition, x + width - 1, y + length / 2 - (width + length) / 12 + mastPosition, x + width / 2, y - 2 + length / 2 - (width + length) / 12 + mastPosition, RGB(255, 255, 255));
}