Manual

UIDrawer

class in Doozy.Engine.UI / Inherits from UIComponentBase / Implements IDragHandler, IBeginDragHandlerCalculator, IEndDragHandler

Description

The UIDrawer is a core component in the DoozyUI system that works and behaves like a Navigation Drawer, that can be opened/closed from/to the Left/Right/Up/Down side of the screen.

Static Properties

  • public static bool AnyDrawerOpened – Returns TRUE if at least one UIDrawer is opened

  • public static string DefaultDrawerCategory – Default UIDrawer drawer category name

  • public static string DefaultDrawerName – Default UIDrawer drawer name

  • public static UIDrawer DraggedDrawer – Returns the UIDrawer that is currently being dragged

  • public static UIDrawer OpenedDrawer – Returns the currently opened UIDrawer. There can be only one UIDrawer opened at a time

  • public static Action<UIDrawer, UIDrawerBehaviorType> OnUIDrawerBehavior – Action invoked whenever a UIDrawerBehavior is triggered

Properties

  • public bool ArrowEnabled – Returns TRUE if this UIDrawer has a valid UIDrawerArrow Arrow and it is enabled

  • public Canvas Canvas – Reference to the Canvas component

  • public bool Closed – Returns TRUE if this UIDrawerContainer Container is NOT visible (is NOT in view)

  • public bool HasArrow – Returns TRUE if this UIDrawer has a valid UIDrawerArrow Arrow

  • public bool HasContainer – Returns TRUE if this UIDrawer has a valid UIDrawerContainer Container

  • public bool HasOverlay – Returns TRUE if this UIDrawer has a valid UIContainer Overlay

  • public float InverseVisibility – Returns the inverse of the current VisibilityProgress value (float between 1 and 0) (Closed – Opened)

  • public bool IsClosing – Returns TRUE if this UIDrawerContainer Container is going out of view

  • public bool IsDragged – Returns true if this UIDrawerContainer Container is currently begin dragged

  • public bool IsOpening – Returns TRUE if this UIDrawerContainer Container is becoming visible

  • public bool Opened – Returns TRUE if the UIDrawerContainer Container is visible (is in view)

  • public VisibilityState Visibility – The current visibility state (Visible, NotVisible, Hiding or Showing) of this UIDrawer UIDrawerContainer Container

  • public float VisibilityProgress – The visibility value of this UIDrawerContainer Container (float between 0 and 1) (Closed – Opened)

Public Variables

  • public UIDrawerArrow Arrow – Settings for the animated arrow used to show the open and close directions for this UIDrawer

  • public bool BlockBackButton – If TRUE, the ‘Back’ button event will be blocked by this UIDrawer is visible (default: TRUE)

  • public UIDrawerBehavior CloseBehavior – Behavior when this UIDrawer gets hidden (goes off screen)

  • public SimpleSwipe CloseDirection – UIDrawer position when closed (this also affects what gesture shows/hides the drawer)

  • public float CloseSpeed – UIDrawer hide animation speed

  • public UIDrawerContainer Container – UIDrawer container settings. This is the actual drawer that gets animated

  • public Vector3 CustomStartAnchoredPosition – Custom anchored position that this UIDrawer slides from/to when showing/hiding. You can use this in code to customize on the fly this position

  • public bool CustomDrawerName – Internal variable used by the custom inspector to allow you to type a custom name instead of selecting it from the database

  • public string DrawerName – UIDrawer drawer name

  • public bool DetectGestures – Enables/Disables the gesture detectors of this UIDrawer. If FALSE, this drawer will no longer react to gestures. Useful if you plan on showing/hiding the drawer via a button or a script.

  • public UIDrawerBehavior DragBehavior – Behavior when this UIDrawer is being dragged

  • public bool HideOnBackButton – If TRUE, the next ‘Back’ button event will hide (close) this UIDrawer (default: TRUE)

  • public ProgressEvent OnProgressChanged – Callback executed when the drawer is animating (opening or closing) and its progress has been updated. Passes the Progress (float between 0 – when the drawer is closed and 1 – when the drawer is opened)

  • public ProgressEvent OnInverseProgressChanged – Callback executed when the drawer is animating (opening or closing) and its progress has been updated. Passes the InverseProgress (float between 1 – when the drawer is closed and 0 – when the drawer is opened). InverseProgress = 1 – Progress

  • public UIDrawerBehavior OpenBehavior – Behavior when the UIDrawer gets shown (becomes visible on screen)

  • public float OpenSpeed – UIDrawer show animation speed

  • public UIContainer Overlay – Settings for the Overlay UIContainer used to dim the screen when the this UIDrawer is shown

  • public Progressor Progressor – Reference to a Progressor that allows animating anything (texts, images, animations…) in order to show the current open progress value of this drawer in a visual manner

  • public bool UseCustomStartAnchoredPosition – If TRUE, this UIDrawer will slide from and to a set custom position. Default is set to true.

Public Methods

  • public void Close(bool instantAction = false) – Closes the drawer

  • public void DisableGestureDetection() – Disables gesture detection for this UIDrawer

  • public void EnableGestureDetection() – Enables gesture detection for this UIDrawer

  • public void NotifySystemOfTriggeredBehavior(UIDrawerBehaviorType behaviorType) – Sends an UIDrawerMessage notifying the system that an UIDrawerBehavior has been triggered

  • public void Open – Opens the drawer

  • public void Toggle(bool instantAction = false) – Toggles the drawer’s opened/closed state. If it’s open it will close and vice versa

  • public void ToggleGestureDetection() – Toggles gesture detection for this UIDrawer

  • public void UpdateArrowContainer() – Updates the UIDrawerArrow Arrow by copying the UIDrawerContainer Container RectTransform properties to it

  • public void UpdateContainer() – Updates the UIDrawerContainer Container to the set settings. This method is mostly used by the editor button to help setup and design the container

  • public void UpdateContainerSize() – Updates the size of the UIDrawerContainer Container

  • public void UpdateContainerSize(float fixedSize) – Updates the size of the UIDrawerContainer Container to FixedSize, with the given percentageOfScreen and minimumSize

  • public void UpdateContainerSize(float percentageOfScreen, float minimumSize) – Updates the size of the UIDrawerContainer Container to PercentageOfScreen, with the given percentageOfScreen and minimumSize

  • public void UpdateDrawerCloseDirection(SimpleSwipe hideDirection) – Updates the drawer’s close direction

Static Methods

  • public static void Close(string drawerName, bool debug = false) – Closes the UIDrawer, with the given drawer name, that exists in the UIDrawer Database

  • public static bool Contains(string drawerName) – Returns TRUE if an UIDrawer, with the given drawer name, has been found in the UIDrawer Database

  • public static UIDrawer Get(string drawerName) – Returns a reference to the first UIDrawer, wih the given drawer name, found in the UIDrawer Database. Returns null if an UIDrawer is not found

  • public static void Open(string drawerName, bool debug = false) – Opens the UIDrawer, with the given drawer name, that exists in the UIDrawer Database

  • public static void Toggle(string drawerName, bool debug = false) – Toggles the open/close state of an UIDrawer, with the given drawer name, that exists in the UIDrawer Database. If the drawer is opened it will close and vice versa