#NEWLINE# def trigger( self , ui ) : #NEWLINE# #INDENT# '\n        Trigger this animation\n        ' #NEWLINE# damage_counter = DamageCounter ( damage = self . text , colour = self . colour , parent = ui ) #NEWLINE# ui . view . scene ( ) . addItem ( damage_counter ) #NEWLINE# damage_counter . setZValue ( zorder_counter ) #NEWLINE# bounds = damage_counter . boundingRect ( ) #NEWLINE# width = bounds . width ( ) #NEWLINE# damage_counter . setPos ( ( ( ( ( self . location [ 0 ] * 32 ) + 16 ) - ( width / 2 ) ) + self . offset [ 0 ] ) , ( ( self . location [ 1 ] * 32 ) + self . offset [ 1 ] ) ) #NEWLINE# animation = QSequentialAnimationGroup ( ) #NEWLINE# moving = QPropertyAnimation ( damage_counter . adapter , 'y_location' ) #NEWLINE# moving . setDuration ( 750 ) #NEWLINE# moving . setStartValue ( ( self . location [ 1 ] * 32 ) ) #NEWLINE# moving . setEndValue ( ( ( self . location [ 1 ] * 32 ) - 32 ) ) #NEWLINE# animation . addAnimation ( moving ) #NEWLINE# fading = QPropertyAnimation ( damage_counter . adapter , 'opacity' ) #NEWLINE# fading . setDuration ( 750 ) #NEWLINE# fading . setStartValue ( 1.0 ) #NEWLINE# fading . setEndValue ( 0.0 ) #NEWLINE# animation . addAnimation ( fading ) #NEWLINE# def clean_up( ) : #NEWLINE# #INDENT# animation . stop ( ) #NEWLINE# ui . animations . remove ( animation ) #NEWLINE# ui . view . items ( ) . remove ( damage_counter ) #NEWLINE# ui . remove_finished_animation ( ) #NEWLINE# #UNINDENT# ui . animations . append ( animation ) #NEWLINE# animation . start ( )