How-to show an UIView from script

To trigger a specific UIView to show, the view has to have at least one show animation enabled (move, rotate, scale. fade) or have ‘Instant Animation’ enabled.

Instructions

The following example triggers the show animation of an UIView using a direct reference to it.

using Doozy.Engine.UI; namespace MyNamespace { public class TestScript { public UIView MyView; //reference to an UIView public void MyMethod() { MyView.Show(); //trigger the show animation } } }

 

The following example triggers the show animation of an UIView using its view category and view name.

There is no need for a direct refence to the target UIView, but it has to be present in the scene.

The UIView needs to have a view category and view name, for this to work as the system needs to be able to identify it.

If there are more than one UIViews that share the same view category name and view name in the scene, they will ALL have their show animation triggered by this approach.

using Doozy.Engine.UI; namespace MyNamespace { public class TestScript { public string ViewCategoryName; public string ViewName; public void MyMethod() { UIView.ShowView(ViewCategoryName, ViewName); //trigger the show animation } } }