mirror of
https://github.com/love2d/love.git
synced 2026-08-21 21:15:09 +02:00
Add ParticleSystem:getPosition (issue #368)
This commit is contained in:
@@ -321,6 +321,11 @@ namespace opengl
|
|||||||
return position.getY();
|
return position.getY();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const love::Vector& ParticleSystem::getPosition() const
|
||||||
|
{
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
float ParticleSystem::getDirection() const
|
float ParticleSystem::getDirection() const
|
||||||
{
|
{
|
||||||
return direction;
|
return direction;
|
||||||
|
|||||||
@@ -363,6 +363,11 @@ namespace opengl
|
|||||||
**/
|
**/
|
||||||
float getY() const;
|
float getY() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the position of the emitter.
|
||||||
|
**/
|
||||||
|
const love::Vector& getPosition() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the direction of the emitter (in degrees).
|
* Returns the direction of the emitter (in degrees).
|
||||||
**/
|
**/
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "wrap_ParticleSystem.h"
|
#include "wrap_ParticleSystem.h"
|
||||||
|
|
||||||
|
#include <common/Vector.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
namespace love
|
namespace love
|
||||||
@@ -261,6 +263,15 @@ namespace opengl
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int w_ParticleSystem_getPosition(lua_State * L)
|
||||||
|
{
|
||||||
|
ParticleSystem * t = luax_checkparticlesystem(L, 1);
|
||||||
|
const love::Vector& p = t->getPosition();
|
||||||
|
lua_pushnumber(L, p.x);
|
||||||
|
lua_pushnumber(L, p.y);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
int w_ParticleSystem_getDirection(lua_State * L)
|
int w_ParticleSystem_getDirection(lua_State * L)
|
||||||
{
|
{
|
||||||
ParticleSystem * t = luax_checkparticlesystem(L, 1);
|
ParticleSystem * t = luax_checkparticlesystem(L, 1);
|
||||||
@@ -376,6 +387,7 @@ namespace opengl
|
|||||||
{ "setOffset", w_ParticleSystem_setOffset },
|
{ "setOffset", w_ParticleSystem_setOffset },
|
||||||
{ "getX", w_ParticleSystem_getX },
|
{ "getX", w_ParticleSystem_getX },
|
||||||
{ "getY", w_ParticleSystem_getY },
|
{ "getY", w_ParticleSystem_getY },
|
||||||
|
{ "getPosition", w_ParticleSystem_getPosition },
|
||||||
{ "getDirection", w_ParticleSystem_getDirection },
|
{ "getDirection", w_ParticleSystem_getDirection },
|
||||||
{ "getSpread", w_ParticleSystem_getSpread },
|
{ "getSpread", w_ParticleSystem_getSpread },
|
||||||
{ "getOffsetX", w_ParticleSystem_getOffsetX },
|
{ "getOffsetX", w_ParticleSystem_getOffsetX },
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ namespace opengl
|
|||||||
int w_ParticleSystem_setOffset(lua_State * L);
|
int w_ParticleSystem_setOffset(lua_State * L);
|
||||||
int w_ParticleSystem_getX(lua_State * L);
|
int w_ParticleSystem_getX(lua_State * L);
|
||||||
int w_ParticleSystem_getY(lua_State * L);
|
int w_ParticleSystem_getY(lua_State * L);
|
||||||
|
int w_ParticleSystem_getPosition(lua_State * L);
|
||||||
int w_ParticleSystem_getDirection(lua_State * L);
|
int w_ParticleSystem_getDirection(lua_State * L);
|
||||||
int w_ParticleSystem_getSpread(lua_State * L);
|
int w_ParticleSystem_getSpread(lua_State * L);
|
||||||
int w_ParticleSystem_getOffsetX(lua_State * L);
|
int w_ParticleSystem_getOffsetX(lua_State * L);
|
||||||
|
|||||||
Reference in New Issue
Block a user