Guest User

Rttr binding example

a guest
Aug 22nd, 2019
340
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     rttr::registration::class_<math::Vector3>("math::Vector3")(
  2.         metadata(Key::Inspector, Inspector::Override<VectorInspector>("x", "y", "z")))
  3.         .constructor()(rttr::policy::ctor::as_object)
  4.         .constructor<float, float, float>()(rttr::policy::ctor::as_object)
  5.         .property("x", &math::Vector3::x)
  6.         .property("y", &math::Vector3::y)
  7.         .property("z", &math::Vector3::z);
  8.  
  9.     rttr::registration::class_<::Visual::SpriteComponent>("Visual::SpriteComponent")
  10.         .constructor() ( rttr::policy::ctor::as_raw_ptr )
  11.         .property("color", &::Visual::SpriteComponent::GetColor, &::Visual::SpriteComponent::SetColor)
  12.         .property("spriteOrTexture", &::Visual::SpriteComponent::GetSpriteOrTexture, &::Visual::SpriteComponent::SetSpriteOrTexture)
  13.         .property("alpha", &::Visual::SpriteComponent::GetAlpha, &::Visual::SpriteComponent::SetAlpha)
  14.             (
  15.                 rttr::metadata(Meta::Key::NumberMode, Meta::FloatDrag(float(1.0), 0, 1))
  16.             )
  17.         ;
RAW Paste Data