Exemplo n.º 1
0
    def __init__(self, particle):
        super(EmitterConfigPanel, self).__init__()

        self.orientation = 'vertical'
        self.ps = particle
        self.gravity_sliders = []
        self.radial_sliders = []

        # Gravity emitter config
        self.gravity_dropdown = BoxLayout(orientation='vertical')
        for param in GRAVITY_EMITTER_PARAMETERS:
            slider = ParamSlider(param,
                                 default=get_param_default(
                                     self.ps.particle, param['name']),
                                 callback=self.ps.update_param)
            self.gravity_sliders.append(slider)
            self.gravity_dropdown.add_widget(slider)

        # Radial emitter config
        self.radial_dropdown = BoxLayout(orientation='vertical')
        for param in RADIAL_EMITTER_PARAMETERS:
            slider = ParamSlider(param,
                                 default=get_param_default(
                                     self.ps.particle, param['name']),
                                 callback=self.ps.update_param)
            self.radial_sliders.append(slider)
            self.radial_dropdown.add_widget(slider)

        self.add_widget(
            Label(text='Emitter Configuration', size_hint_y=None, height=100))

        if self.ps.particle.emitter_type == 0:
            self.emitter_type = 'Gravity'
            self.bt = Button(text='Emitter Type: {}'.format(self.emitter_type),
                             size_hint_y=None,
                             height=100,
                             background_normal='button6.png',
                             background_down='button6down.png')
            self.add_widget(self.bt)
            self.add_widget(self.gravity_dropdown)
        else:
            self.emitter_type = 'Radial'
            self.bt = Button(text='Emitter Type: {}'.format(self.emitter_type),
                             size_hint_y=None,
                             height=100,
                             background_normal='button6.png',
                             background_down='button6down.png')
            self.add_widget(self.bt)
            self.add_widget(self.radial_dropdown)

        self.bt.bind(on_release=self.switch_emitter_type)
Exemplo n.º 2
0
    def __init__(self, particle):
        super(ParticleConfigPanel, self).__init__()
        self.orientation = 'vertical'
        self.ps = particle
        self.sliders = []

        self.add_widget(Label(text='Particle Configuration', size_hint_y=None, height=100))
        
        for param in PARTICLE_PARAMETERS:
            slider = ParamSlider(param, default=get_param_default(self.ps.particle, param['name']), callback=self.ps.update_param)
            self.sliders.append(slider)
            self.add_widget(slider)
Exemplo n.º 3
0
    def __init__(self, particle):
        super(EndColorPanel, self).__init__()

        self.orientation = 'vertical'
        self.ps = particle
        self.sliders = []

        self.add_widget(Label(text='End Color', size_hint_y=None, height=50))

        for param in END_COLOR_PARAMETERS:
            slider = ParamSlider(param, default=get_param_default(self.ps.particle, param['name'], param['label']), callback=self.ps.update_param)
            self.sliders.append(slider)
            self.add_widget(slider)

            if END_COLOR_PARAMETERS.index(param) == 3:
                self.add_widget(Label(text='End Color Variance', size_hint_y=None, height=50))