def __init__(self, game_object, font=None, font_size=11, text=None, anti_alias=False, color=None, outline_color=None, outline_width=2): # type: (GameObject, str, int, str, bool, Color.RGBA, Color.RGBA, int) -> None Component.__init__(self, game_object) self.sprite_renderer = None # type: SpriteRenderer self.__font = font self.__font_object = None # type: pygame.font.Font self.__font_size = font_size self.__text = text self.anti_alias = anti_alias self.__color = color # type: Color.RGBA self.outline_color = outline_color # type: Color.RGBA self.outline_width = outline_width
def __init__(self, game_object): # GameObject is required Component.__init__(self, game_object) # Transform we will move to move our player # We still don't get the Transform because it might not be initiated self.transform = None # Input is a singleton, any instance will be the same as the others and will share the same memory self.input_manager = Input() # Units we will move per second self.move_speed = 200
def __init__(self, game_object, position=None, scale=None, rotation=None): # type: (GameObject, Vector2D, Vector2D, float) -> None Component.__init__(self, game_object) if isinstance(position, Vector2D): self.position = position else: self.position = Vector2D(0, 0) if isinstance(scale, Vector2D): self.__scale = scale else: self.__scale = Vector2D(1, 1) if isinstance(rotation, int): self.__rotation = rotation else: self.__rotation = 0.0
def __init__(self, game_object, sprite=None, update_on_draw=False, align_x="center", align_y="center"): # type: (GameObject, Sprite, bool, str, str) -> None Component.__init__(self, game_object) self.__sprite = sprite # type: Sprite self.transform = None # type: Transform self.__sprite_transformed = None # type: pygame.Surface self.sprite_size = Vector2D(0, 0) self.__current_world_scale = Vector2D(1, 1) self.__current_world_rotation = 0 self.update_on_draw = update_on_draw self.align_x = align_x self.align_y = align_y
def __init__(self): Component.__init__(self) self.name = "game" # Default screen size self.default_width = 480 self.default_height = 320 # PyGame objects # The main window for the app self.screen = None # Game clock self.clock = None self.time = 0 # Resource manager self.loader = None # Event manager self.events = None # Input handler self.keyboard = None self.mouse = None # Current game frame self.frame = 0 # Controls the game loop self.running = True # Background surface self.background = None self.background_color = (255, 255, 255) self.default_font = None # Game window name self.win_name = "PyFrame3" # Scene stuff self.scenes = {} self.current_scene = None self.debug_time = ""
def __init__(self, game_object, render_rect): # type: (GameObject, list) -> None Component.__init__(self, game_object) self.render_pos = (render_rect[0], render_rect[1]) self.render_size = (render_rect[2], render_rect[3]) self.transform = None # type: Transform
] paths_SingleMuon2017G_ZMu_v1_skim = [ "/raid/raid7/lucien/CSC/GasGain/Log/2018-05-06/comp_SingleMuon2017G_ZMu_v1_partial_hadd/" ] paths_SingleMuon2017H_ZMu_v1_skim = [ "/raid/raid7/lucien/CSC/GasGain/Log/2018-05-06/comp_SingleMuon2017H_ZMu_v1_partial_hadd/" ] #paths_SingleMuon2017E_v1_skim = ["/raid/raid7/lucien/CSC/GasGain/Log/2018-03-19/SingleMuon2017E_v1_partial_hadd/"] #paths_SingleMuon2017E_v2_skim = ["/raid/raid7/lucien/CSC/GasGain/Log/2018-04-08/SingleMuon2017E_v2_partial_hadd/"] #paths_SingleMuon2017E_v3_skim = ["/raid/raid7/lucien/CSC/GasGain/Log/2018-04-15/SingleMuon2017E_v3_partial_hadd/"] #paths_SingleMuon2017E_v4_skim = ["/raid/raid7/lucien/CSC/GasGain/Log/2018-04-15/SingleMuon2017E_v4_partial_hadd/"] paths = eval(pathStr) componentList = [] for path in paths: tmp = Component(path + "/", path.split("/")[-1], inUFTier2=False) componentList.extend(tmp.makeComponentFromEachFile()) rootTree = "tree" nCores = 10 disableProgressBar = False nEvents = -1 #outputDir = "/raid/raid7/lucien/CSC/GasGain/Log/2018-03-19/comp_SingleMuon2017E_v1_skim_anl_all/" #outputDir = "/raid/raid7/lucien/CSC/GasGain/Log/2018-03-19/comp_SingleMuon2017E_v1_skim_anl_all_ZMuMu/" #outputDir = "/raid/raid7/lucien/CSC/GasGain/Log/2018-03-19/comp_SingleMuon2017E_v1_skim_anl_all_ZMuMu_allChannel/" #outputDir = "/raid/raid7/lucien/CSC/GasGain/Log/2018-04-08/comp_SingleMuon2017E_v2_skim_anl_all_ZMuMu_allChannel/" #outputDir = "/raid/raid7/lucien/CSC/GasGain/Log/2018-05-03/comp_SingleMuon2017E_v3_skim_anl_all_ZMuMu_allChannel_CombinedME11ab/" #outputDir = "/raid/raid7/lucien/CSC/GasGain/Log/2018-05-03/comp_SingleMuon2017E_v3_skim_anl_all_ZMuMu_allChannel_CombinedME11ab_yloc/" #outputDir = "/raid/raid7/lucien/CSC/GasGain/Log/2018-05-07/"+compStr+"_anl/" outputDir = "/raid/raid7/lucien/CSC/GasGain/Log/2018-05-17/" justEndSequence = True