I’m trying to figure out how to toggle the visibility a given slot on a Canvas through code.
My goal is to stack a number of overlapping Images on the Canvas and only have one visible at a time. Basically I’m trying to implement custom mouse cursor appearances inside a single blueprint.
Right now I am casting to a UCanvasPanelSlot, which is fine if I want to reposition the element, but I can’t seem to find relevant functions to disabled or hide it, even though I see there is a “Visible” dropdown available in the blueprint under Behavior that does the job.
mySlot0 = Cast<UCanvasPanelSlot>(ImageMouse->Slot); mySlot1 = Cast<UCanvasPanelSlot>(ImageGrab->Slot);
Any suggestions will be appreciated! Thanks
EDIT : Seems I have a work-around… I can call SetSize to 0. Wonky but I guess it works.