(img, buttonList)
| 24 | |
| 25 | |
| 26 | def draw(img, buttonList): |
| 27 | for button in buttonList: |
| 28 | x, y = button.pos |
| 29 | w, h = button.size |
| 30 | cvzone.cornerRect( |
| 31 | img, |
| 32 | (button.pos[0], button.pos[1], button.size[0], button.size[0]), |
| 33 | 20, |
| 34 | rt=0, |
| 35 | ) |
| 36 | cv2.rectangle( |
| 37 | img, button.pos, (int(x + w), int(y + h)), (255, 144, 30), cv2.FILLED |
| 38 | ) |
| 39 | cv2.putText( |
| 40 | img, button.text, (x + 20, y + 65), cv2.FONT_HERSHEY_PLAIN, 4, (0, 0, 0), 4 |
| 41 | ) |
| 42 | return img |
| 43 | |
| 44 | |
| 45 | def transparent_layout(img, buttonList): |