blob: 9256619bca7a2c11290e1c40733c631b3fdaecdf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package net.tylermurphy.Minecraft.UI.Text;
import java.util.ArrayList;
import java.util.List;
public class Word {
private List<Character> characters = new ArrayList<Character>();
private double width = 0;
private double fontSize;
protected Word(double fontSize){
this.fontSize = fontSize;
}
protected void addCharacter(Character character){
characters.add(character);
width += character.getxAdvance() * fontSize;
}
protected List<Character> getCharacters(){
return characters;
}
protected double getWordWidth(){
return width;
}
}
|