Exemple #1
0
void LUNAFontLoader::PushToLua(const std::string& name, LuaTable& parentTable)
{
	LuaTable tblFont(LUNAEngine::SharedLua());
	tblFont.MakeReadOnly();
	parentTable.SetField(name, tblFont, true);

	for(auto entry : fonts) tblFont.SetField(entry.first, entry.second, true);
}
void LUNATextureAtlasLoader::PushToLua(const std::string& name, LuaTable& parentTable)
{
	// Make atlas table
	LuaTable atlasTable(LUNAEngine::SharedLua());
	atlasTable.MakeReadOnly();
	parentTable.SetField(name, atlasTable, true);

	// Add regions to asset table
	for(auto entry : atlas->GetRegions()) atlasTable.SetField(entry.first, entry.second, true);

	// Save texture in custom data of atlas table
	LUNAEngine::SharedAssets()->SetCustomDataToTable(atlasTable, texture);
}
void LUNAAudioWavLoader::PushToLua(const std::string& name, LuaTable& parentTable)
{
	parentTable.SetField(name, source, true);
}