4#include <simplesquirrel/simplesquirrel.hpp>
11 if (index < 0 || index >=
int(touches.size()))
12 throw Exception(
"Touch index out of range");
13 return touches[size_t(index)].x;
18 if (index < 0 || index >=
int(touches.size()))
19 throw Exception(
"Touch index out of range");
20 return touches[size_t(index)].y;
23void Touch::expose(ssq::Table& table) {
24 auto cls = table.addClass(
name, Touch::create,
false);
28void Touch::expose(ssq::Class&
cls) {
31 cls.addFunc(
"getTouchX", [](Touch *t,
int index) ->
float {
32 return t ? float(t->getTouchX(index)) : 0.f;
34 cls.addFunc(
"getTouchY", [](Touch *t,
int index) ->
float {
35 return t ? float(t->getTouchY(index)) : 0.f;
#define Module_IMPL(ModuleName, newExpr)
virtual std::string getName() const =0
double getTouchY(int index) const
double getTouchX(int index) const
virtual const std::vector< TouchInfo > & getTouches() const =0
Gets all currently active touches.
int getTouchCount() const