-
Notifications
You must be signed in to change notification settings - Fork 0
/
utility.py
32 lines (28 loc) · 839 Bytes
/
utility.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# def maximum(a,b):
# if a>b:
# return a
# else:
# return b
#
# def minimum(a,b):
# if a>b:
# return b
# else:
# return a
#
# def clamp(number,lower_bound,upper_bound):
# new_num = number
# new_num = maximum(lower_bound,new_num)
# new_num = minimum(upper_bound,new_num)
# return new_num
import pygame
import pygame.surfarray
def combineFunc(screenUpdate, interceptScreen):
def wrap(*args, **kwargs):
screenUpdate(*args, **kwargs) # call the screen update func we intercepted so the screen buffer is updated
interceptScreen() # call our own function to get the screen buffer
return wrap
def on_screen_update():
surface_array = pygame.surfarray.array3d(pygame.display.get_surface())
print("We got the screen array")
print(surface_array)