Module instructionButtons
[hide private]
[frames] | no frames]

Source Code for Module instructionButtons

 1  from cocos import euclid, collision_model 
 2  from cocos.layer.base_layers import Layer 
 3  from cocos.sprite import Sprite 
 4  from utils import aabb_to_aa_rect 
 5  from constants import * 
 6  import os 
 7  import pyglet 
 8   
9 -class BackButton(Sprite):
10 - def __init__(self,x,y):
11 super(BackButton, self).__init__(os.path.join("images", "instructions", "back_button.png")) 12 self.position = x,y 13 self.cshape = aabb_to_aa_rect(self.get_AABB()) 14 self.cshape.center = self.position
15
16 -class BackButtonUD(Sprite):
17 - def __init__(self,x,y):
18 super(BackButtonUD, self).__init__(os.path.join("images", "instructions", "back_button.png")) 19 self.position = x,y 20 self.cshape = aabb_to_aa_rect(self.get_AABB()) 21 self.cshape.center = self.position
22
23 -class UnitDetailsButton(Sprite):
24 - def __init__(self,x,y):
25 super(UnitDetailsButton, self).__init__(os.path.join("images", "instructions", "unit_description_button.png")) 26 self.position = x,y 27 self.cshape = aabb_to_aa_rect(self.get_AABB()) 28 self.cshape.center = self.position
29
30 -class ControlsButton(Sprite):
31 - def __init__(self,x,y):
32 super(ControlsButton, self).__init__(os.path.join("images", "instructions", "controls_button.png")) 33 self.position = x,y 34 self.cshape = aabb_to_aa_rect(self.get_AABB()) 35 self.cshape.center = self.position
36
37 -class TechTreeButton(Sprite):
38 - def __init__(self,x,y):
39 super(TechTreeButton, self).__init__(os.path.join("images", "instructions", "tech_tree_button.png")) 40 self.position = x,y 41 self.cshape = aabb_to_aa_rect(self.get_AABB()) 42 self.cshape.center = self.position
43
44 -class AttackTroopDetailsButton(Sprite):
45 - def __init__(self,x,y):
46 super(AttackTroopDetailsButton, self).__init__(os.path.join("images", "instructions", "attack_troop_button.png")) 47 self.position = x,y 48 self.cshape = aabb_to_aa_rect(self.get_AABB()) 49 self.cshape.center = self.position
50
51 -class UtilityTroopDetailsButton(Sprite):
52 - def __init__(self,x,y):
53 super(UtilityTroopDetailsButton, self).__init__(os.path.join("images", "instructions", "utility_troop_button.png")) 54 self.position = x,y 55 self.cshape = aabb_to_aa_rect(self.get_AABB()) 56 self.cshape.center = self.position
57
58 -class BuildingsDetailsButton(Sprite):
59 - def __init__(self,x,y):
60 super(BuildingsDetailsButton, self).__init__(os.path.join("images", "instructions", "building_details_button.png")) 61 self.position = x,y 62 self.cshape = aabb_to_aa_rect(self.get_AABB()) 63 self.cshape.center = self.position
64
65 -class ResourceDetailsButton(Sprite):
66 - def __init__(self,x,y):
67 super(ResourceDetailsButton, self).__init__(os.path.join("images", "instructions", "resource_button.png")) 68 self.position = x,y 69 self.cshape = aabb_to_aa_rect(self.get_AABB()) 70 self.cshape.center = self.position
71