It seems like all that stuff is in there:
void Sprite::BindClass(sol::state* L)
{
L->set("SPRITEVIEW_DEFAULT", SPRITEVIEW_DEFAULT);
L->set("SPRITEVIEW_BILLBOARD", SPRITEVIEW_BILLBOARD);
L->set("SPRITEVIEW_XROTATION", SPRITEVIEW_XROTATION);
L->set("SPRITEVIEW_YROTATION", SPRITEVIEW_YROTATION);
L->set("SPRITEVIEW_ZROTATION", SPRITEVIEW_ZROTATION);
L->new_usertype<Sprite>
(
"SpriteClass",
sol::base_classes, sol::bases<Entity>(),
sol::meta_function::index, &Entity::dynamic_get,
sol::meta_function::new_index, &Entity::dynamic_set,
"SetClipRegion", &Sprite::SetClipRegion,
"size", sol::property([](Sprite& s) { return s.size; }),
"mesh", sol::property([](Sprite& s) { return s.mesh; }),
"SetViewMode", &SetViewMode,
"SetText", [](Sprite& s, std::string t) { s.SetText(t); }
How is sprite_ledgemarker being created? Are you sure the variable is a sprite? I noticed the sprite casting is missing, so I am adding it now.
You may need to do this, once it is updated:
local sprite = Sprite(entity)
sprite:SetViewMode()