本文整理汇总了C++中luaplus::LuaObject::AssignNewTable方法的典型用法代码示例。如果您正苦于以下问题:C++ LuaObject::AssignNewTable方法的具体用法?C++ LuaObject::AssignNewTable怎么用?C++ LuaObject::AssignNewTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类luaplus::LuaObject
的用法示例。
在下文中一共展示了LuaObject::AssignNewTable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void LuaManager::ConvertVec3ToTable(const XMFLOAT3& vec, LuaPlus::LuaObject& outLuaTable) const
{
outLuaTable.AssignNewTable(GetLuaState());
outLuaTable.SetNumber("x", vec.x);
outLuaTable.SetNumber("y", vec.y);
outLuaTable.SetNumber("z", vec.z);
}
示例2: VGetLuaData
// /////////////////////////////////////////////////////////////////
//
// /////////////////////////////////////////////////////////////////
LuaPlus::LuaObject SliderControl::VGetLuaData()
{
LuaPlus::LuaObject table;
table.AssignNewTable(g_appPtr->GetLuaStateManager()->GetGlobalState().Get());
table.SetNumber("SliderPosition", m_sliderPos);
table.SetInteger("EventTypeId", m_eventTypeId);
table.SetInteger("ScreenElementId", VGetId());
return (table);
}
示例3: GetVectorFromRotation
LuaPlus::LuaObject InternalScriptExports::GetVectorFromRotation(float angleRadians)
{
Vec3 result = ::GetVectorFromYRotation(angleRadians);
LuaPlus::LuaObject luaResult;
luaResult.AssignNewTable(LuaStateManager::Get()->GetLuaState());
luaResult.SetNumber("x", result.x);
luaResult.SetNumber("y", result.y);
luaResult.SetNumber("z", result.z);
return luaResult;
}
示例4: Wrap
static LuaPlus::LuaObject Wrap(Vec3 vector){
LuaPlus::LuaObject vecObj;
vecObj.AssignNewTable(LuaManager::Get()->GetState());
vecObj.SetNumber("x", vector.x);
vecObj.SetNumber("y", vector.y);
vecObj.SetNumber("z", vector.z);
return vecObj;
}
示例5: VGetLuaData
// /////////////////////////////////////////////////////////////////
//
// /////////////////////////////////////////////////////////////////
LuaPlus::LuaObject ListButtonControl::VGetLuaData()
{
LuaPlus::LuaObject table;
table.AssignNewTable(g_appPtr->GetLuaStateManager()->GetGlobalState().Get());
if(m_list.empty()) {
table.SetString("Text", "");
} else {
table.SetString("Text", (*m_curr).c_str());
}
table.SetInteger("ScreenElementId", VGetId());
table.SetInteger("EventTypeId", GetEventType());
return (table);
}
示例6: GetVectorFromRotation
// create a lua vec3 table from an angle in radians
LuaPlus::LuaObject LuaInternalScriptExports::GetVectorFromRotation(float angleRadians)
{
// use the GetVectorFromYRotation from math.h
Vec3 result = ::GetVectorFromYRotation(angleRadians);
// create a lua vec3 table from the result
LuaPlus::LuaObject luaResult;
luaResult.AssignNewTable(LuaStateManager::Get()->GetLuaState());
luaResult.SetNumber("x", result.x);
luaResult.SetNumber("y", result.y);
luaResult.SetNumber("z", result.z);
return luaResult;
}
示例7:
void ant::LuaStateManager::convertVec2ToTable(const sf::Vector2f& vec, LuaPlus::LuaObject& vec2Table)
{
vec2Table.AssignNewTable(getLuaState());
vec2Table.SetNumber("x", vec.x);
vec2Table.SetNumber("y", vec.y);
}