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

◆ DrawRadialDpad()

static void Terraria.UI.ItemSlot.DrawRadialDpad ( SpriteBatch sb,
Vector2 position )
inlinestatic

Definition at line 3065 of file ItemSlot.cs.

3066 {
3067 if (!PlayerInput.UsingGamepad || !PlayerInput.CurrentProfile.UsingDpadHotbar())
3068 {
3069 return;
3070 }
3071 Player player = Main.player[Main.myPlayer];
3072 if (player.chest != -1)
3073 {
3074 return;
3075 }
3077 float num = (float)(int)Main.mouseTextColor / 255f;
3078 float num2 = 1f - (1f - num) * (1f - num);
3079 num2 *= 0.785f;
3080 Color color = Color.White * num2;
3081 sb.Draw(value, position, null, color, 0f, value.Size() / 2f, Main.inventoryScale, SpriteEffects.None, 0f);
3082 for (int i = 0; i < 4; i++)
3083 {
3084 int num3 = player.DpadRadial.Bindings[i];
3085 if (num3 != -1)
3086 {
3087 Draw(sb, player.inventory, 14, num3, position + new Vector2(value.Width / 3, 0f).RotatedBy(-(float)Math.PI / 2f + (float)Math.PI / 2f * (float)i) + new Vector2(-26f * Main.inventoryScale), Color.White);
3088 }
3089 }
3090 }
void Draw(Texture2D texture, Vector2 position, Color color)
const double PI
Definition Math.cs:16
static Asset< Texture2D >[] HotbarRadial
static PlayerInputProfile CurrentProfile

References Terraria.Player.SelectionRadial.Bindings, Terraria.Player.chest, Terraria.GameInput.PlayerInput.CurrentProfile, Terraria.Player.DpadRadial, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Microsoft.Xna.Framework.Draw, Terraria.GameContent.TextureAssets.HotbarRadial, Terraria.Player.inventory, Terraria.Main.inventoryScale, Terraria.Main.myPlayer, System.Math.PI, Terraria.Main.player, Terraria.GameInput.PlayerInput.UsingGamepad, System.value, and Microsoft.Xna.Framework.Color.White.

Referenced by Terraria.Main.DrawInventory().