TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ DrawValue()

static bool Terraria.IngameOptions.DrawValue ( SpriteBatch sb,
string txt,
int i,
float scale,
Color over = default(Color) )
inlinestatic

Definition at line 1950 of file IngameOptions.cs.

1951 {
1952 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
1953 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
1954 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
1955 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
1956 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
1957 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
1958 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
1959 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
1960 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
1961 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
1962 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
1963 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
1964 //IL_0075: Unknown result type (might be due to invalid IL or missing references)
1965 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
1966 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
1967 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
1968 //IL_0089: Unknown result type (might be due to invalid IL or missing references)
1969 //IL_008e: Unknown result type (might be due to invalid IL or missing references)
1970 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
1971 //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
1972 //IL_0084: Unknown result type (might be due to invalid IL or missing references)
1973 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
1974 Color color = Color.Gray;
1975 Vector2 vector = FontAssets.MouseText.Value.MeasureString(txt) * scale;
1976 Rectangle val = new Rectangle((int)valuePosition.X, (int)valuePosition.Y - (int)vector.Y / 2, (int)vector.X, (int)vector.Y);
1977 bool flag = ((Rectangle)(ref val)).Contains(new Point(Main.mouseX, Main.mouseY));
1978 if (flag)
1979 {
1980 color = Color.White;
1981 }
1982 if (over != default(Color))
1983 {
1984 color = over;
1985 }
1986 Utils.DrawBorderString(sb, txt, valuePosition, color, scale, 0f, 0.5f);
1987 valuePosition.X += vector.X;
1988 if (!_canConsumeHover)
1989 {
1990 return false;
1991 }
1992 if (flag)
1993 {
1994 _canConsumeHover = false;
1995 return true;
1996 }
1997 return false;
1998 }
static Asset< DynamicSpriteFont > MouseText
Definition FontAssets.cs:10
static bool _canConsumeHover
static Vector2 valuePosition

References Terraria.Utils.DrawBorderString(), Terraria.GameContent.FontAssets.MouseText, Terraria.Main.mouseX, and Terraria.Main.mouseY.

+ Here is the call graph for this function: