示例#1
0
        def _selected_fn(spr: cocosnode.CocosNode):
            self.orig_scale = spr.scale
            self.orig_pos = spr.position

            spr.scale *= 2
            y_ratio = spr.y / get_height()
            if y_ratio < 0.5:
                spr.y = min(y_ratio + 0.13, 0.5) * get_height()
            else:
                spr.y = max(y_ratio - 0.13, 0.5) * get_height()

            if self.move_to_top:
                set_z(spr, z='top')
示例#2
0
        def _selected_fn(spr: cocosnode.CocosNode):
            self.orig_scale = spr.scale
            self.orig_pos = spr.position

            spr.scale *= 2
            y_ratio = spr.y / get_height()
            if y_ratio < 0.5:
                spr.y = min(y_ratio + 0.13, 0.5) * get_height()
            else:
                spr.y = max(y_ratio - 0.13, 0.5) * get_height()

            if self.move_to_top:
                set_z(spr, z='top')