Hello, I am following the Slate Hello tutorial but am running into a little trouble.
In particular, I get the “undeclared identifier” error upon compiling in the line
TSharedPtr<SMyTextBoxWidget> myWidget;
belonging to my HUD class but I have included SMyTextBoxWidget.h
, syntax coloring works too, and intellisense doesn’t underline anything. The other error I receive says that SMyTextBoxWidget
is not a valid object to pass to the template, but I’m guessing it’s because the class isn’t recognized in the first place.
I earlier had managed to place a Slate button on the screen directly through another class, so I believe the project is set up to include any references (those stuff in the .cs file anyway) and it should work.
I created the class through the editor and set it to the first of the two options for being a child of a slate object, and I believe I fully reverted the code to the one generated:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Widgets/SCompoundWidget.h"
#include "MainHUD.h"
#include "SlateBasics.h"
/**
*
*/
class MYPROJECT_API SMyTextBoxWidget : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SMyTextBoxWidget)
{}
//SLATE_ARGUMENT(TWeakObjectPtr<class AMainHUD>, OwnerHUD)
SLATE_END_ARGS()
/** Constructs this widget with InArgs */
void Construct(const FArguments& InArgs);
};
Thanks in advance.
Edit: my slate-inheriting class doesn’t show up in the content browser either, not sure if it’s of any relevance.