My Project
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
DImageDisplayHandler Class Reference

DynamicUI - Image Display Handler for UGUI Image & RawImage. How to use: (1) add as a base class (Inherits), (2) Drop this script in a GameObject and reference it. Call the SetImage/SetRawImage method. More...

Inheritance diagram for DImageDisplayHandler:

Public Types

enum  BoundingTarget { Size , RectTransform , Screen }
 
enum  BoundingType {
  SetNativeSize = 0 , WidthAndHeight , Width , Height ,
  FillAll
}
 

Public Member Functions

void SetImage (UnityEngine.UI.Image displayImage, Sprite sprite)
 
void SetImage (UnityEngine.UI.Image displayImage, Texture2D texture2D)
 
void SetRawImage (UnityEngine.UI.RawImage displayImage, Sprite sprite)
 
void SetRawImage (UnityEngine.UI.RawImage displayImage, Texture2D texture2D)
 
void SetRawImage (UnityEngine.UI.RawImage displayImage, Texture texture)
 
void SetImage (UnityEngine.UI.Image displayImage, float width, float height)
 
void SetRawImage (UnityEngine.UI.RawImage displayImage, float width, float height)
 
void Clear (UnityEngine.UI.Image displayImage)
 
void Clear (UnityEngine.UI.RawImage displayImage)
 

Public Attributes

BoundingTarget m_BoundingTarget = BoundingTarget.Size
 
RectTransform m_RectTransform
 
Vector2 m_Size = new Vector2(512, 512)
 
BoundingType m_BoundingType = BoundingType.SetNativeSize
 
float m_ScaleFactor = 1f
 
bool m_AutoClearTexture = true
 Auto clear the texture of the last set Image/RawImage before setting a new one.
 
bool m_Rotated_90 = false
 Is the target display(Image/RawImage) RectTranform (eulerAngles.z) rotated by 90/-90.
 

Detailed Description

DynamicUI - Image Display Handler for UGUI Image & RawImage. How to use: (1) add as a base class (Inherits), (2) Drop this script in a GameObject and reference it. Call the SetImage/SetRawImage method.

Member Enumeration Documentation

◆ BoundingTarget

Enumerator
Size 

Constraints the target image with the Vector2 size(m_Size).

RectTransform 

Constraints the target image with the sizeDelta of the RectTranform(m_RectTransform).

Screen 

Constraints the target image with the device screen size.

◆ BoundingType

Enumerator
WidthAndHeight 

Sets the entire image RectTransform to be constrained within a specified area size (width and height).

Width 

Sets the image RectTransform's width equal to the width of specified area size, the image height is not constrained.

Height 

Sets the image RectTransform's height equal to the height of specified area size, the image width is not constrained.

FillAll 

Sets the image RectTransform to cover the entire specified area size, either the image width or height will exceed that size if the aspect ratio is different.


The documentation for this class was generated from the following file: