# Why does the same widget look different when used by MoviePlayer vs just manually adding to viewport?

**URL:** <https://forums.unrealengine.com/t/why-does-the-same-widget-look-different-when-used-by-movieplayer-vs-just-manually-adding-to-viewport/489963>\
**Category:** UI\
**Tags:** unreal-engine, slate, loading-screen, question, dpi\
**Created:** [October 17, 2021, 10:44pm UTC](https://forums.unrealengine.com/t/why-does-the-same-widget-look-different-when-used-by-movieplayer-vs-just-manually-adding-to-viewport/489963 "2021-10-17T22:44:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Get\_Gooder](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Get\_Gooder](https://forums.unrealengine.com/u/Get_Gooder)\
**Post date:** [October 17, 2021, 10:44pm UTC](https://forums.unrealengine.com/t/why-does-the-same-widget-look-different-when-used-by-movieplayer-vs-just-manually-adding-to-viewport/489963/1 "2021-10-17T22:44:15Z")

</div>

I’ve been working on a loading screen implementation for a few days, and I can’t seem to figure out why when using the MoviePlayer to render a widget via the `FLoadingScreenAttributes.WidgetLoadingScreen`, all the content of that widget appears smaller than if you were just to manually add that same widget to the viewport. It’s almost as if the MoviePlayer does something different with the DPI scaling. I’m attempting to make it so that once the MoviePlayer finishes playing, I will manually add the same widget to the viewport so I can hide additional loading logic (since MoviePlayer blocks the game thread). I wanted to hide the swapping but because they don’t look the same, it just ends up looking wonky. I don’t have any scale or size boxes in my widget, just text and a throbber.

I’ve even tried creating an SVirtualWindow that is identical to what the MoviePlayer uses to manually display my widget and they still look different.

I’m at a loss here and any insight would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [October 18, 2021, 3:59pm UTC](https://forums.unrealengine.com/t/why-does-the-same-widget-look-different-when-used-by-movieplayer-vs-just-manually-adding-to-viewport/489963/2 "2021-10-18T15:59:28Z")

</div>

Hello! Code that is used by Movie Player create several different things

1. It uses **VirtualRenderWindow = SNew(SVirtualWindow).Size(GameWindow-\>GetClientSizeInScreen())** as window container
2. Inside it **LoadingScreenContents = SNew(SDefaultMovieBorder)**
3. First slot of **LoadingScreenContents** widget contains **MovieViewport**
4. Second slot of **LoadingScreenContents** widget contains **SDPIScaler**
5. **SDPIScaler** contains **SBorder** with paddin 0
6. And **SBorder** at last conatins **WidgetLoadingScreen** widget, that you push through the attributes

So there is some hierarchy diffs. Second thing - this virtual window is rendered by Slate Renderer on Main Window viewport and that also could cause some diffs…

---

<div class="post-metadata">

**Author:** ![Get\_Gooder](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Get\_Gooder](https://forums.unrealengine.com/u/Get_Gooder)\
**Post date:** [October 18, 2021, 4:52pm UTC](https://forums.unrealengine.com/t/why-does-the-same-widget-look-different-when-used-by-movieplayer-vs-just-manually-adding-to-viewport/489963/3 "2021-10-18T16:52:45Z")

</div>

Thanks for the response! So when I mentioned in my original post that I created an identical SVirtualWindow hierarchy, I did exactly what you mentioned in steps 1-6 and they still look different. So I guess it has got to have something to do with the fact that it is rendered via the slate renderer like you mentioned in your final point. I was trying to avoid attempting to mimic the rendering code but I guess that is the only thing left I haven’t tried…

---

<div class="post-metadata">

**Author:** ![Get\_Gooder](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Get\_Gooder](https://forums.unrealengine.com/u/Get_Gooder)\
**Post date:** [October 18, 2021, 9:47pm UTC](https://forums.unrealengine.com/t/why-does-the-same-widget-look-different-when-used-by-movieplayer-vs-just-manually-adding-to-viewport/489963/4 "2021-10-18T21:47:25Z")

</div>

So turns out it was an issue with the FDefaultMoviePlayer’s implementation of GetViewportDPIScale(). It was always returning a value of 1 which seems undesirable. Anyway, this is how we fixed it:

```
float FDefaultGameMoviePlayer::GetViewportDPIScale() const
{
	if (MainWindow.IsValid())
	{
		FVector2D ViewportSize = MainWindow.Pin()->GetClientSizeInScreen();
		return GetDefault<UUserInterfaceSettings>()->GetDPIScaleBasedOnSize(FIntPoint(ViewportSize.X, ViewportSize.Y));
	}

	return 1.f;
}
```
