def drawPageIndicator(amount, position):
	x = 5
	size = 4
	offset = 6
	for i in range(amount):
		display.drawCircle(x, display.height()-8, size, 0, 359, i==position, COLOR_FG)
		x+= size + offset
def rounded_box(x,y,w,h,r,color):
	display.drawLine(x+r,   y,     x+w-1-r, y,       color)
	display.drawLine(x+r,   y+h-1, x+w-1-r, y+h-1,   color)
	display.drawLine(x,     y+r,   x,       y+h-1-r, color)
	display.drawLine(x+w-1, y+r,   x+w-1,   y+h-1-r, color)
	display.drawCircle(x+r,     y+r,     r, 270, 359, False, color)
	display.drawCircle(x+w-1-r, y+r,     r, 0,   90,  False, color)
	display.drawCircle(x+r,     y+h-1-r, r, 180, 270, False, color)
	display.drawCircle(x+w-1-r, y+h-1-r, r, 90,  180, False, color)
Exemple #3
0
# https://docs.badge.team/esp32-app-development/api-reference/display/

print('Test: Display')

import display
display.flush()

display.drawFill(0x000000)
display.drawText(10, 10, "LaserTag 2 :D", 0xFFFF00, "permanentmarker22")
display.flush()

display.drawCircle(60, 60, 50, 0, 360, True, 0xFFFFFF)
display.drawCircle(60, 60, 40, 0, 360, True, 0x000000)
display.drawCircle(60, 60, 30, 0, 360, True, 0xFFFFFF)
display.drawCircle(60, 60, 20, 0, 360, True, 0x000000)
display.drawCircle(60, 60, 10, 0, 360, True, 0xFFFFFF)

display.drawLine(1, 1, 100, 100, 0xFFFFFF)
display.drawRect(30, 30, 50, 50, True, 0xFFFFFF)

display.drawText(150, 25, "STILL", 0xFFFFFF, "Roboto_BlackItalic24")
display.drawText(130, 50, "Hacking", 0xFFFFFF, "PermanentMarker22")
l = display.getTextWidth("Hacking", "PermanentMarker22")
display.drawLine(130, 72, 144 + l, 72, 0xFFFFFF)
display.drawLine(140 + l, 52, 140 + l, 70, 0xFFFFFF)
display.drawText(140, 75, "Anyway", 0xFFFFFF, "Roboto_BlackItalic24")

display.flush()

print('done')
Exemple #4
0
                    print("Full screen clear")
                    #display.clear(0xFFFFFF)
                    display.drawFill(0xFFFFFF)
                    lut = BADGE_EINK_LUT_FULL
                else:
                    lut = BADGE_EINK_LUT_FASTER

                #ugfx.string_box(0, -8, 128, 30, "BUS TIME", "Roboto_Black22", ugfx.BLACK, ugfx.justifyCenter) #printing title
                display.drawPng(0, 0, "/lib/luxPublicTransport/busBoardV2.png")

                display.drawText(
                    106 -
                    int(display.getTextWidth(temp, "Roboto_Regular18") / 2),
                    10, temp, 0xFFFFFF, "Roboto_Regular18")

                display.drawCircle(120, 12, 2, 0, 360, True, 0xFFFFFF)
                display.drawCircle(120, 12, 1, 0, 360, True, 0x000000)

                #ugfx.area(0, 45+(0)*65, 128, 55, ugfx.BLACK)
                #display.drawRect(0, 45+(0)*65, 128, 55,True,  0x000000)
                display.drawPng(0, 45 + (0) * 65,
                                "/lib/luxPublicTransport/busTablets.png")
                display.flush(lut)

                for x in range(0, numOfDepartures):

                    #ugfx.fill_rounded_box (86, 50+x*65, 37, 20, -2, ugfx.WHITE) #printing white box for the line
                    #display.drawRect(86, 50+x*65, 37, 20,True,  0xFFFFFF)
                    #ugfx.string_box(86, 48+x*65, 37, 20, departureLine[x], "Roboto_Regular18", ugfx.BLACK, ugfx.justifyCenter) #printing line in white box
                    display.drawText(
                        86 + 2, 50 + (x * 65) + 15 - int(
def circle(x, y, r, color):
	display.drawCircle(x, y, r, 0, 359, False, color)
def fill_circle(x, y, r, color):
	display.drawCircle(x, y, r, 0, 359, True, color)