summaryrefslogtreecommitdiff
path: root/src/cat/LuaButton.h
blob: ef5bb54f7b1e401f895d4a0a228166a881cf97d9 (plain)
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
#pragma once

extern "C" {
	#include "lua.h"
	#include "lauxlib.h"
	#include "lualib.h"
}

#include "LuaLuna.h"

namespace ui
{
	class Button;
}

class LuaButton
{
	ui::Button * button;
	int actionFunction;
	lua_State * l;
	void triggerAction();
	int action(lua_State * l);
	int text(lua_State * l);
	int position(lua_State * l);
	int size(lua_State * l);
public:
	static const char className[];
	static Luna<LuaButton>::RegType methods[];

	ui::Button * GetComponent() { return button; }
	LuaButton(lua_State * l);
	~LuaButton();
};