Tanoda
pb_LayoutElementText.cs
Go to the documentation of this file.
1
using
UnityEngine
;
2
using
UnityEngine
.
UI
;
3
using
System.Collections;
4
5
namespace
GILES.Interface
6
{
10
public
class
pb_LayoutElementText
: LayoutElement
11
{
12
public
bool
expandWidth
=
true
,
expandHeight
=
false
;
13
public
Text
text
;
14
public
float
paddingWidth
= 4f,
paddingHeight
= 4f;
15
16
public
override
float
minWidth
17
{
18
get
{
return
GetTextWidth(); }
19
}
20
21
public
override
float
preferredWidth
22
{
23
get
{
return
GetTextWidth(); }
24
}
25
26
public
override
float
minHeight
27
{
28
get
{
return
GetTextHeight(); }
29
}
30
31
public
override
float
preferredHeight
32
{
33
get
{
return
GetTextHeight(); }
34
}
35
36
float
GetTextWidth()
37
{
38
if
(
text
!=
null
&&
expandWidth
)
39
return
text
.preferredWidth + (
paddingWidth
* 2f);
40
else
41
return
-1f;
42
}
43
44
float
GetTextHeight()
45
{
46
if
(
text
!=
null
&&
expandHeight
)
47
return
text
.preferredHeight + (
paddingHeight
* 2f);
48
else
49
return
-1f;
50
}
51
}
52
}
GILES.Interface.pb_LayoutElementText
Definition:
pb_LayoutElementText.cs:11
GILES.Interface.pb_LayoutElementText.preferredWidth
override float preferredWidth
Definition:
pb_LayoutElementText.cs:22
GILES.Interface.pb_LayoutElementText.preferredHeight
override float preferredHeight
Definition:
pb_LayoutElementText.cs:32
GILES.Interface.pb_LayoutElementText.paddingWidth
float paddingWidth
Definition:
pb_LayoutElementText.cs:14
GILES.Interface.pb_LayoutElementText.expandWidth
bool expandWidth
Definition:
pb_LayoutElementText.cs:12
GILES.Interface.pb_LayoutElementText.minWidth
override float minWidth
Definition:
pb_LayoutElementText.cs:17
GILES.Interface.pb_LayoutElementText.paddingHeight
float paddingHeight
Definition:
pb_LayoutElementText.cs:14
GILES.Interface.pb_LayoutElementText.minHeight
override float minHeight
Definition:
pb_LayoutElementText.cs:27
GILES.Interface.pb_LayoutElementText.expandHeight
bool expandHeight
Definition:
pb_LayoutElementText.cs:12
GILES.Interface.pb_LayoutElementText.text
Text text
Definition:
pb_LayoutElementText.cs:13
GILES.Interface
Definition:
pb_AutoStageItemEditor.cs:9
UnityEngine.UI
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
GILES
Code
Scripts
GUI
pb_LayoutElementText.cs
Generated by
1.9.3