Jump to content

SetViewMode()


Alienhead
 Share

Go to solution Solved by Josh,

Recommended Posts

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()

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Solution

I am going to mark this as solved. I think you just need to cast the entity to a sprite. Let me know if there is still a problem when you get back.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...