Gorgon Game Engine
Layer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../Layer.h"
4 #include "../Geometry/Bounds.h"
5 
6 namespace Gorgon { namespace Input {
7 
25  class Layer : public Gorgon::Layer {
26  public:
28 
31 
36  void SetHitCheck(std::function<bool(Layer &, Geometry::Point)> fn) {
37  hitcheck = fn;
38  }
39 
44  void SetHitCheck(std::function<bool(Geometry::Point)> fn) {
45  hitcheck = [fn](Layer &, Geometry::Point point) { return fn(point); };
46  }
47 
52  template<class C_>
53  void SetHitCheck(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point)) {
54  C_ *my = &c;
55  hitcheck = [fn, my](Layer &layer, Geometry::Point point) { return (my->*fn)(layer, point); };
56  }
57 
62  template<class C_>
63  void SetHitCheck(C_ &c, bool(C_::*fn)(Geometry::Point)) {
64  C_ *my = &c;
65  hitcheck = [fn, my](Layer &, Geometry::Point point) { return (my->*fn)(point); };
66  }
67 
72  template<class C_>
73  void SetHitCheck(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point)) {
74  hitcheck = [fn, my](Layer &layer, Geometry::Point point) { return (my->*fn)(layer, point); };
75  }
76 
81  template<class C_>
82  void SetHitCheck(C_ *my, bool(C_::*fn)(Geometry::Point)) {
83  hitcheck = [fn, my](Layer &, Geometry::Point point) { return (my->*fn)(point); };
84  }
85 
87  void ResetHitCheck() {
88  hitcheck = {};
89  }
90 
91 
92 
95  void SetClick(std::function<void(Layer &, Geometry::Point, Input::Mouse::Button)> fn) {
96  click = fn;
97  }
98 
101  void SetClick(std::function<void(Geometry::Point, Input::Mouse::Button)> fn) {
102  click = [fn](Layer &, Geometry::Point point, Input::Mouse::Button btn) { fn(point, btn); };
103  }
104 
107  template<class C_>
108  void SetClick(C_ &c, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button)) {
109  C_ *my = &c;
110  click = [fn, my](Layer &layer, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(layer, point, btn); };
111  }
112 
115  template<class C_>
116  void SetClick(C_ &c, void(C_::*fn)(Geometry::Point, Input::Mouse::Button)) {
117  C_ *my = &c;
118  click = [fn, my](Layer &, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(point, btn); };
119  }
120 
123  template<class C_>
124  void SetClick(C_ *my, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button)) {
125  click = [fn, my](Layer &layer, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(layer, point, btn); };
126  }
127 
130  template<class C_>
131  void SetClick(C_ *my, void(C_::*fn)(Geometry::Point, Input::Mouse::Button)) {
132  click = [fn, my](Layer &, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(point, btn); };
133  }
134 
137  void SetClick(std::function<void(Layer &, Input::Mouse::Button)> fn) {
138  click = [fn](Layer &layer, Geometry::Point, Input::Mouse::Button btn) { fn(layer, btn); };
139  }
140 
143  void SetClick(std::function<void(Input::Mouse::Button)> fn) {
144  click = [fn](Layer &, Geometry::Point, Input::Mouse::Button btn) { fn(btn); };
145  }
146 
149  template<class C_>
150  void SetClick(C_ &c, void(C_::*fn)(Layer &, Input::Mouse::Button)) {
151  C_ *my = &c;
152  click = [fn, my](Layer &layer, Input::Mouse::Button btn) { (my->*fn)(layer, btn); };
153  }
154 
157  template<class C_>
158  void SetClick(C_ &c, void(C_::*fn)(Input::Mouse::Button)) {
159  C_ *my = &c;
160  click = [fn, my](Layer &, Geometry::Point, Input::Mouse::Button btn) { (my->*fn)(btn); };
161  }
162 
165  template<class C_>
166  void SetClick(C_ *my, void(C_::*fn)(Layer &, Input::Mouse::Button)) {
167  click = [fn, my](Layer &layer, Input::Mouse::Button btn) { (my->*fn)(layer, btn); };
168  }
169 
172  template<class C_>
173  void SetClick(C_ *my, void(C_::*fn)(Input::Mouse::Button)) {
174  click = [fn, my](Layer &, Geometry::Point, Input::Mouse::Button btn) { (my->*fn)(btn); };
175  }
176 
180  click = [fn, btn](Layer &layer, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) fn(layer, point); };
181  }
182 
186  click = [fn, btn](Layer &, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) fn(point); };
187  }
188 
191  template<class C_>
193  C_ *my = &c;
194  click = [fn, my, btn](Layer &layer, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer, point); };
195  }
196 
199  template<class C_>
201  C_ *my = &c;
202  click = [fn, my, btn](Layer &, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(point); };
203  }
204 
207  template<class C_>
209  click = [fn, my, btn](Layer &layer, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer, point); };
210  }
211 
214  template<class C_>
216  click = [fn, my, btn](Layer &, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(point); };
217  }
218 
221  void SetClick(std::function<void(Layer &)> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
222  click = [fn, btn](Layer &layer, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) fn(layer); };
223  }
224 
227  void SetClick(std::function<void()> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
228  click = [fn, btn](Layer &, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) fn(); };
229  }
230 
233  template<class C_>
234  void SetClick(C_ &c, void(C_::*fn)(Layer &), Input::Mouse::Button btn = Input::Mouse::Button::Left) {
235  C_ *my = &c;
236  click = [fn, my, btn](Layer &layer, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer); };
237  }
238 
241  template<class C_>
242  void SetClick(C_ &c, std::function<void(C_ &)> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
243  C_ *my = &c;
244  click = [fn, my, btn](Layer &, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(); };
245  }
246 
249  template<class C_>
250  void SetClick(C_ *my, void(C_::*fn)(Layer &), Input::Mouse::Button btn = Input::Mouse::Button::Left) {
251  click = [fn, my, btn](Layer &layer, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer); };
252  }
253 
256  template<class C_>
257  void SetClick(C_ *my, std::function<void(C_ &)> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
258  click = [fn, my, btn](Layer &, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(); };
259  }
260 
262  void ResetClick() {
263  click = {};
264  }
265 
266 
267 
270  void SetDown(std::function<void(Layer &, Geometry::Point, Input::Mouse::Button)> fn) {
271  down = fn;
272  }
273 
276  void SetDown(std::function<void(Geometry::Point, Input::Mouse::Button)> fn) {
277  down = [fn](Layer &, Geometry::Point point, Input::Mouse::Button btn) { fn(point, btn); };
278  }
279 
282  template<class C_>
283  void SetDown(C_ &c, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button)) {
284  C_ *my = &c;
285  down = [fn, my](Layer &layer, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(layer, point, btn); };
286  }
287 
290  template<class C_>
291  void SetDown(C_ &c, void(C_::*fn)(Geometry::Point, Input::Mouse::Button)) {
292  C_ *my = &c;
293  down = [fn, my](Layer &, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(point, btn); };
294  }
295 
298  template<class C_>
299  void SetDown(C_ *my, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button)) {
300  down = [fn, my](Layer &layer, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(layer, point, btn); };
301  }
302 
305  template<class C_>
306  void SetDown(C_ *my, void(C_::*fn)(Geometry::Point, Input::Mouse::Button)) {
307  down = [fn, my](Layer &, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(point, btn); };
308  }
309 
312  void SetDown(std::function<void(Layer &, Input::Mouse::Button)> fn) {
313  down = [fn](Layer &layer, Geometry::Point, Input::Mouse::Button btn) { fn(layer, btn); };
314  }
315 
318  void SetDown(std::function<void(Input::Mouse::Button)> fn) {
319  down = [fn](Layer &, Geometry::Point, Input::Mouse::Button btn) { fn(btn); };
320  }
321 
324  template<class C_>
325  void SetDown(C_ &c, void(C_::*fn)(Layer &, Input::Mouse::Button)) {
326  C_ *my = &c;
327  down = [fn, my](Layer &layer, Input::Mouse::Button btn) { (my->*fn)(layer, btn); };
328  }
329 
332  template<class C_>
333  void SetDown(C_ &c, void(C_::*fn)(Input::Mouse::Button)) {
334  C_ *my = &c;
335  down = [fn, my](Layer &, Geometry::Point, Input::Mouse::Button btn) { (my->*fn)(btn); };
336  }
337 
340  template<class C_>
341  void SetDown(C_ *my, void(C_::*fn)(Layer &, Input::Mouse::Button)) {
342  down = [fn, my](Layer &layer, Input::Mouse::Button btn) { (my->*fn)(layer, btn); };
343  }
344 
347  template<class C_>
348  void SetDown(C_ *my, void(C_::*fn)(Input::Mouse::Button)) {
349  down = [fn, my](Layer &, Geometry::Point, Input::Mouse::Button btn) { (my->*fn)(btn); };
350  }
351 
355  down = [fn, btn](Layer &layer, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) fn(layer, point); };
356  }
357 
361  down = [fn, btn](Layer &, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) fn(point); };
362  }
363 
366  template<class C_>
368  C_ *my = &c;
369  down = [fn, my, btn](Layer &layer, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer, point); };
370  }
371 
374  template<class C_>
376  C_ *my = &c;
377  down = [fn, my, btn](Layer &, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(point); };
378  }
379 
382  template<class C_>
384  down = [fn, my, btn](Layer &layer, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer, point); };
385  }
386 
389  template<class C_>
391  down = [fn, my, btn](Layer &, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(point); };
392  }
393 
396  void SetDown(std::function<void(Layer &)> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
397  down = [fn, btn](Layer &layer, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) fn(layer); };
398  }
399 
402  void SetDown(std::function<void()> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
403  down = [fn, btn](Layer &, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) fn(); };
404  }
405 
408  template<class C_>
409  void SetDown(C_ &c, void(C_::*fn)(Layer &), Input::Mouse::Button btn = Input::Mouse::Button::Left) {
410  C_ *my = &c;
411  down = [fn, my, btn](Layer &layer, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer); };
412  }
413 
416  template<class C_>
417  void SetDown(C_ &c, std::function<void(C_ &)> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
418  C_ *my = &c;
419  down = [fn, my, btn](Layer &, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(); };
420  }
421 
424  template<class C_>
425  void SetDown(C_ *my, void(C_::*fn)(Layer &), Input::Mouse::Button btn = Input::Mouse::Button::Left) {
426  down = [fn, my, btn](Layer &layer, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer); };
427  }
428 
431  template<class C_>
432  void SetDown(C_ *my, std::function<void(C_ &)> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
433  down = [fn, my, btn](Layer &, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(); };
434  }
435 
437  void ResetDown() {
438  down = {};
439  }
440 
441 
442 
445  void SetUp(std::function<void(Layer &, Geometry::Point, Input::Mouse::Button)> fn) {
446  up = fn;
447  }
448 
451  void SetUp(std::function<void(Geometry::Point, Input::Mouse::Button)> fn) {
452  up = [fn](Layer &, Geometry::Point point, Input::Mouse::Button btn) { fn(point, btn); };
453  }
454 
457  template<class C_>
458  void SetUp(C_ &c, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button)) {
459  C_ *my = &c;
460  up = [fn, my](Layer &layer, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(layer, point, btn); };
461  }
462 
465  template<class C_>
466  void SetUp(C_ &c, void(C_::*fn)(Geometry::Point, Input::Mouse::Button)) {
467  C_ *my = &c;
468  up = [fn, my](Layer &, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(point, btn); };
469  }
470 
473  template<class C_>
474  void SetUp(C_ *my, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button)) {
475  up = [fn, my](Layer &layer, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(layer, point, btn); };
476  }
477 
480  template<class C_>
481  void SetUp(C_ *my, void(C_::*fn)(Geometry::Point, Input::Mouse::Button)) {
482  up = [fn, my](Layer &, Geometry::Point point, Input::Mouse::Button btn) { (my->*fn)(point, btn); };
483  }
484 
487  void SetUp(std::function<void(Layer &, Input::Mouse::Button)> fn) {
488  up = [fn](Layer &layer, Geometry::Point, Input::Mouse::Button btn) { fn(layer, btn); };
489  }
490 
493  void SetUp(std::function<void(Input::Mouse::Button)> fn) {
494  up = [fn](Layer &, Geometry::Point, Input::Mouse::Button btn) { fn(btn); };
495  }
496 
499  template<class C_>
500  void SetUp(C_ &c, void(C_::*fn)(Layer &, Input::Mouse::Button)) {
501  C_ *my = &c;
502  up = [fn, my](Layer &layer, Input::Mouse::Button btn) { (my->*fn)(layer, btn); };
503  }
504 
507  template<class C_>
508  void SetUp(C_ &c, void(C_::*fn)(Input::Mouse::Button)) {
509  C_ *my = &c;
510  up = [fn, my](Layer &, Geometry::Point, Input::Mouse::Button btn) { (my->*fn)(btn); };
511  }
512 
515  template<class C_>
516  void SetUp(C_ *my, void(C_::*fn)(Layer &, Input::Mouse::Button)) {
517  up = [fn, my](Layer &layer, Input::Mouse::Button btn) { (my->*fn)(layer, btn); };
518  }
519 
522  template<class C_>
523  void SetUp(C_ *my, void(C_::*fn)(Input::Mouse::Button)) {
524  up = [fn, my](Layer &, Geometry::Point, Input::Mouse::Button btn) { (my->*fn)(btn); };
525  }
526 
530  up = [fn, btn](Layer &layer, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) fn(layer, point); };
531  }
532 
536  up = [fn, btn](Layer &, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) fn(point); };
537  }
538 
541  template<class C_>
543  C_ *my = &c;
544  up = [fn, my, btn](Layer &layer, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer, point); };
545  }
546 
549  template<class C_>
551  C_ *my = &c;
552  up = [fn, my, btn](Layer &, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(point); };
553  }
554 
557  template<class C_>
559  up = [fn, my, btn](Layer &layer, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer, point); };
560  }
561 
564  template<class C_>
566  up = [fn, my, btn](Layer &, Geometry::Point point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(point); };
567  }
568 
571  void SetUp(std::function<void(Layer &)> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
572  up = [fn, btn](Layer &layer, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) fn(layer); };
573  }
574 
577  void SetUp(std::function<void()> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
578  up = [fn, btn](Layer &, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) fn(); };
579  }
580 
583  template<class C_>
584  void SetUp(C_ &c, void(C_::*fn)(Layer &), Input::Mouse::Button btn = Input::Mouse::Button::Left) {
585  C_ *my = &c;
586  up = [fn, my, btn](Layer &layer, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer); };
587  }
588 
591  template<class C_>
592  void SetUp(C_ &c, std::function<void(C_ &)> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
593  C_ *my = &c;
594  up = [fn, my, btn](Layer &, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(); };
595  }
596 
599  template<class C_>
600  void SetUp(C_ *my, void(C_::*fn)(Layer &), Input::Mouse::Button btn = Input::Mouse::Button::Left) {
601  up = [fn, my, btn](Layer &layer, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(layer); };
602  }
603 
606  template<class C_>
607  void SetUp(C_ *my, std::function<void(C_ &)> fn, Input::Mouse::Button btn = Input::Mouse::Button::Left) {
608  up = [fn, my, btn](Layer &, Geometry::Point, Input::Mouse::Button b) { if(b&&btn) (my->*fn)(); };
609  }
610 
612  void ResetUp() {
613  up = {};
614  }
615 
616 
617 
620  void SetMove(std::function<void(Layer &, Geometry::Point)> fn) {
621  move = fn;
622  }
623 
626  void SetMove(std::function<void(Geometry::Point)> fn) {
627  move = [fn](Layer &, Geometry::Point point) { fn(point); };
628  }
629 
632  template<class C_>
633  void SetMove(C_ &c, void(C_::*fn)(Layer &, Geometry::Point)) {
634  C_ *my = &c;
635  move = [fn, my](Layer &layer, Geometry::Point point) { (my->*fn)(layer, point); };
636  }
637 
640  template<class C_>
641  void SetMove(C_ &c, void(C_::*fn)(Geometry::Point)) {
642  C_ *my = &c;
643  move = [fn, my](Layer &, Geometry::Point point) { (my->*fn)(point); };
644  }
645 
648  template<class C_>
649  void SetMove(C_ *my, void(C_::*fn)(Layer &, Geometry::Point)) {
650  move = [fn, my](Layer &layer, Geometry::Point point) { (my->*fn)(layer, point); };
651  }
652 
655  template<class C_>
656  void SetMove(C_ *my, void(C_::*fn)(Geometry::Point)) {
657  move = [fn, my](Layer &, Geometry::Point point) { (my->*fn)(point); };
658  }
659 
661  void ResetMove() {
662  move = {};
663  }
664 
665 
666 
670  void SetScroll(std::function<bool(Layer &, Geometry::Point, float)> fn) {
671  vscroll = fn;
672  }
673 
677  void SetScroll(std::function<bool(Geometry::Point, float)> fn) {
678  vscroll = [fn](Layer &, Geometry::Point point, float amount) { return fn(point, amount); };
679  }
680 
684  template<class C_>
685  void SetScroll(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float)) {
686  C_ *my = &c;
687  vscroll = [fn, my](Layer &layer, Geometry::Point point, float amount) { return (my->*fn)(layer, point, amount); };
688  }
689 
693  template<class C_>
694  void SetScroll(C_ &c, bool(C_::*fn)(Geometry::Point, float)) {
695  C_ *my = &c;
696  vscroll = [fn, my](Layer &, Geometry::Point point, float amount) { return (my->*fn)(point, amount); };
697  }
698 
702  template<class C_>
703  void SetScroll(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float)) {
704  vscroll = [fn, my](Layer &layer, Geometry::Point point, float amount) { return (my->*fn)(layer, point, amount); };
705  }
706 
710  template<class C_>
711  void SetScroll(C_ *my, bool(C_::*fn)(Geometry::Point, float)) {
712  vscroll = [fn, my](Layer &, Geometry::Point point, float amount) { return (my->*fn)(point, amount); };
713  }
714 
718  void SetScroll(std::function<bool(Layer &, float)> fn) {
719  vscroll = [fn](Layer &layer, Geometry::Point, float amount) { return fn(layer, amount); };
720  }
721 
725  void SetScroll(std::function<bool(float)> fn) {
726  vscroll = [fn](Layer &, Geometry::Point, float amount) { return fn(amount); };
727  }
728 
732  template<class C_>
733  void SetScroll(C_ &c, bool(C_::*fn)(Layer &, float)) {
734  C_ *my = &c;
735  vscroll = [fn, my](Layer &layer, Geometry::Point, float amount) { return (my->*fn)(layer, amount); };
736  }
737 
741  template<class C_>
742  void SetScroll(C_ &c, bool(C_::*fn)(float)) {
743  C_ *my = &c;
744  vscroll = [fn, my](Layer &, Geometry::Point, float amount) { return (my->*fn)(amount); };
745  }
746 
750  template<class C_>
751  void SetScroll(C_ *my, bool(C_::*fn)(Layer &, float)) {
752  vscroll = [fn, my](Layer &layer, Geometry::Point, float amount) { return (my->*fn)(layer, amount); };
753  }
754 
758  template<class C_>
759  void SetScroll(C_ *my, bool(C_::*fn)(float)) {
760  vscroll = [fn, my](Layer &, Geometry::Point, float amount) { return (my->*fn)(amount); };
761  }
762 
764  void ResetScroll() {
765  vscroll ={};
766  }
767 
768 
769 
773  void SetHScroll(std::function<bool(Layer &, Geometry::Point, float)> fn) {
774  hscroll = fn;
775  }
776 
780  void SetHScroll(std::function<bool(Geometry::Point, float)> fn) {
781  hscroll = [fn](Layer &, Geometry::Point point, float amount) { return fn(point, amount); };
782  }
783 
787  template<class C_>
788  void SetHScroll(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float)) {
789  C_ *my = &c;
790  hscroll = [fn, my](Layer &layer, Geometry::Point point, float amount) { return (my->*fn)(layer, point, amount); };
791  }
792 
796  template<class C_>
797  void SetHScroll(C_ &c, bool(C_::*fn)(Geometry::Point, float)) {
798  C_ *my = &c;
799  hscroll = [fn, my](Layer &, Geometry::Point point, float amount) { return (my->*fn)(point, amount); };
800  }
801 
805  template<class C_>
806  void SetHScroll(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float)) {
807  hscroll = [fn, my](Layer &layer, Geometry::Point point, float amount) { return (my->*fn)(layer, point, amount); };
808  }
809 
813  template<class C_>
814  void SetHScroll(C_ *my, bool(C_::*fn)(Geometry::Point, float)) {
815  hscroll = [fn, my](Layer &, Geometry::Point point, float amount) { return (my->*fn)(point, amount); };
816  }
817 
821  void SetHScroll(std::function<bool(Layer &, float)> fn) {
822  hscroll = [fn](Layer &layer, Geometry::Point, float amount) { return fn(layer, amount); };
823  }
824 
828  void SetHScroll(std::function<bool(float)> fn) {
829  hscroll = [fn](Layer &, Geometry::Point, float amount) { return fn(amount); };
830  }
831 
835  template<class C_>
836  void SetHScroll(C_ &c, bool(C_::*fn)(Layer &, float)) {
837  C_ *my = &c;
838  hscroll = [fn, my](Layer &layer, Geometry::Point, float amount) { return (my->*fn)(layer, amount); };
839  }
840 
844  template<class C_>
845  void SetHScroll(C_ &c, bool(C_::*fn)(float)) {
846  C_ *my = &c;
847  hscroll = [fn, my](Layer &, Geometry::Point, float amount) { return (my->*fn)(amount); };
848  }
849 
853  template<class C_>
854  void SetHScroll(C_ *my, bool(C_::*fn)(Layer &, float)) {
855  hscroll = [fn, my](Layer &layer, Geometry::Point, float amount) { return (my->*fn)(layer, amount); };
856  }
857 
861  template<class C_>
862  void SetHScroll(C_ *my, bool(C_::*fn)(float)) {
863  hscroll = [fn, my](Layer &, Geometry::Point, float amount) { return (my->*fn)(amount); };
864  }
865 
867  void ResetHScroll() {
868  hscroll ={};
869  }
870 
871 
872 
875  void SetZoom(std::function<bool(Layer &, Geometry::Point, float)> fn) {
876  zoom = fn;
877  }
878 
881  void SetZoom(std::function<bool(Geometry::Point, float)> fn) {
882  zoom = [fn](Layer &, Geometry::Point point, float amount) { return fn(point, amount); };
883  }
884 
887  template<class C_>
888  void SetZoom(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float)) {
889  C_ *my = &c;
890  zoom = [fn, my](Layer &layer, Geometry::Point point, float amount) { return (my->*fn)(layer, point, amount); };
891  }
892 
895  template<class C_>
896  void SetZoom(C_ &c, bool(C_::*fn)(Geometry::Point, float)) {
897  C_ *my = &c;
898  zoom = [fn, my](Layer &, Geometry::Point point, float amount) { return (my->*fn)(point, amount); };
899  }
900 
903  template<class C_>
904  void SetZoom(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float)) {
905  zoom = [fn, my](Layer &layer, Geometry::Point point, float amount) { return (my->*fn)(layer, point, amount); };
906  }
907 
910  template<class C_>
911  void SetZoom(C_ *my, bool(C_::*fn)(Geometry::Point, float)) {
912  zoom = [fn, my](Layer &, Geometry::Point point, float amount) { return (my->*fn)(point, amount); };
913  }
914 
917  void SetZoom(std::function<bool(Layer &, float)> fn) {
918  zoom = [fn](Layer &layer, Geometry::Point, float amount) { return fn(layer, amount); };
919  }
920 
923  void SetZoom(std::function<bool(float)> fn) {
924  zoom = [fn](Layer &, Geometry::Point, float amount) { return fn(amount); };
925  }
926 
929  template<class C_>
930  void SetZoom(C_ &c, bool(C_::*fn)(Layer &, float)) {
931  C_ *my = &c;
932  zoom = [fn, my](Layer &layer, Geometry::Point, float amount) { return (my->*fn)(layer, amount); };
933  }
934 
937  template<class C_>
938  void SetZoom(C_ &c, bool(C_::*fn)(float)) {
939  C_ *my = &c;
940  zoom = [fn, my](Layer &, Geometry::Point, float amount) { return (my->*fn)(amount); };
941  }
942 
945  template<class C_>
946  void SetZoom(C_ *my, bool(C_::*fn)(Layer &, float)) {
947  zoom = [fn, my](Layer &layer, Geometry::Point, float amount) { return (my->*fn)(layer, amount); };
948  }
949 
952  template<class C_>
953  void SetZoom(C_ *my, bool(C_::*fn)(float)) {
954  zoom = [fn, my](Layer &, Geometry::Point, float amount) { return (my->*fn)(amount); };
955  }
956 
958  void ResetZoom() {
959  zoom ={};
960  }
961 
962 
963 
966  void SetRotate(std::function<bool(Layer &, Geometry::Point, float)> fn) {
967  rotate = fn;
968  }
969 
972  void SetRotate(std::function<bool(Geometry::Point, float)> fn) {
973  rotate = [fn](Layer &, Geometry::Point point, float amount) { return fn(point, amount); };
974  }
975 
978  template<class C_>
979  void SetRotate(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float)) {
980  C_ *my = &c;
981  rotate = [fn, my](Layer &layer, Geometry::Point point, float amount) { return (my->*fn)(layer, point, amount); };
982  }
983 
986  template<class C_>
987  void SetRotate(C_ &c, bool(C_::*fn)(Geometry::Point, float)) {
988  C_ *my = &c;
989  rotate = [fn, my](Layer &, Geometry::Point point, float amount) { return (my->*fn)(point, amount); };
990  }
991 
994  template<class C_>
995  void SetRotate(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float)) {
996  rotate = [fn, my](Layer &layer, Geometry::Point point, float amount) { return (my->*fn)(layer, point, amount); };
997  }
998 
1001  template<class C_>
1002  void SetRotate(C_ *my, bool(C_::*fn)(Geometry::Point, float)) {
1003  rotate = [fn, my](Layer &, Geometry::Point point, float amount) { return (my->*fn)(point, amount); };
1004  }
1005 
1008  void SetRotate(std::function<bool(Layer &, float)> fn) {
1009  rotate = [fn](Layer &layer, Geometry::Point, float amount) { return fn(layer, amount); };
1010  }
1011 
1014  void SetRotate(std::function<bool(float)> fn) {
1015  rotate = [fn](Layer &, Geometry::Point, float amount) { return fn(amount); };
1016  }
1017 
1020  template<class C_>
1021  void SetRotate(C_ &c, bool(C_::*fn)(Layer &, float)) {
1022  C_ *my = &c;
1023  rotate = [fn, my](Layer &layer, Geometry::Point, float amount) { return (my->*fn)(layer, amount); };
1024  }
1025 
1028  template<class C_>
1029  void SetRotate(C_ &c, bool(C_::*fn)(float)) {
1030  C_ *my = &c;
1031  rotate = [fn, my](Layer &, Geometry::Point, float amount) { return (my->*fn)(amount); };
1032  }
1033 
1036  template<class C_>
1037  void SetRotate(C_ *my, bool(C_::*fn)(Layer &, float)) {
1038  rotate = [fn, my](Layer &layer, Geometry::Point, float amount) { return (my->*fn)(layer, amount); };
1039  }
1040 
1043  template<class C_>
1044  void SetRotate(C_ *my, bool(C_::*fn)(float)) {
1045  rotate = [fn, my](Layer &, Geometry::Point, float amount) { return (my->*fn)(amount); };
1046  }
1047 
1049  void ResetRotate() {
1050  rotate ={};
1051  }
1052 
1053 
1054 
1057  void SetOver(std::function<void(Layer &)> fn) {
1058  over = fn;
1059  }
1060 
1063  void SetOver(std::function<void()> fn) {
1064  over = [fn](Layer &) { fn(); };
1065  }
1066 
1069  template<class C_>
1070  void SetOver(C_ &c, void(C_::*fn)(Layer &)) {
1071  C_ *my = &c;
1072  over = [fn, my](Layer &layer) { (my->*fn)(layer); };
1073  }
1074 
1077  template<class C_>
1078  void SetOver(C_ &c, std::function<void(C_ &)> fn) {
1079  C_ *my = &c;
1080  over = [fn, my](Layer &) { (my->*fn)(); };
1081  }
1082 
1085  template<class C_>
1086  void SetOver(C_ *my, void(C_::*fn)(Layer &)) {
1087  over = [fn, my](Layer &layer) { (my->*fn)(layer); };
1088  }
1089 
1092  template<class C_>
1093  void SetOver(C_ *my, std::function<void(C_ &)> fn) {
1094  over = [fn, my](Layer &) { (my->*fn)(); };
1095  }
1096 
1098  void ResetOver() {
1099  over = {};
1100  }
1101 
1102 
1103 
1105  void SetOut(std::function<void(Layer &)> fn) {
1106  out = fn;
1107  }
1108 
1110  void SetOut(std::function<void()> fn) {
1111  out = [fn](Layer &) { fn(); };
1112  }
1113 
1115  template<class C_>
1116  void SetOut(C_ &c, void(C_::*fn)(Layer &)) {
1117  C_ *my = &c;
1118  out = [fn, my](Layer &layer) { (my->*fn)(layer); };
1119  }
1120 
1122  template<class C_>
1123  void SetOut(C_ &c, std::function<void(C_ &)> fn) {
1124  C_ *my = &c;
1125  out = [fn, my](Layer &) { (my->*fn)(); };
1126  }
1127 
1129  template<class C_>
1130  void SetOut(C_ *my, void(C_::*fn)(Layer &)) {
1131  out = [fn, my](Layer &layer) { (my->*fn)(layer); };
1132  }
1133 
1135  template<class C_>
1136  void SetOut(C_ *my, std::function<void(C_ &)> fn) {
1137  out = [fn, my](Layer &) { (my->*fn)(); };
1138  }
1139 
1141  void ResetOut() {
1142  out = {};
1143  }
1144 
1148  if(click)
1149  click(*this, location, button);
1150  }
1151 
1152 
1154  protected:
1155  std::function<bool(Layer &, Geometry::Point)> hitcheck;
1158  std::function<void(Layer &, Geometry::Point, Input::Mouse::Button)> up;
1159  std::function<void(Layer &, Geometry::Point)> move;
1160  std::function<void(Layer &)> over;
1161  std::function<void(Layer &)> out;
1162  std::function<bool(Layer &, Geometry::Point, float amount)> vscroll;
1163  std::function<bool(Layer &, Geometry::Point, float amount)> hscroll;
1164  std::function<bool(Layer &, Geometry::Point, float amount)> zoom;
1165  std::function<bool(Layer &, Geometry::Point, float amount)> rotate;
1166 
1168 
1169 
1171  virtual bool propagate_mouseevent(Input::Mouse::EventType event, Geometry::Point location, Input::Mouse::Button button, float amount, MouseHandler &handlers) override;
1172  };
1173 
1174 } }
Gorgon::Input::Layer::SetClick
void SetClick(C_ &c, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:234
Gorgon::Input::Layer::SetMove
void SetMove(std::function< void(Layer &, Geometry::Point)> fn)
Sets mouse move handler.
Definition: Layer.h:620
Gorgon::Input::Layer::SetClick
void SetClick(C_ &c, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:200
Gorgon::Input::Layer::ResetZoom
void ResetZoom()
Removes zoom handler.
Definition: Layer.h:958
Gorgon::Input::Layer::ResetUp
void ResetUp()
Removes mouse up handler.
Definition: Layer.h:612
Gorgon::Input::Layer::out
std::function< void(Layer &)> out
Definition: Layer.h:1161
Gorgon::Input::Layer::ResetScroll
void ResetScroll()
Removes scroll handler.
Definition: Layer.h:764
Gorgon::Input::Layer::SetRotate
void SetRotate(std::function< bool(Layer &, Geometry::Point, float)> fn)
Sets rotate handler.
Definition: Layer.h:966
Gorgon::Input::Layer::SetClick
void SetClick(C_ &c, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:242
Gorgon::Input::Layer::SetScroll
void SetScroll(C_ &c, bool(C_::*fn)(Layer &, float))
Sets scroll handler.
Definition: Layer.h:733
Gorgon::Input::Layer::SetHScroll
void SetHScroll(std::function< bool(Layer &, float)> fn)
Sets horizontal scroll handler.
Definition: Layer.h:821
Gorgon::Input::Layer::ResetMove
void ResetMove()
Removes mouse move handler.
Definition: Layer.h:661
Gorgon::Input::Layer::SetMove
void SetMove(std::function< void(Geometry::Point)> fn)
Sets mouse move handler.
Definition: Layer.h:626
Gorgon::Input::Layer::SetClick
void SetClick(C_ *my, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:250
Gorgon::Input::Layer::SetDown
void SetDown(C_ *my, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
Sets mouse down handler.
Definition: Layer.h:299
Gorgon::Input::Layer::SetDown
void SetDown(std::function< void(Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:360
Gorgon::Input::Layer::SetDown
void SetDown(C_ *my, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:425
Gorgon::Input::Layer::SetDown
void SetDown(C_ &c, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
Sets mouse down handler.
Definition: Layer.h:283
Gorgon::Input::Layer::SetClick
void SetClick(C_ *my, void(C_::*fn)(Input::Mouse::Button))
Sets click handler.
Definition: Layer.h:173
Gorgon::Input::Layer::SetMove
void SetMove(C_ *my, void(C_::*fn)(Geometry::Point))
Sets mouse move handler.
Definition: Layer.h:656
Gorgon::Input::Layer::SetHScroll
void SetHScroll(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float))
Sets horizontal scroll handler.
Definition: Layer.h:788
Gorgon::Input::Layer::SetDown
void SetDown(C_ *my, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:432
Gorgon::Input::Layer::propagate_mouseevent
virtual bool propagate_mouseevent(Input::Mouse::EventType event, Geometry::Point location, Input::Mouse::Button button, float amount, MouseHandler &handlers) override
Propagates a mouse event. Some events will be called directly.
Definition: Layer.cpp:18
Gorgon::Input::Layer::SetUp
void SetUp(std::function< void()> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:577
Gorgon::Input::Layer::SetHScroll
void SetHScroll(C_ *my, bool(C_::*fn)(Geometry::Point, float))
Sets horizontal scroll handler.
Definition: Layer.h:814
Gorgon::Input::Layer::SetScroll
void SetScroll(C_ &c, bool(C_::*fn)(Geometry::Point, float))
Sets scroll handler.
Definition: Layer.h:694
Gorgon::Input::Layer::ResetClick
void ResetClick()
Removes click handler.
Definition: Layer.h:262
Gorgon::Input::Layer::ResetDown
void ResetDown()
Removes mouse down handler.
Definition: Layer.h:437
Gorgon::Input::Layer::zoom
std::function< bool(Layer &, Geometry::Point, float amount)> zoom
Definition: Layer.h:1164
Gorgon::Input::Layer::click
std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> click
Definition: Layer.h:1156
Gorgon::Input::Layer::SetScroll
void SetScroll(std::function< bool(float)> fn)
Sets scroll handler.
Definition: Layer.h:725
Gorgon::Input::Layer::SetClick
void SetClick(std::function< void(Layer &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:221
Gorgon::Input::Layer::SetDown
void SetDown(C_ *my, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:383
Gorgon::Input::Layer::SetScroll
void SetScroll(C_ *my, bool(C_::*fn)(float))
Sets scroll handler.
Definition: Layer.h:759
Gorgon::Input::Layer::SetZoom
void SetZoom(std::function< bool(float)> fn)
Sets zoom handler.
Definition: Layer.h:923
Gorgon::Input::Layer::SetDown
void SetDown(std::function< void(Layer &, Input::Mouse::Button)> fn)
Sets mouse down handler.
Definition: Layer.h:312
Gorgon::Input::Layer::SetClick
void SetClick(C_ *my, void(C_::*fn)(Layer &, Input::Mouse::Button))
Sets click handler.
Definition: Layer.h:166
Gorgon::Input::Layer::SetUp
void SetUp(C_ &c, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
Sets mouse up handler.
Definition: Layer.h:466
Gorgon::Input::Layer::SetClick
void SetClick(C_ &c, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
Sets click handler.
Definition: Layer.h:108
Gorgon::Input::Layer::SetClick
void SetClick(C_ *my, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
Sets click handler.
Definition: Layer.h:124
Gorgon::Geometry::basic_Transform3D
Definition: Transform3D.h:12
Gorgon::Input::Layer::SetScroll
void SetScroll(C_ *my, bool(C_::*fn)(Layer &, float))
Sets scroll handler.
Definition: Layer.h:751
Gorgon::Input::Layer::SetDown
void SetDown(C_ &c, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
Sets mouse down handler.
Definition: Layer.h:291
Gorgon::Input::Layer::SetMove
void SetMove(C_ &c, void(C_::*fn)(Layer &, Geometry::Point))
Sets mouse move handler.
Definition: Layer.h:633
Gorgon::Input::Layer::ResetHitCheck
void ResetHitCheck()
Removes hit check handler, default action for hit check is to return true.
Definition: Layer.h:87
Gorgon::Input::Layer::SetZoom
void SetZoom(C_ &c, bool(C_::*fn)(Layer &, float))
Sets zoom handler.
Definition: Layer.h:930
Gorgon::Input::Layer::SetZoom
void SetZoom(std::function< bool(Layer &, float)> fn)
Sets zoom handler.
Definition: Layer.h:917
Gorgon::Input::Layer::SetOver
void SetOver(C_ &c, void(C_::*fn)(Layer &))
Sets mouse over handler.
Definition: Layer.h:1070
Gorgon::Input::Layer::SetScroll
void SetScroll(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float))
Sets scroll handler.
Definition: Layer.h:685
Gorgon::Input::Layer::SetHScroll
void SetHScroll(std::function< bool(Geometry::Point, float)> fn)
Sets horizontal scroll handler.
Definition: Layer.h:780
Gorgon::Input::Layer::SetUp
void SetUp(C_ &c, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:550
Gorgon::Input::Layer::SetOver
void SetOver(std::function< void(Layer &)> fn)
Sets mouse over handler.
Definition: Layer.h:1057
Gorgon::Input::Layer::SetZoom
void SetZoom(C_ *my, bool(C_::*fn)(float))
Sets zoom handler.
Definition: Layer.h:953
Gorgon::Input::Layer::SetScroll
void SetScroll(std::function< bool(Layer &, float)> fn)
Sets scroll handler.
Definition: Layer.h:718
Gorgon::Input::Layer::SetDown
void SetDown(C_ &c, void(C_::*fn)(Layer &, Input::Mouse::Button))
Sets mouse down handler.
Definition: Layer.h:325
Gorgon::Input::Layer::SetRotate
void SetRotate(C_ *my, bool(C_::*fn)(float))
Sets rotate handler.
Definition: Layer.h:1044
Gorgon::Input::Layer::SetDown
void SetDown(C_ &c, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:409
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::Input::Layer::SetRotate
void SetRotate(C_ &c, bool(C_::*fn)(Geometry::Point, float))
Sets rotate handler.
Definition: Layer.h:987
Gorgon::Input::Layer::SetUp
void SetUp(std::function< void(Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:535
Gorgon::Input::Layer::SetHScroll
void SetHScroll(C_ *my, bool(C_::*fn)(Layer &, float))
Sets horizontal scroll handler.
Definition: Layer.h:854
Gorgon::Input::Layer::SetHitCheck
void SetHitCheck(std::function< bool(Geometry::Point)> fn)
Sets hit check function.
Definition: Layer.h:44
Gorgon::Input::Layer::over
std::function< void(Layer &)> over
Definition: Layer.h:1160
Gorgon::Input::Layer::SetClick
void SetClick(std::function< void(Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:185
Gorgon::Input::Layer::SetDown
void SetDown(C_ *my, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:390
Gorgon::Input::Layer::SetScroll
void SetScroll(std::function< bool(Geometry::Point, float)> fn)
Sets scroll handler.
Definition: Layer.h:677
Gorgon::Input::Layer::SetScroll
void SetScroll(std::function< bool(Layer &, Geometry::Point, float)> fn)
Sets scroll handler.
Definition: Layer.h:670
Gorgon::Input::Layer::SetDown
void SetDown(C_ *my, void(C_::*fn)(Layer &, Input::Mouse::Button))
Sets mouse down handler.
Definition: Layer.h:341
Gorgon::Input::Layer::SetDown
void SetDown(std::function< void(Layer &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:396
Gorgon::Input::Layer::SetUp
void SetUp(C_ &c, void(C_::*fn)(Layer &, Input::Mouse::Button))
Sets mouse up handler.
Definition: Layer.h:500
Gorgon::Input::Layer::SetScroll
void SetScroll(C_ *my, bool(C_::*fn)(Geometry::Point, float))
Sets scroll handler.
Definition: Layer.h:711
Gorgon::Input::Layer::SetClick
void SetClick(std::function< void()> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:227
Gorgon::Input::Layer::SetScroll
void SetScroll(C_ &c, bool(C_::*fn)(float))
Sets scroll handler.
Definition: Layer.h:742
Gorgon::Input::Layer::SetHScroll
void SetHScroll(C_ *my, bool(C_::*fn)(float))
Sets horizontal scroll handler.
Definition: Layer.h:862
Gorgon::Input::Layer::SetHScroll
void SetHScroll(std::function< bool(Layer &, Geometry::Point, float)> fn)
Sets horizontal scroll handler.
Definition: Layer.h:773
Gorgon::Geometry::Point
basic_Point< int > Point
Definition: Point.h:598
Gorgon::Input::Layer::SetZoom
void SetZoom(std::function< bool(Layer &, Geometry::Point, float)> fn)
Sets zoom handler.
Definition: Layer.h:875
Gorgon::Input::Layer::SetClick
void SetClick(std::function< void(Input::Mouse::Button)> fn)
Sets click handler.
Definition: Layer.h:143
Gorgon::Input::Layer::SetZoom
void SetZoom(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float))
Sets zoom handler.
Definition: Layer.h:904
Gorgon::Input::Layer::SetOut
void SetOut(C_ *my, std::function< void(C_ &)> fn)
Sets mouse out handler.
Definition: Layer.h:1136
Gorgon::MouseHandler
Definition: Layer.h:22
Gorgon::Input::Layer::SetUp
void SetUp(C_ &c, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:542
Gorgon::Input::Layer::SetUp
void SetUp(C_ *my, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:565
Gorgon::Input::Layer::SetUp
void SetUp(std::function< void(Geometry::Point, Input::Mouse::Button)> fn)
Sets mouse up handler.
Definition: Layer.h:451
Gorgon::Input::Layer::SetDown
void SetDown(std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> fn)
Sets mouse down handler.
Definition: Layer.h:270
Gorgon::Input::Layer::SetClick
void SetClick(C_ *my, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:257
Gorgon::Input::Layer::SetRotate
void SetRotate(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float))
Sets rotate handler.
Definition: Layer.h:979
Gorgon::Input::Layer::move
std::function< void(Layer &, Geometry::Point)> move
Definition: Layer.h:1159
Gorgon::Input::Layer::SetDown
void SetDown(std::function< void()> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:402
Gorgon::Input::Layer::ResetHScroll
void ResetHScroll()
Removes horizontal scroll handler.
Definition: Layer.h:867
Gorgon::Input::Layer::SetDown
void SetDown(C_ &c, void(C_::*fn)(Input::Mouse::Button))
Sets mouse down handler.
Definition: Layer.h:333
Gorgon::Input::Layer::SetDown
void SetDown(std::function< void(Input::Mouse::Button)> fn)
Sets mouse down handler.
Definition: Layer.h:318
Gorgon::Input::Layer::SetDown
void SetDown(C_ *my, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
Sets mouse down handler.
Definition: Layer.h:306
Gorgon::Input::Layer::SetRotate
void SetRotate(std::function< bool(Geometry::Point, float)> fn)
Sets rotate handler.
Definition: Layer.h:972
Gorgon::Input::Layer::SetMove
void SetMove(C_ *my, void(C_::*fn)(Layer &, Geometry::Point))
Sets mouse move handler.
Definition: Layer.h:649
Gorgon::Input::Layer::mytransform
Geometry::Transform3D mytransform
Definition: Layer.h:1167
Gorgon::Input::Layer::SetZoom
void SetZoom(C_ &c, bool(C_::*fn)(float))
Sets zoom handler.
Definition: Layer.h:938
Gorgon::Input::Layer::down
std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> down
Definition: Layer.h:1157
Gorgon::Input::Layer::SetDown
void SetDown(std::function< void(Geometry::Point, Input::Mouse::Button)> fn)
Sets mouse down handler.
Definition: Layer.h:276
Gorgon::Layer
This class is the base class for all layer types.
Definition: Layer.h:79
Gorgon::Geometry::basic_Point
This class represents a 2D point.
Definition: Point.h:32
Gorgon::Input::Layer::SetUp
void SetUp(C_ *my, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:607
Gorgon::Input::Layer::vscroll
std::function< bool(Layer &, Geometry::Point, float amount)> vscroll
Definition: Layer.h:1162
Gorgon::Input::Layer::SetOut
void SetOut(std::function< void()> fn)
Sets mouse out handler.
Definition: Layer.h:1110
Gorgon::Input::Layer::SetZoom
void SetZoom(C_ &c, bool(C_::*fn)(Geometry::Point, float))
Sets zoom handler.
Definition: Layer.h:896
Gorgon::Input::Layer::SetUp
void SetUp(C_ &c, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:584
Gorgon::Input::Layer::ResetRotate
void ResetRotate()
Removes rotate handler.
Definition: Layer.h:1049
Gorgon::Input::Layer::SetClick
void SetClick(std::function< void(Layer &, Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:179
Gorgon::Input::Layer::SetUp
void SetUp(C_ *my, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
Sets mouse up handler.
Definition: Layer.h:481
Gorgon::Input::Mouse::EventType
EventType
The type of a mouse event.
Definition: Mouse.h:14
Gorgon::Input::Layer::SetZoom
void SetZoom(std::function< bool(Geometry::Point, float)> fn)
Sets zoom handler.
Definition: Layer.h:881
Gorgon::Input::Layer::SetOver
void SetOver(std::function< void()> fn)
Sets mouse over handler.
Definition: Layer.h:1063
Gorgon::Input::Layer::SetUp
void SetUp(C_ *my, void(C_::*fn)(Layer &, Input::Mouse::Button))
Sets mouse up handler.
Definition: Layer.h:516
Gorgon::Input::Layer::SetClick
void SetClick(C_ &c, void(C_::*fn)(Layer &, Input::Mouse::Button))
Sets click handler.
Definition: Layer.h:150
Gorgon::Input::Layer::ResetOut
void ResetOut()
Removes mouse out handler.
Definition: Layer.h:1141
Gorgon::Input::Layer::SetHitCheck
void SetHitCheck(std::function< bool(Layer &, Geometry::Point)> fn)
Sets hit check function.
Definition: Layer.h:36
Gorgon::Input::Layer::FireClick
void FireClick(Geometry::Point location, Input::Mouse::Button button)
Fires the click event manually, allowing both mouse up and click events to happen at the same time.
Definition: Layer.h:1147
Gorgon::Input::Layer::SetUp
void SetUp(std::function< void(Layer &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:571
Gorgon::Input::Layer::SetUp
void SetUp(C_ &c, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:592
Gorgon::Input::Layer::SetUp
void SetUp(C_ &c, void(C_::*fn)(Input::Mouse::Button))
Sets mouse up handler.
Definition: Layer.h:508
Gorgon::Input::Layer::SetHitCheck
void SetHitCheck(C_ *my, bool(C_::*fn)(Geometry::Point))
Sets hit check function.
Definition: Layer.h:82
Gorgon::Input::Layer::hscroll
std::function< bool(Layer &, Geometry::Point, float amount)> hscroll
Definition: Layer.h:1163
Gorgon::Input::Layer::rotate
std::function< bool(Layer &, Geometry::Point, float amount)> rotate
Definition: Layer.h:1165
Gorgon::Input::Layer::SetClick
void SetClick(C_ &c, void(C_::*fn)(Input::Mouse::Button))
Sets click handler.
Definition: Layer.h:158
Gorgon::Input::Layer::SetHScroll
void SetHScroll(C_ &c, bool(C_::*fn)(float))
Sets horizontal scroll handler.
Definition: Layer.h:845
Gorgon::Input::Layer::SetUp
void SetUp(std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> fn)
Sets mouse up handler.
Definition: Layer.h:445
Gorgon::Input::Layer::SetScroll
void SetScroll(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float))
Sets scroll handler.
Definition: Layer.h:703
Gorgon::Input::Layer::SetHScroll
void SetHScroll(C_ &c, bool(C_::*fn)(Layer &, float))
Sets horizontal scroll handler.
Definition: Layer.h:836
Gorgon::Input::Layer::SetRotate
void SetRotate(std::function< bool(float)> fn)
Sets rotate handler.
Definition: Layer.h:1014
Gorgon::Input::Layer::SetOver
void SetOver(C_ &c, std::function< void(C_ &)> fn)
Sets mouse over handler.
Definition: Layer.h:1078
Gorgon::Input::Layer::SetDown
void SetDown(C_ &c, std::function< void(C_ &)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:417
Gorgon::Input::Layer::SetOut
void SetOut(C_ *my, void(C_::*fn)(Layer &))
Sets mouse out handler.
Definition: Layer.h:1130
Gorgon::Input::Layer::SetUp
void SetUp(std::function< void(Layer &, Input::Mouse::Button)> fn)
Sets mouse up handler.
Definition: Layer.h:487
Gorgon::Input::Layer::SetRotate
void SetRotate(C_ *my, bool(C_::*fn)(Geometry::Point, float))
Sets rotate handler.
Definition: Layer.h:1002
Gorgon::Input::Layer::SetUp
void SetUp(C_ *my, void(C_::*fn)(Input::Mouse::Button))
Sets mouse up handler.
Definition: Layer.h:523
Gorgon::Input::Layer::SetOver
void SetOver(C_ *my, std::function< void(C_ &)> fn)
Sets mouse over handler.
Definition: Layer.h:1093
Gorgon::Input::Mouse::Button
Button
Lists the mouse button constants.
Definition: Mouse.h:31
Gorgon::Input::Layer::SetHitCheck
void SetHitCheck(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point))
Sets hit check function.
Definition: Layer.h:73
Gorgon::Layer::Layer
Layer()
Constructor that sets the layer to cover entire parent, no matter how big it is.
Definition: Layer.h:90
Gorgon::Input::Layer::SetClick
void SetClick(C_ &c, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
Sets click handler.
Definition: Layer.h:116
Gorgon::Input::Layer::SetDown
void SetDown(C_ *my, void(C_::*fn)(Input::Mouse::Button))
Sets mouse down handler.
Definition: Layer.h:348
Gorgon::Input::Layer::SetClick
void SetClick(C_ *my, void(C_::*fn)(Geometry::Point, Input::Mouse::Button))
Sets click handler.
Definition: Layer.h:131
Gorgon::Input::Layer::SetOut
void SetOut(std::function< void(Layer &)> fn)
Sets mouse out handler.
Definition: Layer.h:1105
Gorgon::Input::Layer::SetHitCheck
void SetHitCheck(C_ &c, bool(C_::*fn)(Geometry::Point))
Sets hit check function.
Definition: Layer.h:63
Gorgon::Input::Layer::SetUp
void SetUp(std::function< void(Input::Mouse::Button)> fn)
Sets mouse up handler.
Definition: Layer.h:493
Gorgon::Input::Layer::SetUp
void SetUp(std::function< void(Layer &, Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:529
Gorgon::Input::Layer::SetZoom
void SetZoom(C_ *my, bool(C_::*fn)(Layer &, float))
Sets zoom handler.
Definition: Layer.h:946
Gorgon::Input::Layer::SetUp
void SetUp(C_ *my, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
Sets mouse up handler.
Definition: Layer.h:474
Gorgon::Input::Layer::SetUp
void SetUp(C_ &c, void(C_::*fn)(Layer &, Geometry::Point, Input::Mouse::Button))
Sets mouse up handler.
Definition: Layer.h:458
Gorgon::Input::Layer::SetHScroll
void SetHScroll(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float))
Sets horizontal scroll handler.
Definition: Layer.h:806
Gorgon::Input::Layer::SetClick
void SetClick(C_ &c, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:192
Gorgon::Input::Layer::SetDown
void SetDown(std::function< void(Layer &, Geometry::Point)> fn, Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:354
Gorgon::Input::Layer::SetClick
void SetClick(C_ *my, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:208
Gorgon::Input::Layer::SetDown
void SetDown(C_ &c, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:367
Gorgon::Input::Layer::hitcheck
std::function< bool(Layer &, Geometry::Point)> hitcheck
Definition: Layer.h:1155
Gorgon::Input::Layer
Input layer allows mouse events to be handled.
Definition: Layer.h:25
Gorgon::Input::Layer::SetHScroll
void SetHScroll(C_ &c, bool(C_::*fn)(Geometry::Point, float))
Sets horizontal scroll handler.
Definition: Layer.h:797
Gorgon::Input::Layer::SetRotate
void SetRotate(C_ &c, bool(C_::*fn)(float))
Sets rotate handler.
Definition: Layer.h:1029
Gorgon::Input::Layer::SetClick
void SetClick(std::function< void(Geometry::Point, Input::Mouse::Button)> fn)
Sets click handler.
Definition: Layer.h:101
Gorgon::Input::Layer::SetDown
void SetDown(C_ &c, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse down handler.
Definition: Layer.h:375
Gorgon::Input::Layer::SetClick
void SetClick(C_ *my, void(C_::*fn)(Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets click handler.
Definition: Layer.h:215
Gorgon::Input::Layer::SetUp
void SetUp(C_ *my, void(C_::*fn)(Layer &, Geometry::Point), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:558
Gorgon::Input::Layer::SetRotate
void SetRotate(C_ &c, bool(C_::*fn)(Layer &, float))
Sets rotate handler.
Definition: Layer.h:1021
Gorgon::Input::Layer::SetRotate
void SetRotate(std::function< bool(Layer &, float)> fn)
Sets rotate handler.
Definition: Layer.h:1008
Gorgon::Input::Keyboard::Keycodes::Left
constexpr Key Left
Definition: Keyboard.h:62
Gorgon::Input::Layer::up
std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> up
Definition: Layer.h:1158
Gorgon::Input::Layer::SetHScroll
void SetHScroll(std::function< bool(float)> fn)
Sets horizontal scroll handler.
Definition: Layer.h:828
Gorgon::Input::Layer::ResetOver
void ResetOver()
Removes mouse over handler.
Definition: Layer.h:1098
Gorgon::Input::Layer::SetZoom
void SetZoom(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point, float))
Sets zoom handler.
Definition: Layer.h:888
Gorgon::Input::Layer::SetOver
void SetOver(C_ *my, void(C_::*fn)(Layer &))
Sets mouse over handler.
Definition: Layer.h:1086
Gorgon::Input::Layer::SetRotate
void SetRotate(C_ *my, bool(C_::*fn)(Layer &, float))
Sets rotate handler.
Definition: Layer.h:1037
Gorgon::Input::Layer::SetRotate
void SetRotate(C_ *my, bool(C_::*fn)(Layer &, Geometry::Point, float))
Sets rotate handler.
Definition: Layer.h:995
Gorgon::Input::Layer::SetClick
void SetClick(std::function< void(Layer &, Geometry::Point, Input::Mouse::Button)> fn)
Sets click handler.
Definition: Layer.h:95
Gorgon::Input::Layer::SetClick
void SetClick(std::function< void(Layer &, Input::Mouse::Button)> fn)
Sets click handler.
Definition: Layer.h:137
Gorgon::Input::Layer::SetZoom
void SetZoom(C_ *my, bool(C_::*fn)(Geometry::Point, float))
Sets zoom handler.
Definition: Layer.h:911
Gorgon::Input::Layer::SetOut
void SetOut(C_ &c, void(C_::*fn)(Layer &))
Sets mouse out handler.
Definition: Layer.h:1116
Gorgon::Input::Layer::SetMove
void SetMove(C_ &c, void(C_::*fn)(Geometry::Point))
Sets mouse move handler.
Definition: Layer.h:641
Gorgon::Input::Layer::SetHitCheck
void SetHitCheck(C_ &c, bool(C_::*fn)(Layer &, Geometry::Point))
Sets hit check function.
Definition: Layer.h:53
Gorgon::Input::Layer::SetOut
void SetOut(C_ &c, std::function< void(C_ &)> fn)
Sets mouse out handler.
Definition: Layer.h:1123
Gorgon::Input::Layer::SetUp
void SetUp(C_ *my, void(C_::*fn)(Layer &), Input::Mouse::Button btn=Input::Mouse::Button::Left)
Sets mouse up handler.
Definition: Layer.h:600