summaryrefslogtreecommitdiff
path: root/Runtime/Lua/LuaHelper.cpp
blob: 289f0f6ecfc878c4737a991788fb8426bf058481 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "LuaHelper.h"

using namespace LuaBind;

template <>
Rectf State::GetValue < Rectf >(int idx, const Rectf value)
{
    Rectf rect;
    rect.x = GetField<float>(idx, 1, 0);
    rect.y = GetField<float>(idx, 2, 0);
    rect.width = GetField<float>(idx, 3, 0);
    rect.height = GetField<float>(idx, 4, 0);
    return rect;
}

template <>
Vector2f State::GetValue < Vector2f >(int idx, const Vector2f value)
{
    Vector2f v2;
    v2.x = GetField<float>(idx, 1, 0);
    v2.y = GetField<float>(idx, 2, 0);
    return v2;
}