Add hand cursor on sleep mode
parent
00c0c98f56
commit
4406b45f7a
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="Capa_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 297 297"
|
||||
style="enable-background:new 0 0 297 297;"
|
||||
xml:space="preserve"
|
||||
sodipodi:docname="clicker.svg"
|
||||
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
|
||||
inkscape:export-filename="/home/gdott9/prog/photoboite/clicker.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"><metadata
|
||||
id="metadata39"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs37" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1916"
|
||||
inkscape:window-height="1041"
|
||||
id="namedview35"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.79461279"
|
||||
inkscape:cx="-74.879237"
|
||||
inkscape:cy="148.5"
|
||||
inkscape:window-x="1680"
|
||||
inkscape:window-y="18"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="Capa_1" /><path
|
||||
d="M244.279,91.662c-4.198,0-8.195,0.876-11.825,2.45c-4.413-11.152-15.238-19.058-27.869-19.058 c-4.692,0-9.136,1.092-13.094,3.034c-5.009-9.657-15.048-16.27-26.598-16.27c-3.395,0-6.655,0.579-9.701,1.632V30.201 C155.193,13.549,141.738,0,125.198,0C108.66,0,95.206,13.549,95.206,30.201v119.643L73.604,125.13 c-0.151-0.169-0.305-0.335-0.465-0.494c-5.672-5.676-13.221-8.823-21.256-8.862c-0.052,0-0.101,0-0.153,0 c-8.016,0-15.521,3.095-21.146,8.724c-9.918,9.921-10.467,24.647-1.502,40.408c11.605,20.39,24.22,39.616,35.351,56.581 c8.134,12.398,15.818,24.108,21.435,33.79c4.871,8.402,17.801,35.651,17.933,35.926c1.678,3.541,5.247,5.798,9.163,5.798h128.27 c4.407,0,8.308-2.843,9.659-7.035c2.392-7.439,23.379-73.398,23.379-98.871v-69.229C274.27,105.21,260.817,91.662,244.279,91.662z M234.579,121.865c0-5.468,4.352-9.916,9.7-9.916c5.351,0,9.703,4.448,9.703,9.916v69.229c0,16.928-13.01,62.437-20.189,85.618 H119.361c-4.206-8.752-12.089-24.964-15.944-31.613c-5.897-10.168-13.73-22.105-22.022-34.744 c-10.966-16.71-23.393-35.652-34.681-55.482c-2.946-5.181-5.646-12.166-1.78-16.032c1.803-1.807,4.231-2.751,6.851-2.779 c2.557,0.013,4.962,0.977,6.805,2.721l39.124,44.755c2.78,3.183,7.248,4.306,11.202,2.821c3.958-1.486,6.579-5.271,6.579-9.497 V30.201c0-5.467,4.353-9.913,9.704-9.913c5.352,0,9.706,4.446,9.706,9.913v94.711c0,5.602,4.543,10.144,10.144,10.144 c5.601,0,10.144-4.542,10.144-10.144V92.016c0-5.464,4.352-9.909,9.701-9.909c5.351,0,9.703,4.445,9.703,9.909v46.127 c0,5.605,4.542,10.145,10.143,10.145c5.602,0,10.145-4.539,10.145-10.145v-32.888c0-5.467,4.352-9.914,9.701-9.914 c5.352,0,9.706,4.447,9.706,9.914v46.13c0,5.601,4.542,10.145,10.144,10.145c5.603,0,10.145-4.544,10.145-10.145V121.865z"
|
||||
id="path2"
|
||||
style="fill:#f5ebba;fill-opacity:1" /><g
|
||||
id="g4" /><g
|
||||
id="g6" /><g
|
||||
id="g8" /><g
|
||||
id="g10" /><g
|
||||
id="g12" /><g
|
||||
id="g14" /><g
|
||||
id="g16" /><g
|
||||
id="g18" /><g
|
||||
id="g20" /><g
|
||||
id="g22" /><g
|
||||
id="g24" /><g
|
||||
id="g26" /><g
|
||||
id="g28" /><g
|
||||
id="g30" /><g
|
||||
id="g32" /></svg>
|
After Width: | Height: | Size: 3.7 KiB |
|
@ -81,10 +81,10 @@ class CaptureButton(Button):
|
|||
countdown = 3
|
||||
|
||||
def __init__(self, size, topleft, photoboite):
|
||||
self.up_image = pygame.image.load('button-up.png').convert_alpha()
|
||||
self.up_image = pygame.image.load(os.path.dirname(os.path.realpath(__file__)) + '/button-up.png').convert_alpha()
|
||||
self.up_image = pygame.transform.smoothscale(self.up_image, (size, size))
|
||||
|
||||
self.down_image = pygame.image.load('button-down.png').convert_alpha()
|
||||
self.down_image = pygame.image.load(os.path.dirname(os.path.realpath(__file__)) + '/button-down.png').convert_alpha()
|
||||
self.down_image = pygame.transform.smoothscale(self.down_image, (size, size))
|
||||
|
||||
rect = self.up_image.get_rect()
|
||||
|
@ -103,7 +103,7 @@ class CaptureButton(Button):
|
|||
|
||||
self.font = pygame.font.Font(None, 80)
|
||||
|
||||
self.photo_film = pygame.image.load('film.png').convert_alpha()
|
||||
self.photo_film = pygame.image.load(os.path.dirname(os.path.realpath(__file__)) + '/film.png').convert_alpha()
|
||||
|
||||
def draw_on(self, screen):
|
||||
if self.enabled:
|
||||
|
@ -177,18 +177,24 @@ class Photo:
|
|||
self.uid = uid
|
||||
|
||||
def take(self, camera):
|
||||
self.name = "%s-%04d-%04d" % (time.strftime('%Y%m%d-%H%M%S'), self.cid, self.uid)
|
||||
self.name = "photos/%s-%04d-%04d" % (time.strftime('%Y%m%d-%H%M%S'), self.cid, self.uid)
|
||||
self.capture = pygame.transform.smoothscale(pygame.image.load(camera.take(self.name)), (638, 480))
|
||||
|
||||
return self
|
||||
|
||||
|
||||
class SleepMode:
|
||||
def __init__(self, seconds):
|
||||
def __init__(self, seconds, screen):
|
||||
self.enabled = True
|
||||
self.drawn = False
|
||||
self.seconds = seconds
|
||||
|
||||
self.screen = screen
|
||||
|
||||
self.clicker = pygame.image.load(os.path.dirname(os.path.realpath(__file__)) + '/clicker.png').convert_alpha()
|
||||
self.clicker_rect = self.clicker.get_rect()
|
||||
self.clicker_rect.topleft = ((self.screen.get_width() - self.clicker_rect.width) / 2, (self.screen.get_height() - self.clicker_rect.height) / 2)
|
||||
|
||||
def move(self):
|
||||
self.last_action = time.time()
|
||||
|
||||
|
@ -198,9 +204,10 @@ class SleepMode:
|
|||
self.move()
|
||||
self.enabled = False
|
||||
|
||||
def draw_on(self, screen):
|
||||
def draw(self):
|
||||
if not self.drawn:
|
||||
screen.fill((255,255,255))
|
||||
self.screen.fill((255,255,255))
|
||||
self.screen.blit(self.clicker, self.clicker_rect)
|
||||
pygame.display.flip()
|
||||
self.drawn = True
|
||||
|
||||
|
@ -228,7 +235,7 @@ class Photoboite:
|
|||
|
||||
self.clock = pygame.time.Clock()
|
||||
|
||||
self.sleep = SleepMode(30)
|
||||
self.sleep = SleepMode(30, self.screen)
|
||||
|
||||
|
||||
def screen(self):
|
||||
|
@ -283,7 +290,7 @@ class Photoboite:
|
|||
while True:
|
||||
if self.sleep.enabled:
|
||||
self.sleep.event()
|
||||
self.sleep.draw_on(self.screen)
|
||||
self.sleep.draw()
|
||||
self.clock.tick(60)
|
||||
else:
|
||||
self.event()
|
||||
|
|
Loading…
Reference in New Issue