/
particlebuilder.kv
853 lines (815 loc) · 31.3 KB
/
particlebuilder.kv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
#:kivy 1.4.1
ParticleBuilder:
<ParticleBuilder>:
params_layout: params_layout
particle_window: particle_window
load_save: load_save
descriptions: descriptions
FloatLayout:
canvas:
Color:
rgb: (.1, .1, .1)
Rectangle:
pos: root.pos
size: root.size
size_hint: (1., 1.)
ParticleLoadSaveLayout:
id: load_save
pos: root.pos[0] + root.width*.02, root.pos[1] + root.height*.032
size: (root.size[0]/2 - root.size[0]*.04, root.size[1]/8)
ParticleParamsLayout:
id: params_layout
pos: root.pos[0] + root.width*.02 + root.width/2, root.pos[1] + root.height*.032
size: (root.size[0]/2. - root.size[0]*.04, root.size[1] - root.size[1]*.064)
VariableDescriptions:
id: descriptions
pos: root.pos[0] + root.width*.93, root.pos[1] + root.height*.89
size: (root.size[0]/17, root.size[0]/17)
FloatLayout:
id: particle_window
pos: root.pos[0] + root.width*.02, root.pos[1] + root.height*.032 + root.height/8
size: (root.size[0]/2 - root.size[0]*.04, root.size[1] - root.size[1]*.064 - root.height/8)
on_size:
root.adjust_particle_system_position(self.pos[0] + self.width *.5, self.pos[1] + self.height *.5)
canvas:
Color:
rgb: (0., 0., 0.)
Rectangle:
pos: self.pos
size: self.size
DebugPanel:
size_hint: (.3, .1)
pos: (root.pos[0]+root.size[0]*.34, root.pos[1]+root.height*.89)
WorkingFile:
size_hint: (.7, .1)
pos: (root.pos[0] + root.width*.02, root.pos[1]+root.height*.89)
filename: root.active_filename
<ParticleLoadSaveLayout>:
BoxLayout:
size: root.size
pos: root.pos
orientation: 'horizontal'
spacing: 4
padding: 10
Button:
id: saveasbutton
size_hint: (.3,1)
on_state: root.show_save_popup() if (self.state == 'down') else None
BoxLayout:
pos: saveasbutton.pos
size: saveasbutton.size
orientation: 'horizontal'
padding: 5
spacing: 5
Image:
source: "media/icons/5_content_save_as.png"
size_hint: (.4, 1.)
Label:
text: 'Save As'
size_hint: (.6, 1.)
font_size: root.size[0]*.03
text_size: self.size
halign: 'left'
valign: 'middle'
Button:
id: savebutton
size_hint: (.3,1)
on_state: root.save_pressed() if (self.state == 'down') else None
BoxLayout:
pos: savebutton.pos
size: savebutton.size
orientation: 'horizontal'
padding: 5
spacing: 5
Image:
source: "media/icons/5_content_save.png"
size_hint: (.4, 1.)
Label:
text: 'Save'
size_hint: (.6, 1.)
font_size: root.size[0]*.03
text_size: self.size
halign: 'left'
valign: 'middle'
Button:
id: loadbutton
size_hint: (.3,1)
font_size: root.size[0]*.04
halign: 'center'
valign: 'middle'
on_state: root.show_load_popup() if (self.state == 'down') else None
BoxLayout:
pos: loadbutton.pos
size: loadbutton.size
orientation: 'horizontal'
padding: 5
Image:
source: "media/icons/4_collections_collection.png"
size_hint: (.5, 1.)
Label:
text: 'Load'
size_hint: (.5, 1.)
font_size: root.size[0]*.03
text_size: self.size
halign: 'left'
valign: 'middle'
<DebugPanel>:
fps: root.fps
Label:
pos: root.pos
size: root.size
font_size: root.size[1]*.28
halign: 'center'
valign: 'middle'
color: (1,1,1,1)
text: 'FPS: ' + root.fps if root.fps != None else 'FPS:'
<WorkingFile>:
Label:
pos: root.pos
size: root.size
font_size: root.size[1]*.28
halign: 'left'
valign: 'middle'
text_size: self.size
text: ' ' + root.filename if root.filename != None else ""
<VariableDescriptions>:
BoxLayout:
pos: root.pos
size: root.size
Image:
center: root.center
source: "media/icons/2_action_help.png"
size_hint: (.9, .9)
color: (.19921875, .70703125, .89453125, 1.)
on_touch_down: self.collide_point(*args[1].pos) and root.tab_info()
<GetNewFileNameLayout>:
fname_input: fname_input
BoxLayout:
size_hint: (1., 1.)
margin: 10
spacing: 10
orientation: 'vertical'
pos: (root.pos[0],root.pos[1]+root.size[1]*.68)
size: root.size
TextInput:
id: fname_input
multiline: False
text: ''
size_hint_y: None
font_size: self.height * .5
height: 50
focus: True
BoxLayout:
orientation: 'horizontal'
margin: 10
spacing: 10
size_hint_y: None
height: 50
Widget:
size_hint_x: .15
Button:
size_hint_x: .35
text: 'Cancel'
font_size: self.size[1] * .35
on_release: root.cancel()
Button:
size_hint_x: .35
text: 'OK'
font_size: self.size[1] * .35
on_release: root.ok()
Widget:
size_hint_x: .15
[FilenameButton@BoxLayout]
thisisabutton: True
orientation: 'horizontal'
size_hint_x: 1
size_hint_y: None
height: ctx.height
Image:
source: ctx.icon
size_hint_x: None
size_hint_y: 1.
width: self.height
on_touch_down: self.collide_point(*args[1].pos) and ctx.callback(ctx.text)
Widget:
# spacer
size_hint_x: None
width: 10
Label:
size_hint_x: None
text: ctx.text
valign: 'middle'
halign: 'left'
font_size: self.height * .46
on_texture_size: self.size = args[1]
on_touch_down: self.collide_point(*args[1].pos) and ctx.callback(self.text)
<ParticleParamsLayout>:
particle_tabs: particle_tabs
BoxLayout:
pos: root.pos
size: root.size
TabbedPanel:
id: particle_tabs
pos: root.pos
size: root.size
tab_width: root.size[0]*.3
tab_height: root.size[1]*.08
default_tab_content: root.get_default_tab()
default_tab_text: 'Hello'
<Default_Particle_Panel>:
Label:
center: root.center
text: 'Load A File to\nBegin Editing'
font_size: root.size[0]*.06
<Particle_Color_Sliders>:
color_r_slider: color_r_slider
color_g_slider: color_g_slider
color_b_slider: color_b_slider
color_a_slider: color_a_slider
slider_text: root.slider_text
BoxLayout:
size: root.size
pos: root.pos
orientation: 'vertical'
padding: 5
Slider:
id: color_r_slider
size_hint: (1., .23)
min: 0.0
max: 1.0
value: 1.
orientation: 'horizontal'
on_value: root.color_r = root.clip(self.value, self.min, self.max)
canvas:
Color:
rgba: (self.value, 0, 0, 1.)
Rectangle:
pos: self.pos[0] + self.size[0]*.22, self.pos[1] - self.size[1]*.15
size: self.size[0]*.54, self.size[1]*.3
Label:
size_hint: (1.,.001)
text: 'R +/- ' + str(int(root.color_r_slider.value * 255))
font_size: root.size[0]*.07
bold: True
Slider:
id: color_g_slider
size_hint: (1., 0.23)
min: 0.0
max: 1.0
value: 1.
orientation: 'horizontal'
on_value: root.color_g = root.clip(self.value, self.min, self.max)
canvas:
Color:
rgba: (0, self.value, 0, 1.)
Rectangle:
pos: self.pos[0] + self.size[0]*.22, self.pos[1] - self.size[1]*.15
size: self.size[0]*.54, self.size[1]*.3
Label:
size_hint: (1.,.001)
text: 'G +/- ' + str(int(root.color_g_slider.value * 255))
font_size: root.size[0]*.07
bold: True
Slider:
id: color_b_slider
size_hint: (1., 0.23)
min: 0.0
max: 1.0
value: 1.
orientation: 'horizontal'
on_value: root.color_b = root.clip(self.value, self.min, self.max)
canvas:
Color:
rgba: (0, 0, self.value, 1.)
Rectangle:
pos: self.pos[0] + self.size[0]*.22, self.pos[1] - self.size[1]*.15
size: self.size[0]*.54, self.size[1]*.3
Label:
size_hint: (1.,.001)
text: 'B +/- ' + str(int(root.color_b_slider.value * 255))
font_size: root.size[0]*.07
bold: True
Slider:
id: color_a_slider
size_hint: (1., 0.23)
min: 0.0
max: 1.0
value: 1.0
orientation: 'horizontal'
on_value: root.color_a = root.clip(self.value, self.min, self.max)
canvas:
Color:
rgba: (0, 0, 0, self.value)
Rectangle:
pos: self.pos[0] + self.size[0]*.22, self.pos[1] - self.size[1]*.15
size: self.size[0]*.54, self.size[1]*.3
Label:
size_hint: (1.,.001)
text: 'A +/- ' + str(int(root.color_a_slider.value * 100)) + '%'
font_size: root.size[0]*.07
bold: True
<Particle_Property_Slider>:
prop_slider: prop_slider
slider_text: root.slider_text
value: 0
BoxLayout:
pos: root.pos
size: root.size
orientation: 'horizontal'
Label:
size_hint: (.2, 1.)
text: root.slider_text if root.slider_text is not None else 'No Label'
font_size: root.size[0]*.02
halign: 'center'
valign: 'middle'
Label:
size_hint: (.1, 1.)
text: '[b]-[/b]'
font_size: root.size[0]*.05
markup: True
on_touch_down: self.collide_point(*args[1].pos) and root.decrement_slider()
Slider:
id: prop_slider
size_hint: (.4, 1.)
orientation: 'horizontal'
min: root.slider_bounds_min
max: root.slider_bounds_max
value: root.slider_bounds_init_value
on_value: root.value = self.value
step: root.slider_step
Label:
size_hint: (.1, 1.)
text: '[b]+[/b]'
font_size: root.size[0]*.05
markup: True
on_touch_down: self.collide_point(*args[1].pos) and root.increment_slider()
Label:
size_hint: (.2, 1.)
text: str(round(root.prop_slider.value,1))
font_size: root.size[0]*.04
halign: 'center'
valign: 'middle'
<ImageChooser>:
BoxLayout:
pos: root.pos
size:root.size
orientation: 'horizontal'
Button:
id: choose_image_button
size_hint: (.7, 1.)
text: root.button_text
font_size: root.size[0]*.03
on_release: root.button_callback()
background_color: (255,255,255,.35)
Image:
size_hint: (.3, 1.)
source: root.image_location
on_touch_down: self.collide_point(*args[1].pos) and root.button_callback()
<ImageChooserCell>:
Image:
pos: root.pos
size: root.size
# allow_stretch: True
source: root.image_location if root.image_location is not None else None
on_touch_down: self.collide_point(*args[1].pos) and root.cell_press()
<LoadParticlePopupContents>:
blayout: blayout
userbutton: userbutton
templatebutton: templatebutton
ScrollViewWithBars:
pos: root.pos
size: root.size
do_scroll_x: False
scroll_distance: 5
scroll_timeout: 250
BoxLayout:
id: blayout
size_hint_x: 1.
size_hint_y: None
height: root.blayout_height
orientation: 'vertical'
padding: 10
spacing: 5
BoxLayout:
orientation: 'horizontal'
size_hint_x: 1.
size_hint_y: None
height: root.menu_height
ToggleButton:
id: templatebutton
text: 'templates'
group: 'importmode'
state: 'down'
on_state: root.button_callback('load templates') if self.state == 'down' else None
size_hint: (.5, 1)
font_size: self.size[1]*.35
ToggleButton:
id: userbutton
text: 'user files'
group: 'importmode'
on_state: root.button_callback('load user files') if self.state == 'down' else None
size_hint: (.5, 1)
font_size: self.size[1]*.35
<SaveParticlePopupContents>:
blayout: blayout
ScrollViewWithBars:
pos: root.pos
size: root.size
BoxLayout:
id: blayout
size_hint_x: 1.
size_hint_y: None
height: root.blayout_height
orientation: 'vertical'
padding: 10
spacing: 5
<ParticlePanel>:
max_particles_slider: max_particles_slider
image_chooser_button: image_chooser_button
life_span_slider: life_span_slider
life_span_variance_slider: life_span_variance_slider
start_size_slider: start_size_slider
start_size_variance_slider: start_size_variance_slider
end_size_slider: end_size_slider
end_size_variance_slider: end_size_variance_slider
emit_angle_slider: emit_angle_slider
emit_angle_variance_slider: emit_angle_variance_slider
start_rotation_slider: start_rotation_slider
start_rotation_variance_slider: start_rotation_variance_slider
end_rotation_slider: end_rotation_slider
end_rotation_variance_slider: end_rotation_variance_slider
BoxLayout:
pos: root.pos
size: root.size
orientation: 'vertical'
padding: 8
ImageChooser:
id: image_chooser_button
size_hint: (1., .2)
on_image_location: root.texture_path = self.image_location
Particle_Property_Slider:
id: max_particles_slider
size_hint: (1., .2)
slider_text: 'Max Particles'
slider_bounds_min: root.max_num_particles_min
slider_bounds_max: root.max_num_particles_max
slider_bounds_init_value: root.max_num_particles
on_value: root.max_num_particles = self.value
Particle_Property_Slider:
id: life_span_slider
size_hint: (1., .2)
slider_text: 'Life Span'
slider_bounds_min: root.life_span_min
slider_bounds_max: root.life_span_max
slider_bounds_init_value: root.life_span
slider_step: .025
increment_slider_by: .1
on_value: root.life_span = self.value
Particle_Property_Slider:
id: life_span_variance_slider
size_hint: (1., .2)
slider_text: 'Life Span\n Variance'
increment_slider_by: .1
slider_bounds_min: root.life_span_variance_min
slider_bounds_max: root.life_span_variance_max
slider_bounds_init_value: root.life_span_variance
slider_step: .025
on_value: root.life_span_variance = self.value
Particle_Property_Slider:
id: start_size_slider
size_hint: (1., .2)
slider_text: 'Start Size'
slider_bounds_min: root.start_size_min
slider_bounds_max: root.start_size_max
slider_bounds_init_value: root.start_size
on_value: root.start_size = self.value
Particle_Property_Slider:
id: start_size_variance_slider
size_hint: (1., .2)
slider_text: 'Start Size\n Variance'
slider_bounds_min: root.start_size_variance_min
slider_bounds_max: root.start_size_variance_max
slider_bounds_init_value: root.start_size_variance
on_value: root.start_size_variance = self.value
Particle_Property_Slider:
id: end_size_slider
size_hint: (1., .2)
slider_text: 'End Size'
slider_bounds_min: root.end_size_min
slider_bounds_max: root.end_size_max
slider_bounds_init_value: root.end_size
on_value: root.end_size = self.value
Particle_Property_Slider:
id: end_size_variance_slider
size_hint: (1., .2)
slider_text: 'End Size\n Variance'
slider_bounds_min: root.end_size_variance_min
slider_bounds_max: root.end_size_variance_max
slider_bounds_init_value: root.end_size_variance
on_value: root.end_size_variance = self.value
Particle_Property_Slider:
id: emit_angle_slider
size_hint: (1., .2)
slider_text: 'Emit Angle'
slider_bounds_min: root.emit_angle_min
slider_bounds_max: root.emit_angle_max
slider_bounds_init_value: root.emit_angle
on_value: root.emit_angle = self.value
Particle_Property_Slider:
id: emit_angle_variance_slider
size_hint: (1., .2)
slider_text: 'Emit Angle\n Variance'
slider_bounds_min: root.emit_angle_variance_min
slider_bounds_max: root.emit_angle_variance_max
slider_bounds_init_value: root.emit_angle_variance
on_value: root.emit_angle_variance = self.value
Particle_Property_Slider:
id: start_rotation_slider
size_hint: (1., .2)
slider_text: 'Start Rotation'
slider_bounds_min: root.start_rotation_min
slider_bounds_max: root.start_rotation_max
slider_bounds_init_value: root.start_rotation
on_value: root.start_rotation = self.value
Particle_Property_Slider:
id: start_rotation_variance_slider
size_hint: (1., .2)
slider_text: 'Start Rotation\n Variance'
slider_bounds_min: root.start_rotation_variance_min
slider_bounds_max: root.start_rotation_variance_max
slider_bounds_init_value: root.start_rotation_variance
on_value: root.start_rotation_variance = self.value
Particle_Property_Slider:
id: end_rotation_slider
size_hint: (1., .2)
slider_text: 'End Rotation'
slider_bounds_min: root.end_rotation_min
slider_bounds_max: root.end_rotation_max
slider_bounds_init_value: root.end_rotation
on_value: root.end_rotation = self.value
Particle_Property_Slider:
id: end_rotation_variance_slider
size_hint: (1., .2)
slider_text: 'End Rotation\n Variance'
slider_bounds_min: root.end_rotation_variance_min
slider_bounds_max: root.end_rotation_variance_max
slider_bounds_init_value: root.end_rotation_variance
on_value: root.end_rotation_variance = self.value
<BehaviorPanel>:
gravity_button: gravity_button
radial_button: radial_button
emitter_x_variance_slider: emitter_x_variance_slider
emitter_y_variance_slider: emitter_y_variance_slider
gravity_x_slider: gravity_x_slider
gravity_y_slider: gravity_y_slider
speed_slider: speed_slider
speed_variance_slider: speed_variance_slider
radial_acceleration_slider: radial_acceleration_slider
radial_acceleration_variance_slider: radial_acceleration_variance_slider
tangential_acceleration_slider: tangential_acceleration_slider
tangential_acceleration_variance_slider: tangential_acceleration_variance_slider
max_radius_slider: max_radius_slider
max_radius_variance_slider: max_radius_variance_slider
min_radius_slider: min_radius_slider
rotate_per_second_slider: rotate_per_second_slider
rotate_per_second_variance_slider: rotate_per_second_variance_slider
BoxLayout:
pos: root.pos[0], root.pos[1] + root.height*.9
size: root.width, root.height*.1
orientation: 'horizontal'
size_hint: (1., .1)
padding: 8
ToggleButton:
id: gravity_button
text: 'Gravity Emitter'
font_size: root.size[0]*.03
group: 'emitter_type'
background_color: (255,255,255,.35) if self.state == 'normal' else (0,1,1,1)
on_state: root.set_emitter_type(0) if self.state == 'down' else None
ToggleButton:
id: radial_button
text: 'Radial Emitter'
font_size: root.size[0]*.03
group: 'emitter_type'
background_color: (255,255,255,.35) if self.state == 'normal' else (0,1,1,1)
on_state: root.set_emitter_type(1) if self.state == 'down' else None
BoxLayout:
pos: root.pos if root.emitter_type == 0 else (-100, -100)
size: root.size[0], root.size[1]*.9 if root.emitter_type == 0 else (1, 1)
orientation: 'vertical'
Particle_Property_Slider:
id: emitter_x_variance_slider
size_hint: (1., .1)
slider_text: 'Emitter X\n Variance'
slider_bounds_min: root.emitter_x_variance_min
slider_bounds_max: root.emitter_x_variance_max
slider_bounds_init_value: root.emitter_x_variance
on_value: root.emitter_x_variance = self.value
Particle_Property_Slider:
id: emitter_y_variance_slider
size_hint: (1., .1)
slider_text: 'Emitter Y\n Variance'
slider_bounds_min: root.emitter_y_variance_min
slider_bounds_max: root.emitter_y_variance_max
slider_bounds_init_value: root.emitter_y_variance
on_value: root.emitter_y_variance = self.value
Particle_Property_Slider:
id: gravity_x_slider
size_hint: (1., .1)
slider_text: 'Gravity X'
slider_bounds_min: root.gravity_x_min
slider_bounds_max: root.gravity_x_max
slider_bounds_init_value: root.gravity_x
on_value: root.gravity_x = self.value
Particle_Property_Slider:
id: gravity_y_slider
size_hint: (1., .1)
slider_text: 'Gravity Y'
slider_bounds_min: root.gravity_y_min
slider_bounds_max: root.gravity_y_max
slider_bounds_init_value: root.gravity_y
on_value: root.gravity_y = self.value
Particle_Property_Slider:
id: speed_slider
size_hint: (1., .1)
slider_text: 'Speed'
slider_bounds_min: root.speed_min
slider_bounds_max: root.speed_max
slider_bounds_init_value: root.speed
on_value: root.speed = self.value
Particle_Property_Slider:
id: speed_variance_slider
size_hint: (1., .1)
slider_text: 'Speed\n Variance'
slider_bounds_min: root.speed_variance_min
slider_bounds_max: root.speed_variance_max
slider_bounds_init_value: root.speed_variance
on_value: root.speed_Variance = self.value
Particle_Property_Slider:
id: radial_acceleration_slider
size_hint: (1., .1)
slider_text: 'Radial\n Acceleration'
slider_bounds_min: root.radial_acceleration_min
slider_bounds_max: root.radial_acceleration_max
slider_bounds_init_value: root.radial_acceleration
on_value: root.radial_acceleration = self.value
Particle_Property_Slider:
id: radial_acceleration_variance_slider
size_hint: (1., .1)
slider_text: 'Radial\n Accel. Variance'
slider_bounds_min: root.radial_acceleration_variance_min
slider_bounds_max: root.radial_acceleration_variance_max
slider_bounds_init_value: root.radial_acceleration_variance
on_value: root.radial_acceleration_variance = self.value
Particle_Property_Slider:
id: tangential_acceleration_slider
size_hint: (1., .1)
slider_text: 'Tangential\n Acceleration'
slider_bounds_min: root.tangential_acceleration_min
slider_bounds_max: root.tangential_acceleration_max
slider_bounds_init_value: root.tangential_acceleration
on_value: root.tangential_acceleration = self.value
Particle_Property_Slider:
id: tangential_acceleration_variance_slider
size_hint: (1., .1)
slider_text: 'Tangential\n Accel. Variance'
slider_bounds_min: root.tangential_acceleration_variance_min
slider_bounds_max: root.tangential_acceleration_variance_max
slider_bounds_init_value: root.tangential_acceleration_variance
on_value: root.tangential_acceleration_variance = self.value
BoxLayout:
pos: root.pos if root.emitter_type == 1 else (-100, -100)
size: root.size[0], root.size[1]*.9 if root.emitter_type == 1 else (1, 1)
orientation: 'vertical'
Particle_Property_Slider:
id: max_radius_slider
size_hint: (1., .1)
slider_text: 'Max Radius'
slider_bounds_min: root.max_radius_min
slider_bounds_max: root.max_radius_max
slider_bounds_init_value: root.max_radius
on_value: root.max_radius = self.value
Particle_Property_Slider:
id: max_radius_variance_slider
size_hint: (1., .1)
slider_text: 'Max Radius\n Variance'
slider_bounds_min: root.max_radius_variance_min
slider_bounds_max: root.max_radius_variance_max
slider_bounds_init_value: root.max_radius_variance
on_value: root.max_radius_variance = self.value
Particle_Property_Slider:
id: min_radius_slider
size_hint: (1., .1)
slider_text: 'Min Radius'
slider_bounds_min: root.min_radius_min
slider_bounds_max: root.min_radius_max
slider_bounds_init_value: root.min_radius
on_value: root.min_radius = self.value
Particle_Property_Slider:
id: rotate_per_second_slider
size_hint: (1., .1)
slider_text: 'Rotate\n Per Second'
slider_bounds_min: root.rotate_per_second_min
slider_bounds_max: root.rotate_per_second_max
slider_bounds_init_value: root.rotate_per_second
step: .025
on_value: root.rotate_per_second = self.value
Particle_Property_Slider:
id: rotate_per_second_variance_slider
size_hint: (1., .1)
slider_text: 'Rotate\n Per Second\n Variance'
slider_bounds_min: root.rotate_per_second_variance_min
slider_bounds_max: root.rotate_per_second_variance_max
slider_bounds_init_value: root.rotate_per_second_variance
step: .025
on_value: root.rotate_per_second_variance = self.value
<ColorPanel>:
start_color_picker: start_color_picker
end_color_picker: end_color_picker
start_color_variation_sliders: start_color_variation_sliders
end_color_variation_sliders: end_color_variation_sliders
blend_func_chooser: blend_func_chooser
current_blend_src: blend_func_chooser.current_src
current_blend_dest: blend_func_chooser.current_dest
BoxLayout:
pos: root.pos
size: root.size
orientation: 'vertical'
padding: 10
Label:
text: "[b]Start Color[/b]"
font_size: root.size[0]*.032
size_hint_y: None
height: 20
markup: True
BoxLayout:
orientation: 'horizontal'
size_hint: (1., 0.45)
CBLColorPicker:
id: start_color_picker
size_hint: (0.6, 1.)
bg_color: (1, 1, 1, 0)
on_selected_color: root.start_color = self.selected_color
Particle_Color_Sliders:
size_hint: (0.4,1.)
id: start_color_variation_sliders
slider_text: 'Variation RGBA'
on_color_r: root.start_color_r_variance = self.color_r
on_color_g: root.start_color_g_variance = self.color_g
on_color_b: root.start_color_b_variance = self.color_b
on_color_a: root.start_color_a_variance = self.color_a
Label:
text: "[b]End Color[/b]"
font_size: root.size[0]*.032
size_hint_y: None
height: 20
markup: True
BoxLayout:
orientation: 'horizontal'
size_hint: (1., 0.45)
CBLColorPicker:
id: end_color_picker
size_hint: (0.6, 1.)
bg_color: (1, 1, 1, 0)
on_selected_color: root.end_color = self.selected_color
Particle_Color_Sliders:
id: end_color_variation_sliders
size_hint: (0.4, 1.)
slider_text: 'Variation RGBA'
on_color_r: root.end_color_r_variance = self.color_r
on_color_g: root.end_color_g_variance = self.color_g
on_color_b: root.end_color_b_variance = self.color_b
on_color_a: root.end_color_a_Variance = self.color_a
BlendFuncChooser:
id: blend_func_chooser
size_hint: (1., .1)
<BlendFuncChooser>:
blend_button: blend_button
orientation: 'vertical'
Label:
text: 'Blend Function'
size_hint: (.9, .4)
font_size: root.size[0]*.03
halign: 'left'
Button:
id: blend_button
text: 'Source -> Dest'
font_size: root.size[0]*.03
size_hint: (.9, .6)
on_press: root.open_popup()
<BlendFuncChoices>:
choices_box: choices_box
src_choices_box: src_choices_box
dest_choices_box: dest_choices_box
background_color: (0, 0, 0, 0)
pos_hint: {'x': .5, 'y': .2}
size_hint: (.5, .6)
BoxLayout:
id: choices_box
orientation: 'horizontal'
BoxLayout:
id: src_choices_box
orientation: 'vertical'
BoxLayout
id: dest_choices_box
orientation: 'vertical'