├── LICENSE.md └── initial /LICENSE.md: -------------------------------------------------------------------------------- 1 | // free // 2 | -------------------------------------------------------------------------------- /initial: -------------------------------------------------------------------------------- 1 | import pygame 2 | import sys 3 | 4 | # Initialize pygame 5 | pygame.init() 6 | 7 | # Screen dimensions (similar to a mobile screen) 8 | SCREEN_WIDTH = 360 9 | SCREEN_HEIGHT = 640 10 | 11 | # Colors 12 | WHITE = (255, 255, 255) 13 | BLACK = (0, 0, 0) 14 | GRAY = (169, 169, 169) 15 | 16 | # Set up the display 17 | screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) 18 | pygame.display.set_caption("Mobile Screen") 19 | 20 | # Draw the UI elements 21 | def draw_ui(): 22 | screen.fill(WHITE) 23 | 24 | # Draw a header 25 | pygame.draw.rect(screen, GRAY, (0, 0, SCREEN_WIDTH, 50)) 26 | 27 | # Draw some buttons 28 | pygame.draw.rect(screen, BLACK, (50, 100, 100, 50)) 29 | pygame.draw.rect(screen, BLACK, (200, 100, 100, 50)) 30 | 31 | # Draw a bottom navigation bar 32 | pygame.draw.rect(screen, GRAY, (0, SCREEN_HEIGHT - 50, SCREEN_WIDTH, 50)) 33 | 34 | # Draw button text 35 | font = pygame.font.Font(None, 36) 36 | button_text1 = font.render('Button 1', True, WHITE) 37 | button_text2 = font.render('Button 2', True, WHITE) 38 | screen.blit(button_text1, (65, 115)) 39 | screen.blit(button_text2, (215, 115)) 40 | 41 | # Main loop 42 | def main(): 43 | clock = pygame.time.Clock() 44 | running = True 45 | 46 | while running: 47 | for event in pygame.event.get(): 48 | if event.type == pygame.QUIT: 49 | running = False 50 | elif event.type == pygame.MOUSEBUTTONDOWN: 51 | pos = pygame.mouse.get_pos() 52 | print(f"Mouse clicked at: {pos}") 53 | 54 | draw_ui() 55 | pygame.display.flip() 56 | clock.tick(60) 57 | 58 | pygame.quit() 59 | sys.exit() 60 | 61 | if __name__ == "__main__": 62 | main() 63 | --------------------------------------------------------------------------------