Sorry if this has been answered elsewhere, but the SEO on the new Canvas and Image objects isn’t great for finding answers.)
I want to dynamically create an Image on a Canvas with code. I can do similar for example with a Sprite:
var obj = new GameObject();
var renderer = obj.AddComponent<SpriteRenderer>();
renderer.sprite = myAssetsFolderReference;
But I can’t figure out what to do with Image objects because they’re not a class in MonoDevelop and they follow a separate inheritance tree to GameObject. And also the reference seems to be incomplete.
(I understand of course if we’re not expected to tinker with Images via code yet, just trying to see if I can construct an editor without dragging and dropping for a solid week.)