Hey,
I’ve tried to use slate c++ with the following tutorial Tutorial: Custom GUI with Slate Styles | Unreal Engine 4 blog .
But somehow I get some errors using
ATBCharacter:
FORCEINLINE float ATBCharacter::GetHitPoints()
{
return hit_points_;
}
Slate widget construct():
#include "SSHealthBar.h"
#include "TBCharacter.h"
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SSHealthBar::Construct(const FArguments& InArgs)
{
TAttribute<float> value = TAttribute<float>::Create(TAttribute<float>::FGetter::CreateUObject(this, &ATBCharacter::GetHitPoints));
//ChildSlot
//[
// //SNew()
//];
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
none of the 2 overloads could convert all the argument types
1> with
1> [
1> ObjectType=float
1> ]
1> d:\programme\engines\ue4\epic games\4.7\engine\source\runtime\core\public\delegates\DelegateSignatureImpl_Variadics.inl(220): could be ‘TBaseDelegate TBaseDelegate::CreateUObject(UserClass ,float (__cdecl SSHealthBar:: )(void) const)’
1> with
1> [
1> ObjectType=float
1> , UserClass=SSHealthBar
1> ]
1> d:\programme\engines\ue4\epic games\4.7\engine\source\runtime\core\public\delegates\DelegateSignatureImpl_Variadics.inl(215): or ‘TBaseDelegate TBaseDelegate::CreateUObject(UserClass ,float (__cdecl SSHealthBar:: )(void))’
1> with
1> [
1> ObjectType=float
1> , UserClass=SSHealthBar
1> ]
1> while trying to match the argument list ‘(SSHealthBar const , float (__cdecl ATBCharacter:: )(void) const)’
header file
class TUTORIALBOX_API SSHealthBar : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SSHealthBar)
{}
SLATE_END_ARGS()
/** Constructs this widget with InArgs */
void Construct(const FArguments& InArgs);
};
can anyone help?