add examples on LineHeight and TabWidth to Text doc
This commit is contained in:
parent
863e1e2f0c
commit
3ffbbb9cda
|
@ -206,11 +206,17 @@ func (txt *Text) Color(c color.Color) {
|
||||||
|
|
||||||
// LineHeight sets the vertical distance between two lines of text. This does not affect any
|
// LineHeight sets the vertical distance between two lines of text. This does not affect any
|
||||||
// previously written text.
|
// previously written text.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
// txt.LineHeight(1.5 * txt.Atlas().LineHeight())
|
||||||
func (txt *Text) LineHeight(height float64) {
|
func (txt *Text) LineHeight(height float64) {
|
||||||
txt.lineHeight = height
|
txt.lineHeight = height
|
||||||
}
|
}
|
||||||
|
|
||||||
// TabWidth sets the horizontal tab width. Tab characters will align to the multiples of this width.
|
// TabWidth sets the horizontal tab width. Tab characters will align to the multiples of this width.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
// txt.TabWidth(8 * txt.Atlas().Glyph(' ').Advance)
|
||||||
func (txt *Text) TabWidth(width float64) {
|
func (txt *Text) TabWidth(width float64) {
|
||||||
txt.tabWidth = width
|
txt.tabWidth = width
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue