本文整理汇总了C++中luaplus::LuaObject::SetNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ LuaObject::SetNumber方法的具体用法?C++ LuaObject::SetNumber怎么用?C++ LuaObject::SetNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类luaplus::LuaObject
的用法示例。
在下文中一共展示了LuaObject::SetNumber方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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);
}
示例6: RegisterEventTypeWithScript
//---------------------------------------------------------------------------------------------------------------------
// This function is called to register an event type with the script to link them. The simplest way to do this is
// with the REGISTER_SCRIPT_EVENT() macro, which calls this function.
//---------------------------------------------------------------------------------------------------------------------
void ScriptEvent::RegisterEventTypeWithScript(const char* key, EventType type)
{
// get or create the EventType table
LuaPlus::LuaObject eventTypeTable = LuaStateManager::Get()->GetGlobalVars().GetByName("EventType");
if (eventTypeTable.IsNil())
eventTypeTable = LuaStateManager::Get()->GetGlobalVars().CreateTable("EventType");
// error checking
GCC_ASSERT(eventTypeTable.IsTable());
GCC_ASSERT(eventTypeTable[key].IsNil());
// add the entry
eventTypeTable.SetNumber(key, (double)type);
}
示例7: RegisterEventTransformer
void LuaScriptEventManager::RegisterEventTransformer(LuaScriptEventTransformation transformer, EventType type, LPCSTR name)
{
LuaScript* luas = (LuaScript*)chimera::g_pApp->GetScript();
LuaPlus::LuaObject table = luas->GetState()->GetGlobals().GetByName("EventType");
if(table.IsNil())
{
table = luas->GetState()->GetGlobals().CreateTable("EventType");
}
table.SetNumber(name, type);
m_transformMap[type] = transformer;
}
示例8:
void ant::LuaStateManager::convertVec2ToTable(const sf::Vector2f& vec, LuaPlus::LuaObject& vec2Table)
{
vec2Table.AssignNewTable(getLuaState());
vec2Table.SetNumber("x", vec.x);
vec2Table.SetNumber("y", vec.y);
}