flash
authorFrank DeMarco <frank.s.demarco@gmail.com>
Sat, 21 Jun 2014 14:45:35 +0000 (23:45 +0900)
committerFrank DeMarco <frank.s.demarco@gmail.com>
Sat, 21 Jun 2014 14:45:35 +0000 (23:45 +0900)
hair_on_arm/HairOnArm.py

index 1feb4c7..1e961d4 100644 (file)
@@ -37,7 +37,7 @@ class Title(GameChild):
     def __init__(self, parent):
         GameChild.__init__(self, parent)
         self.delegate = self.get_game().delegate
-        self.menu = Menu(self, (500, 350),
+        self.menu = Menu(self, (500, 350), 18,
                          ("level", self.start, ["all"] + range(10), True,
                           self.set_gate_index),
                          ("invert", self.set_invert, ("off", "on"), True),
@@ -79,10 +79,10 @@ class Title(GameChild):
 
 class Menu(Animation):
 
-    def __init__(self, parent, position, *args):
-        Animation.__init__(self, parent, self.highlight, 100)
+    def __init__(self, parent, position, font_size, *args):
+        Animation.__init__(self, parent, self.highlight)
         self.delegate = self.get_game().delegate
-        self.arrange(position, args)
+        self.arrange(position, font_size, args)
         self.subscribe(self.respond)
         self.reset()
         self.deactivate()
@@ -91,9 +91,9 @@ class Menu(Animation):
     def highlight(self):
         self.highlit = not self.highlit
 
-    def arrange(self, position, options):
+    def arrange(self, position, font_size, options):
         self.elements = elements = []
-        font = Font(self.get_resource("display", "font"), 18)
+        font = Font(self.get_resource("display", "font"), font_size)
         height = 0
         width = 0
         margin = 5
@@ -158,7 +158,8 @@ class Menu(Animation):
         if self.active:
             Animation.update(self)
             for element in self.elements:
-                element.update(element == self.elements[self.active_element])
+                element.update(element == self.elements[self.active_element] \
+                               and self.highlit)
 
 
 class Element(GameChild):