gif alpha and timing config options
This commit is contained in:
parent
6dd202c8e3
commit
9b6d5e5af2
16
NS.py
16
NS.py
|
@ -52,11 +52,16 @@ class NS(Game, Animation):
|
|||
{
|
||||
"time":
|
||||
{
|
||||
"int": ["timer-max-time", "timer-start-time", "timer-addition", "sword-delay"]
|
||||
"int": ["timer-max-time", "timer-start-time", "timer-addition", "sword-delay",
|
||||
"attract-gif-length", "attract-board-length"]
|
||||
},
|
||||
"input":
|
||||
{
|
||||
"bool": "serial"
|
||||
},
|
||||
"display":
|
||||
{
|
||||
"float": "attract-gif-alpha"
|
||||
}
|
||||
})
|
||||
Animation.__init__(self, self)
|
||||
|
@ -391,8 +396,9 @@ class Video(Sprite):
|
|||
self.gif = self.gifs[1]
|
||||
self.mask = Surface([diameter] * 2, SRCALPHA)
|
||||
rect = self.mask.get_rect()
|
||||
filled_circle(self.mask, rect.centerx, rect.centery, rect.centerx, (0, 0, 0))
|
||||
filled_circle(self.mask, rect.centerx, rect.centery, rect.centerx - 2, (255, 255, 255))
|
||||
alpha = int(self.get_configuration("display", "attract-gif-alpha") * 255)
|
||||
filled_circle(self.mask, rect.centerx, rect.centery, rect.centerx, (0, 0, 0, alpha))
|
||||
filled_circle(self.mask, rect.centerx, rect.centery, rect.centerx - 2, (255, 255, 255, alpha))
|
||||
self.add_frame(self.mask)
|
||||
self.play()
|
||||
|
||||
|
@ -521,13 +527,13 @@ class Title(Animation):
|
|||
|
||||
def show_video(self):
|
||||
self.video.unhide()
|
||||
self.play(self.hide_video, delay=21000, play_once=True)
|
||||
self.play(self.hide_video, delay=self.get_configuration("time", "attract-gif-length"), play_once=True)
|
||||
self.get_game().tony.set_frameset("static")
|
||||
self.reset()
|
||||
|
||||
def hide_video(self):
|
||||
self.video.hide()
|
||||
self.play(self.show_video, delay=10000, play_once=True)
|
||||
self.play(self.show_video, delay=self.get_configuration("time", "attract-board-length"), play_once=True)
|
||||
self.get_game().tony.set_frameset("board")
|
||||
|
||||
def update(self):
|
||||
|
|
3
config
3
config
|
@ -12,6 +12,7 @@ caption = Scrapeboard
|
|||
show-framerate = no
|
||||
dimensions = 640, 480
|
||||
fullscreen = no
|
||||
attract-gif-alpha = .95
|
||||
|
||||
[mouse]
|
||||
visible = False
|
||||
|
@ -33,3 +34,5 @@ timer-max-time = 10000
|
|||
timer-start-time = 7000
|
||||
timer-addition = 1000
|
||||
sword-delay = 300
|
||||
attract-gif-length = 10000
|
||||
attract-board-length = 4000
|
||||
|
|
Loading…
Reference in New Issue