MCPcopy Create free account
hub / github.com/Gordon999/RPiCamGUI / text

Function text

RPiCamGUI.py:635–695  ·  view source on GitHub ↗
(col,row,fColor,top,upd,msg,fsize,bkgnd_Color)

Source from the content-addressed store, hash-verified

633 by = (pre_height *.75 + (bh*3))
634 pygame.draw.rect(windowSurfaceObj,Color,Rect(bx+1,by,bw-2,bh))
635 pygame.draw.line(windowSurfaceObj,whiteColor,(bx,by),(bx,by+bh-1),3)
636 pygame.draw.line(windowSurfaceObj,whiteColor,(bx,by),(bx+bw-1,by),2)
637 pygame.draw.line(windowSurfaceObj,dgryColor,(bx,by+bh-1),(bx+bw-1,by+bh-1),1)
638 pygame.draw.line(windowSurfaceObj,dgryColor,(bx+bw-2,by),(bx+bw-2,by+bh),2)
639 pygame.display.update()
640
641def text(col,row,fColor,top,upd,msg,fsize,bkgnd_Color):
642 global bh,pre_width,fv,tduration
643 colors = [dgryColor, greenColor, yellowColor, redColor, purpleColor, blueColor, whiteColor, greyColor, blackColor, purpleColor,lgrnColor,lpurColor,lyelColor]
644 Color = colors[fColor]
645 bColor = colors[bkgnd_Color]
646 if alt_dis == 0:
647 bx = pre_width + (col * bw)
648 by = row * bh
649 else:
650 if col == 0:
651 if row < 8:
652 bx = row * bw
653 if alt_dis == 1:
654 by = pre_height
655 else:
656 by = pre_height * 0.75
657 else:
658 bx = (row - 8) * bw
659 if alt_dis == 1:
660 by = pre_height + bh
661 else:
662 by = (pre_height *.75 + bh)
663 elif row < 8:
664 bx = row * bw
665 if alt_dis == 1:
666 by = pre_height + (bh*2)
667 else:
668 by = (pre_height *.75 + (bh*2))
669 else:
670 bx = (row - 8) * bw
671 if alt_dis == 1:
672 by = pre_height + (bh*3)
673 else:
674 by = (pre_height *.75 + (bh*3))
675 if os.path.exists ('/usr/share/fonts/truetype/freefont/FreeSerif.ttf'):
676 fontObj = pygame.font.Font('/usr/share/fonts/truetype/freefont/FreeSerif.ttf', int(fsize))
677 else:
678 fontObj = pygame.font.Font(None, int(fsize))
679 msgSurfaceObj = fontObj.render(msg, False, Color)
680 msgRectobj = msgSurfaceObj.get_rect()
681 if msg == "Save EXIT" or msg == "Load EXIT" or msg == "CAPTURE" or msg == "CAPTURE/Stream":
682 pygame.draw.rect(windowSurfaceObj,bColor,Rect(bx+2,by+int(bh/3)-3,bw-4,int(bh/3)))
683 msgRectobj.topleft = (bx+5, by + int(bh/3) - 6)
684 elif top == 0:
685 pygame.draw.rect(windowSurfaceObj,bColor,Rect(bx+2,by+int(bh/3),bw-4,int(bh/3)))
686 msgRectobj.topleft = (bx + 5, by + int(bh/3) - 1)
687 elif msg == "Config":
688 pygame.draw.rect(windowSurfaceObj,bColor,Rect(bx+2,by+int(bh/1.5),int(bw/2)-1,int(bh/3)))
689 msgRectobj.topleft = (bx+5, by + int(bh/1.5) - 3)
690 elif top == 1:
691 pygame.draw.rect(windowSurfaceObj,bColor,Rect(bx+20,by+int(bh/1.5),int(bw-21)-1,int(bh/3)))
692 msgRectobj.topleft = (bx + 20, by + int(bh/1.5) - 2)

Callers 4

Camera_VersionFunction · 0.70
MenuFunction · 0.70
Menu2Function · 0.70
RPiCamGUI.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected