AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
XCharts.Location Class Reference

Location type. Quick to set the general location. 位置类型。通过Align快速设置大体位置,再通过left,right,top,bottom微调具体位置。 More...

Inheritance diagram for XCharts.Location:
Collaboration diagram for XCharts.Location:

Public Types

enum  Align {
  TopLeft, TopRight, TopCenter, BottomLeft,
  BottomRight, BottomCenter, Center, CenterLeft,
  CenterRight
}
 对齐方式 More...
 

Public Member Functions

Vector3 GetPosition (float chartWidth, float chartHeight)
 返回在坐标系中的具体位置 More...
 
void OnChanged ()
 属性变更时更新textAnchor,minAnchor,maxAnchor,pivot More...
 
- Public Member Functions inherited from XCharts.ChartComponent
virtual void SetVerticesDirty ()
 
virtual void ClearVerticesDirty ()
 
virtual void SetComponentDirty ()
 
virtual void ClearComponentDirty ()
 
virtual void ClearDirty ()
 
virtual void SetAllDirty ()
 

Properties

Align align [get, set]
 对齐方式。 More...
 
float left [get, set]
 Distance between component and the left side of the container. 离容器左侧的距离。 More...
 
float right [get, set]
 Distance between component and the left side of the container. 离容器右侧的距离。 More...
 
float top [get, set]
 Distance between component and the left side of the container. 离容器上侧的距离。 More...
 
float bottom [get, set]
 Distance between component and the left side of the container. 离容器下侧的距离。 More...
 
TextAnchor runtimeTextAlignment [get]
 the anchor of text. Location对应的Anchor锚点 More...
 
Vector2 runtimeAnchorMin [get]
 the minimum achor. Location对应的anchorMin。 More...
 
Vector2 runtimeAnchorMax [get]
 the maximun achor. Location对应的anchorMax. More...
 
Vector2 runtimePivot [get]
 the povot. Loation对应的中心点。 More...
 
static Location defaultLeft [get]
 
static Location defaultRight [get]
 
static Location defaultTop [get]
 
static Location defaultBottom [get]
 
- Properties inherited from XCharts.ChartComponent
virtual bool vertsDirty [get]
 图表重绘标记。 More...
 
virtual bool componentDirty [get]
 组件重新初始化标记。 More...
 
bool anyDirty [get]
 需要重绘图表或重新初始化组件。 More...
 
Painter painter [get, set]
 
Action refreshComponent [get, set]
 
GameObject gameObject [get, set]
 

Additional Inherited Members

- Protected Attributes inherited from XCharts.ChartComponent
bool m_VertsDirty
 
bool m_ComponentDirty
 
Painter m_Painter
 

Detailed Description

Location type. Quick to set the general location. 位置类型。通过Align快速设置大体位置,再通过left,right,top,bottom微调具体位置。

Definition at line 21 of file Location.cs.

Member Enumeration Documentation

◆ Align

对齐方式

Definition at line 26 of file Location.cs.

27  {
28  TopLeft,
29  TopRight,
30  TopCenter,
31  BottomLeft,
32  BottomRight,
33  BottomCenter,
34  Center,
35  CenterLeft,
36  CenterRight
37  }

Member Function Documentation

◆ GetPosition()

Vector3 XCharts.Location.GetPosition ( float  chartWidth,
float  chartHeight 
)
inline

返回在坐标系中的具体位置

Parameters
chartWidth
chartHeight
Returns

Definition at line 283 of file Location.cs.

284  {
285  switch (align)
286  {
287  case Align.BottomCenter:
288  return new Vector3(chartWidth / 2, bottom);
289  case Align.BottomLeft:
290  return new Vector3(left, bottom);
291  case Align.BottomRight:
292  return new Vector3(chartWidth - right, bottom);
293  case Align.Center:
294  return new Vector3(chartWidth / 2, chartHeight / 2);
295  case Align.CenterLeft:
296  return new Vector3(left, chartHeight / 2);
297  case Align.CenterRight:
298  return new Vector3(chartWidth - right, chartHeight / 2);
299  case Align.TopCenter:
300  return new Vector3(chartWidth / 2, chartHeight - top);
301  case Align.TopLeft:
302  return new Vector3(left, chartHeight - top);
303  case Align.TopRight:
304  return new Vector3(chartWidth - right, chartHeight - top);
305  default:
306  return Vector2.zero;
307  }
308  }

◆ OnChanged()

void XCharts.Location.OnChanged ( )
inline

属性变更时更新textAnchor,minAnchor,maxAnchor,pivot

Implements XCharts.IPropertyChanged.

Definition at line 313 of file Location.cs.

314  {
315  UpdateAlign();
316  }

Property Documentation

◆ align

Align XCharts.Location.align
getset

对齐方式。

Definition at line 57 of file Location.cs.

57  {
58  get { return m_Align; }
59  set { if (PropertyUtil.SetStruct(ref m_Align, value)) { SetComponentDirty(); UpdateAlign(); } }
60  }

◆ bottom

float XCharts.Location.bottom
getset

Distance between component and the left side of the container. 离容器下侧的距离。

Definition at line 93 of file Location.cs.

93  {
94  get { return m_Bottom; }
95  set { if (PropertyUtil.SetStruct(ref m_Bottom, value)) { SetComponentDirty(); UpdateAlign(); } }
96  }

◆ left

float XCharts.Location.left
getset

Distance between component and the left side of the container. 离容器左侧的距离。

Definition at line 66 of file Location.cs.

66  {
67  get { return m_Left; }
68  set { if (PropertyUtil.SetStruct(ref m_Left, value)) { SetComponentDirty(); UpdateAlign(); } }
69  }

◆ right

float XCharts.Location.right
getset

Distance between component and the left side of the container. 离容器右侧的距离。

Definition at line 75 of file Location.cs.

75  {
76  get { return m_Right; }
77  set { if (PropertyUtil.SetStruct(ref m_Right, value)) { SetComponentDirty(); UpdateAlign(); } }
78  }

◆ runtimeAnchorMax

Vector2 XCharts.Location.runtimeAnchorMax
get

the maximun achor. Location对应的anchorMax.

Definition at line 119 of file Location.cs.

119 { get { return m_AnchorMax; } }

◆ runtimeAnchorMin

Vector2 XCharts.Location.runtimeAnchorMin
get

the minimum achor. Location对应的anchorMin。

Definition at line 113 of file Location.cs.

113 { get { return m_AnchorMin; } }

◆ runtimePivot

Vector2 XCharts.Location.runtimePivot
get

the povot. Loation对应的中心点。

Definition at line 125 of file Location.cs.

125 { get { return m_Pivot; } }

◆ runtimeTextAlignment

TextAnchor XCharts.Location.runtimeTextAlignment
get

the anchor of text. Location对应的Anchor锚点

Definition at line 103 of file Location.cs.

103 { get { return m_TextAlignment; } }

◆ top

float XCharts.Location.top
getset

Distance between component and the left side of the container. 离容器上侧的距离。

Definition at line 84 of file Location.cs.

84  {
85  get { return m_Top; }
86  set { if (PropertyUtil.SetStruct(ref m_Top, value)) { SetComponentDirty(); UpdateAlign(); } }
87  }

The documentation for this class was generated from the following file:
XCharts.Location.Align
Align
对齐方式
Definition: Location.cs:26
XCharts.Location.right
float right
Distance between component and the left side of the container. 离容器右侧的距离。
Definition: Location.cs:75
XCharts.Location.top
float top
Distance between component and the left side of the container. 离容器上侧的距离。
Definition: Location.cs:84
XCharts.Location.left
float left
Distance between component and the left side of the container. 离容器左侧的距离。
Definition: Location.cs:66
XCharts.Location.bottom
float bottom
Distance between component and the left side of the container. 离容器下侧的距离。
Definition: Location.cs:93
XCharts.Location.align
Align align
对齐方式。
Definition: Location.cs:57