hi.
i’ve been working on a simple tic-tac-toe game in c++ without any blueprints to get a grasp on the programming language and the unreal environment. each square needs to be, well, square, and the only Slate element that can do that is SBox. the problem is when i put my desired width and height values into the constructor, it just doesn’t follow them. i spent the past few hours searching through the engine source code and google, but i can’t find anything. as far as i’m concerned, i’m doing it the way i’ve been told.
here’s the code:
SGameUI
void SGameUI::Construct(const FArguments& InArgs)
{
ChildSlot
[
SNew( SOverlay )
+ SOverlay::Slot()
[
SNew( SBox )
.WidthOverride( 444 )
.HeightOverride( 555 )
[
SNew(SBorder)
.BorderImage(FCoreStyle::Get().GetBrush("WhiteBrush"))
.BorderBackgroundColor(FLinearColor(1, 0, 0, 0.5))
]
]
];
}
Widget Creation
void AGameMaster::BeginPlay()
{
GameUIWidget = SNew( SGameUI );
GEngine->GameViewport->AddViewportWidgetContent( GameUIWidget.ToSharedRef() );
Super::BeginPlay();
}
here’s some debug information that shows the actual size isn’t the desired size
![img] (http://i.imgur.com/x9aTqiQ.png “Widget Reflector”)