11export default class Scene {
22
33 constructor ( draw_function ) {
4- this . _draw_function = draw_function ;
5- this . _click_function = function ( ) { } ;
6- this . _mouse_moved_function = function ( ) { } ;
7- this . _mouse_dragged_function = function ( ) { } ;
8- this . _key_pressed_function = function ( ) { } ;
9- this . _key_released_function = function ( ) { } ;
4+ this . _draw_function = draw_function ;
5+ this . _click_function = function ( ) { } ;
6+ this . _mouse_moved_function = function ( ) { } ;
7+ this . _mouse_dragged_function = function ( ) { } ;
8+ this . _mouse_pressed_function = function ( ) { } ;
9+ this . _mouse_released_function = function ( ) { } ;
10+ this . _key_pressed_function = function ( ) { } ;
11+ this . _key_released_function = function ( ) { } ;
1012 vignettes . add_scene ( this ) ;
1113 }
1214
1315 draw ( ) {
1416 this . _draw_function ( ) ;
1517 }
1618
17- click ( ) {
18- this . _click_function ( ) ;
19- }
20-
21- mouse_moved ( ) {
22- this . _mouse_moved_function ( ) ;
23- }
24-
25- mouse_dragged ( ) {
26- this . _mouse_dragged_function ( ) ;
27- }
28-
29- key_pressed ( ) {
30- this . _key_pressed_function ( ) ;
19+ get click ( ) {
20+ return this . _click_function ;
3121 }
3222
33- key_released ( keyboard_event ) {
34- this . _key_released_function ( ) ;
23+ get mouse_pressed ( ) {
24+ return this . _mouse_pressed_function ;
3525 }
3626
37- get click ( ) {
38- return this . _click_function ;
27+ get mouse_released ( ) {
28+ return this . _mouse_released_function ;
3929 }
4030
4131 get mouse_moved ( ) {
@@ -58,6 +48,14 @@ export default class Scene{
5848 this . _click_function = func ;
5949 }
6050
51+ set mouse_pressed ( func ) {
52+ this . _mouse_pressed_function = func ;
53+ }
54+
55+ set mouse_released ( func ) {
56+ this . _mouse_released_function = func ;
57+ }
58+
6159 set mouse_moved ( func ) {
6260 this . _mouse_moved_function = func ;
6361 }
0 commit comments