Creating custom UI. Asset error.

Hello,

I'm attempting to create a custom UI but I'd like it to resemble the main UI. The list of assets I'm using can be found here.

Code:

var background = new CuiElement
{
	Parent = mainName,
	Name = "background",
	
	Components =
	{
		new CuiRawImageComponent{ Color = "0 0 0 1", 
			Material = "assets/content/ui/uibackgroundblur-notice.mat", 
			Sprite = "assets/standard assets/effects/imageeffects/textures/noise.png"
		},
		new CuiRectTransformComponent{ AnchorMin = "0 0", AnchorMax = "1 1" }
	}
};

The error in the console: [FileSystem] Not Found: "assets/standard assets/effects/imageeffects/textures/noise.png" 

Have you tried using "Png" instead of "Sprite"?

WNS76Zqa6hbJU1n.png 0x89A

Have you tried using "Png" instead of "Sprite"?

Yes. It just stretches a rust icon across the entire screen. As shown here. I assume it's a symbol for "image not found".

Maybe it's not a valid image that you can use with UI then? I'll have to test it myself first.

I solved my issue.

  • The ImageType wasn't set to Tile, that's why I was getting a single streched image.
  • I was overwriting the default values of the Material and Sprite.
  • I learned that PNG is used for caching purposes and works great with a plugin called ImageLibrary.
  • One more thing I learned; the server doesn't store values of the clients resolution.

    Thank you @0x89A , for helping me pursue the issue.