当前位置: 首页>>代码示例>>C#>>正文


C# RenderingContext.AddTextWithHeight方法代码示例

本文整理汇总了C#中RenderingContext.AddTextWithHeight方法的典型用法代码示例。如果您正苦于以下问题:C# RenderingContext.AddTextWithHeight方法的具体用法?C# RenderingContext.AddTextWithHeight怎么用?C# RenderingContext.AddTextWithHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RenderingContext的用法示例。


在下文中一共展示了RenderingContext.AddTextWithHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Render

 public override void Render(RenderingContext rc)
 {
     if (!Settings.GetBool("Tooltip") || !Settings.GetBool("Tooltip.ShowItemMods"))
         return;
     Element uiHover = this.poe.Internal.IngameState.UIHover;
     Entity poeEntity = uiHover.AsObject<InventoryItemIcon>().Item;
     if (poeEntity.address == 0 || !poeEntity.IsValid)
         return;
     Tooltip tooltip = uiHover.AsObject<InventoryItemIcon>().Tooltip;
     if (tooltip == null)
         return;
     Element childAtIndex1 = tooltip.GetChildAtIndex(0);
     if (childAtIndex1 == null)
         return;
     Element childAtIndex2 = childAtIndex1.GetChildAtIndex(1);
     if (childAtIndex2 == null)
         return;
     Rect clientRect = childAtIndex2.GetClientRect();
     Rect headerRect = childAtIndex1.GetChildAtIndex(0).GetClientRect();
     if (this.poeEntity == null || this.poeEntity.ID != poeEntity.ID) {
         this.mods = new List<MaxRolls_Current>();
         //List<Poe_ItemMod> impMods = poeEntity.GetComponent<Mods>().ImplicitMods;
         List<ItemMod> expMods = poeEntity.GetComponent<Mods>().ItemMods;
         int ilvl = poeEntity.GetComponent<Mods>().ItemLevel;
         foreach (ItemMod item in expMods)
         {
             this.mods.Add(new MaxRolls_Current(item.Name, item.Level, ilvl));
         }
         this.poeEntity = poeEntity;
     }
     int tooltipBotY=clientRect.Y + clientRect.H;
     int i = tooltipBotY;
     // Implicit mods
     //foreach (Poe_ItemMod item in impMods)
     //{
     //    rc.AddTextWithHeight(new Vec2(clientRect.X, i), item.Name, Color.Yellow, 9, DrawTextFormat.Left);
     //    rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 10, i), item.Level.ToString(), Color.White, 6, DrawTextFormat.Left);
     //    i += 20;
     //}
     foreach (MaxRolls_Current item in this.mods)
     {
         rc.AddTextWithHeight(new Vec2(clientRect.X, i), item.name, item.color, 8, DrawTextFormat.Left);
         i += 20;
         rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 100, i), item.max, Color.White, 8, DrawTextFormat.Left);
         rc.AddTextWithHeight(new Vec2(clientRect.X + 30, i), item.curr, Color.White, 8, DrawTextFormat.Left);
         i += 20;
         if (item.curr2 != null && item.max2 != null)
         {
             rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 100, i), item.max2, Color.White, 8, DrawTextFormat.Left);
             rc.AddTextWithHeight(new Vec2(clientRect.X + 30, i), item.curr2, Color.White, 8, DrawTextFormat.Left);
             i += 20;
         }
     }
     if (i > tooltipBotY)
     {
         Rect helpRect = new Rect(clientRect.X + 1, tooltipBotY, clientRect.W, i - tooltipBotY);
         rc.AddBox(helpRect, Color.FromArgb(220, Color.Black));
     }
 }
开发者ID:sbradno,项目名称:PoeHud,代码行数:59,代码来源:ItemRollsRenderer.cs

示例2: Render

        public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
        {
            Vec2 pos = mountPoints[UiMountPoint.LeftOfMinimap];

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("Player = {0:X8}\r\n", model.Player.Address);
            sb.AppendFormat("TheGame = {0:X8}\r\n", model.Internal.Address);
            sb.AppendFormat("IngameState = {0:X8}\r\n", model.Internal.IngameState.Address);
            sb.AppendFormat("IngameData = {0:X8}\r\n", model.Internal.IngameState.Data.Address);
            sb.AppendFormat("InventoryFrame = {0:X8}\r\n", model.Internal.IngameState.IngameUi.InventoryPanel.Address);

            var w1 = model.Internal.IngameState.IngameUi.InventoryPanel.MainWeaponSlot.GetItemAt();

            //var flasks = model.Internal.IngameState.IngameUi.InventoryPanel.FlasksFrame;
            //for (int i = 0; i < 5; i++)
            //{
            //	var f1 = flasks.GetItemAt(i);
            //	if (f1 != null)
            //		sb.AppendFormat("F{1} = {0}\r\n",String.Join("; ", f1.EnumComponents().Select(kv => String.Format("{0}: {1:X8}", kv.Key, kv.Value))), i + 1);
            //}

            var szText = rc.AddTextWithHeight(pos, sb.ToString(), Color.White, 11, DrawTextFormat.Right);
            Rect box = new Rect(pos.X - szText.X - 5, pos.Y - 5, szText.X + 10, szText.Y + 10);
            rc.AddBox(box, Color.FromArgb(160, 0, 0, 0));

            mountPoints[UiMountPoint.LeftOfMinimap]  = new Vec2(pos.X, pos.Y + szText.Y + 10 + 5);
        }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:27,代码来源:MainAddresses.cs

示例3: Render

 public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
 {
     int alpha = this.menuVisible ? 255 : 100;
     rc.AddBox(this.bounds, Color.FromArgb(alpha, Color.Gray));
     rc.AddTextWithHeight(new Vec2(Settings.PositionWidth + Settings.AnchorWidth / 2, Settings.PositionHeight + Settings.AnchorHeight / 2), "Menu", Color.Gray, 10, DrawTextFormat.Center | DrawTextFormat.VerticalCenter);
     foreach (BooleanButton current in this.buttons)
         current.Render(rc);
 }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:8,代码来源:Menu.cs

示例4: drawElt

		private static void drawElt(RenderingContext rc, Element root, Vec2 parent, ref int x, ref int yPos, int[] path, int depth = 0)
		{
			if (!root.IsVisibleLocal || depth > 3)
			{
				return;
			}
            //Rect rC = new Rect(parent.X + (int)(root.X * 0.75), parent.Y + (int)(root.Y * 0.75), (int)(root.Width * 0.75), (int)(root.Height * 0.75));
            Rect rC = new Rect(parent.X + (int)(root.X * 0.75), parent.Y + (int)(root.Y * 0.75), (int)(root.Width * 0.75), (int)(root.Height * 0.75));

			if (rC.W < 20)
				return;
			string sPath = path[0].ToString("X3") + "-" + String.Join("-", path.Skip(1).Take(depth-1));
			int ix = depth > 0 ? path[depth - 1] : 0;
			var c = Color.FromArgb(255, 255 - 25 * (ix % 10), 255 - 25 * ((ix % 100) / 10), 255);

			string msg = string.Format("[{2}] {1:X8} : {0}", rC, root.Address, sPath);

			var v = rc.AddTextWithHeight(new Vec2(x, yPos), msg, c, 9, DrawTextFormat.Left);
			rc.AddTextWithHeight(new Vec2(rC.X, rC.Y + depth * 10 - 10), sPath, c, 8, DrawTextFormat.Left);

			rc.AddFrame(rC, c);
			yPos += v.Y;

			if (yPos > 1100)
			{
				yPos = 80;
				x += 300;
			}
			var pp = new Vec2(rC.X, rC.Y);
			for (int i = 0; i < root.Children.Count; i++)
			{
				var elt = root.Children[i];
				path[depth] = i;
				if (depth < 8)
					drawElt(rc, elt, pp, ref x, ref yPos, path, depth + 1);
			}
		}
开发者ID:TomTer,项目名称:PoeHud,代码行数:37,代码来源:ShowUiHierarchy.cs

示例5: Render

        public override void Render(RenderingContext rc)
        {
            if (!Settings.GetBool("ItemAlert") || !Settings.GetBool("ItemAlert.ShowText"))
            {
                return;
            }
            Rect clientRect = this.poe.Internal.game.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();
            Vec2 rightTopAnchor = new Vec2(clientRect.X + clientRect.W, clientRect.Y + clientRect.H + 5);

            int y = rightTopAnchor.Y;
            int fontSize = Settings.GetInt("ItemAlert.ShowText.FontSize");

            foreach (KeyValuePair<ExileBot.Entity, AlertDrawStyle> kv in this.currentAlerts)
            {
                if (!kv.Key.IsValid) continue;

                string text = GetItemName(kv);
                if( null == text ) continue;

                AlertDrawStyle drawStyle = kv.Value;
                int frameWidth = drawStyle.FrameWidth;
                Vec2 vPadding = new Vec2(frameWidth + 5, frameWidth);
                int frameMargin = frameWidth + 2;

                Vec2 textPos = new Vec2(rightTopAnchor.X - vPadding.X, y + vPadding.Y);

                var vTextFrame = rc.AddTextWithHeight(textPos, text, drawStyle.color, fontSize, DrawTextFormat.Right);
                int iconSize = vTextFrame.Y;
                bool hasIcon = drawStyle.IconIndex >= 0;

                int maxHeight = vTextFrame.Y + 2*vPadding.Y + frameMargin;
                int maxWidth = vTextFrame.X + 2 * vPadding.X + (hasIcon ? iconSize : 0);
                rc.AddBox(new Rect(rightTopAnchor.X - maxWidth, y, maxWidth, maxHeight), Color.FromArgb(180, 0, 0, 0));

                if (hasIcon)
                {
                    const float iconsInSprite = 4;

                    Rect iconPos = new Rect(textPos.X - iconSize - vTextFrame.X, textPos.Y, iconSize, iconSize);
                    RectUV uv = new RectUV(drawStyle.IconIndex / iconsInSprite, 0, (drawStyle.IconIndex + 1) / iconsInSprite, 1);
                    rc.AddSprite("item_icons.png", iconPos, uv);
                }
                if( frameWidth > 0) {
                    Rect frame = new Rect(rightTopAnchor.X - vTextFrame.X - 2*vPadding.X, y, vTextFrame.X + 2*vPadding.X, vTextFrame.Y + 2*vPadding.Y);
                    rc.AddFrame(frame, kv.Value.color, frameWidth);
                }
                y += vTextFrame.Y + 2 * vPadding.Y + frameMargin;
            }
        }
开发者ID:sbradno,项目名称:PoeHud,代码行数:49,代码来源:ItemAlerter.cs

示例6: Render

        public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
        {
            if (!hasStarted)
            {
                lastCalcTime = DateTime.Now;
                hasStarted = true;
                return;
            }

            DateTime dtNow = DateTime.Now;
            TimeSpan delta = dtNow - lastCalcTime;

            if (delta.TotalSeconds > dps_period)
            {
                ixDamageMemory++;
                if (ixDamageMemory >= damageMemory.Length)
                    ixDamageMemory = 0;
                damageMemory[ixDamageMemory] = CalculateDps(delta);
                lastCalcTime = dtNow;
            }

            Vec2 mapWithOffset = mountPoints[UiMountPoint.LeftOfMinimap];
            int dps = ((int)damageMemory.Average());
            if (maxDps < dps)
                maxDps = dps;

            var textSize = rc.AddTextWithHeight(mapWithOffset,  dps + " DPS", Color.White, Settings.DpsFontSize, DrawTextFormat.Right);
            var tx2 = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y + textSize.Y), maxDps + " peak DPS", Color.White, Settings.PeakFontSize, DrawTextFormat.Right);

            int width = Math.Max(tx2.X, textSize.X);
            Rect rect = new Rect(mapWithOffset.X - 5 - width, mapWithOffset.Y - 5, width + 10, textSize.Y + tx2.Y + 10);

            rc.AddBox(rect, Color.FromArgb(160, Color.Black));

            mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(mapWithOffset.X, mapWithOffset.Y + 5 + rect.H);
        }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:36,代码来源:DpsMeter.cs

示例7: Render

 public override void Render(RenderingContext rc)
 {
     if (!this.isVisible)
     {
         return;
     }
     Color color = this.isEnabled ? Color.Gray : Color.Crimson;
     rc.AddTextWithHeight(new Vec2(base.Bounds.X + base.Bounds.W / 2, base.Bounds.Y + base.Bounds.H / 2), this.text, Color.White, 12, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
     rc.AddBox(base.Bounds, Color.Black);
     rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), color);
     if (this.children.Count > 0)
     {
         int num = (int)((float)(base.Bounds.W - 2) * 0.05f);
         int num2 = (base.Bounds.H - 2) / 2;
         rc.AddTexture("menu_submenu.png", new Rect(base.Bounds.X + base.Bounds.W - 1 - num, base.Bounds.Y + 1 + num2 - num2 / 2, num, num2));
     }
     foreach (MenuItem current in this.children)
     {
         current.Render(rc);
     }
 }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:21,代码来源:BooleanButton.cs

示例8: Render

 public override void Render(RenderingContext rc)
 {
     if (!Settings.GetBool("PreloadAlert"))
     {
         return;
     }
     int num = this.poe.Memory.ReadInt(this.poe.Memory.BaseAddress + poe.Memory.offsets.FileRoot, new int[]
     {
         12
     });
     if (num != this.lastCount)
     {
         this.lastCount = num;
         this.Parse();
     }
     if (this.disp.Count > 0)
     {
         Rect clientRect = this.poe.Internal.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();
         Rect rect = this.overlay.XphRenderer.Bounds;
         Vec2 vec = new Vec2(clientRect.X - 10, rect.Y + rect.H + 10);
         int num2 = vec.Y;
         int num3 = clientRect.W;
         int @int = Settings.GetInt("PreloadAlert.FontSize");
         int int2 = Settings.GetInt("PreloadAlert.BgAlpha");
         foreach (string current in this.disp)
         {
             Vec2 vec2 = rc.AddTextWithHeight(new Vec2(vec.X, num2), current, Color.White, @int, DrawTextFormat.Right);
             if (vec2.X + 10 > num3)
             {
                 num3 = vec2.X + 10;
             }
             num2 += vec2.Y;
         }
         if (num3 > 0 && int2 > 0)
         {
             this.bounds = new Rect(vec.X - num3 + 5, vec.Y - 5, num3, num2 - vec.Y + 10);
             rc.AddBox(this.bounds, Color.FromArgb(int2, 1, 1, 1));
         }
     }
 }
开发者ID:sbradno,项目名称:PoeHud,代码行数:40,代码来源:PreloadAlert.cs

示例9: Render

        public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
        {
            if (!Settings.Enabled)
            {
                return;
            }
            int num = this.model.Memory.ReadInt(this.model.Memory.BaseAddress + model.Memory.offsets.FileRoot, new int[]
            {
                12
            });
            if (num != this.lastCount)
            {
                this.lastCount = num;
                this.Parse();
            }
            if (this.disp.Count > 0)
            {

                Vec2 vec = mountPoints[UiMountPoint.LeftOfMinimap];
                int num2 = vec.Y;
                int maxWidth = 0;
                foreach (string current in this.disp)
                {
                    Vec2 vec2 = rc.AddTextWithHeight(new Vec2(vec.X, num2), current, Color.White, Settings.FontSize, DrawTextFormat.Right);
                    if (vec2.X + 10 > maxWidth)
                    {
                        maxWidth = vec2.X + 10;
                    }
                    num2 += vec2.Y;
                }
                if (maxWidth > 0 && Settings.BgAlpha > 0)
                {
                    Rect bounds = new Rect(vec.X - maxWidth + 5, vec.Y - 5, maxWidth, num2 - vec.Y + 10);
                    rc.AddBox(bounds, Color.FromArgb(Settings.BgAlpha, 1, 1, 1));
                    mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(vec.X, vec.Y + 5 + bounds.H);
                }

            }
        }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:39,代码来源:PreloadAlert.cs

示例10: Render

        public override void Render(RenderingContext rc)
        {
            if (!this.isVisible)
            {
                return;
            }

            rc.AddBox(base.Bounds, Color.Black);
            rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), Color.Gray);

            for (int c = 0; c < 3; c++ )
            {
                Rect barBounds = new Rect(base.Bounds.X, base.Bounds.Y + (base.Bounds.H / 3 * c), base.Bounds.W - 15, base.Bounds.H / 3);
                rc.AddTextWithHeight(new Vec2(barBounds.X + barBounds.W / 2, barBounds.Y + barBounds.H / 3), bars[c].Name + ": " + this.value.PrimaryColorValue(bars[c]), Color.White, 11, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
                rc.AddBox(new Rect(barBounds.X + 5, barBounds.Y + (3 * barBounds.H / 4), barBounds.W - 10, 4), bars[c]);
                rc.AddBox(new Rect(barBounds.X + 5 + ((barBounds.W - 10) * this.value.PrimaryColorValue(bars[c]) / 255) - 2, barBounds.Y + (3 * barBounds.H / 4) - 2, 4, 8), Color.White);
            }

            Rect preview = new Rect(base.Bounds.X + base.Bounds.W - 12, base.Bounds.Y + 2, 10, base.Bounds.H - 4);
            rc.AddBox(preview, Color.Black);
            rc.AddBox(new Rect(preview.X + 1, preview.Y + 1, preview.W - 2, preview.H - 2), this.value);
        }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:22,代码来源:ColorPicker.cs

示例11: Render

 public override void Render(RenderingContext rc)
 {
     if (!Settings.GetBool("DangerAlert.ShowText"))
     {
         return;
     }
     Rect rect = this.poe.Window.ClientRect();
     int num = rect.W / 2 + rect.X;
     int num2 = (int)((float)rect.H * 0.2f) + rect.Y;
     int num3 = 0;
     int num4 = 0;
     HashSet<string> hashSet = new HashSet<string>();
     foreach (KeyValuePair<Entity, string> current in this.currentAlerts)
     {
         if (current.Key.IsAlive && !hashSet.Contains(current.Value))
         {
             hashSet.Add(current.Value);
         }
     }
     int @int = Settings.GetInt("DangerAlert.ShowText.FontSize");
     foreach (string current2 in hashSet)
     {
         Vec2 vec = rc.AddTextWithHeight(new Vec2(num, num2), current2, Color.Red, @int, DrawTextFormat.Center);
         if (vec.X > num3)
         {
             num3 = vec.X;
         }
         num2 += vec.Y;
         num4 += vec.Y;
     }
     if (num3 > 0)
     {
         Rect rect2 = new Rect(num - num3 / 2 - 5, (int)((float)rect.H * 0.2f) + rect.Y - 5, num3 + 10, num4 + 10);
         rc.AddBox(rect2, Color.FromArgb(Settings.GetInt("DangerAlert.ShowText.BgAlpha"), 1, 1, 1));
     }
 }
开发者ID:sbradno,项目名称:PoeHud,代码行数:36,代码来源:DangerAlert.cs

示例12: RenderWeaponStats

        private void RenderWeaponStats(RenderingContext rc, Rect clientRect)
        {
            const int innerPadding = 3;
            float aSpd = ((float)1000) / _weaponAttack.AttackDelay;
            int cntDamages = Enum.GetValues(typeof(DamageType)).Length;
            float[] doubleDpsPerStat = new float[cntDamages];
            float physDmgMultiplier = 1;
            doubleDpsPerStat[(int)DamageType.Physical] = _weaponAttack.MaxDamage + _weaponAttack.MinDamage;
            foreach (RollValue roll in _explicitMods)
            {
                for (int iStat = 0; iStat < 4; iStat++)
                {
                    IntRange range = roll.TheMod.StatRange[iStat];
                    if (range.Min == 0 && range.Max == 0)
                        continue;

                    StatsDat.StatRecord theStat = roll.TheMod.StatNames[iStat];
                    int val = roll.StatValue[iStat];
                    switch (theStat.Key)
                    {
                        case "physical_damage_+%":
                        case "local_physical_damage_+%":
                            physDmgMultiplier += val / 100f;
                            break;
                        case "local_attack_speed_+%":
                            aSpd *= (100f + val) / 100;
                            break;
                        case "local_minimum_added_physical_damage":
                        case "local_maximum_added_physical_damage":
                            doubleDpsPerStat[(int)DamageType.Physical] += val;
                            break;
                        case "local_minimum_added_fire_damage":
                        case "local_maximum_added_fire_damage":
                        case "unique_local_minimum_added_fire_damage_when_in_main_hand":
                        case "unique_local_maximum_added_fire_damage_when_in_main_hand":
                            doubleDpsPerStat[(int)DamageType.Fire] += val;
                            break;
                        case "local_minimum_added_cold_damage":
                        case "local_maximum_added_cold_damage":
                        case "unique_local_minimum_added_cold_damage_when_in_off_hand":
                        case "unique_local_maximum_added_cold_damage_when_in_off_hand":
                            doubleDpsPerStat[(int)DamageType.Cold] += val;
                            break;
                        case "local_minimum_added_lightning_damage":
                        case "local_maximum_added_lightning_damage":
                            doubleDpsPerStat[(int)DamageType.Lightning] += val;
                            break;
                        case "unique_local_minimum_added_chaos_damage_when_in_off_hand":
                        case "unique_local_maximum_added_chaos_damage_when_in_off_hand":
                        case "local_minimum_added_chaos_damage":
                        case "local_maximum_added_chaos_damage":
                            doubleDpsPerStat[(int)DamageType.Chaos] += val;
                            break;

                        default:
                            break;
                    }
                }
            }

            doubleDpsPerStat[(int)DamageType.Physical] *= physDmgMultiplier;
            if (_quality > 0)
                doubleDpsPerStat[(int)DamageType.Physical] += (_weaponAttack.MaxDamage + _weaponAttack.MinDamage) * _quality / 100f;
            float pDps = doubleDpsPerStat[(int)DamageType.Physical] / 2 * aSpd;

            float eDps = 0;
            int firstEmg = 0;
            Color eDpsColor = Color.White;

            for(int i = 1; i < cntDamages; i++) {
                eDps += doubleDpsPerStat[i] / 2 * aSpd;
                if (doubleDpsPerStat[i] > 0)
                {
                    if (firstEmg == 0)
                    {
                        firstEmg = i;
                        eDpsColor = eleCols[i];
                    } else
                    {
                        eDpsColor = Color.DarkViolet;
                    }
                }
            }

            Vec2 sz = new Vec2();
            if (pDps > 0)
                sz = rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - Settings.OffsetInnerX, clientRect.Y + Settings.OffsetInnerY), pDps.ToString("#.#"), Color.White, Settings.DpsFontSize, DrawTextFormat.Right);
            Vec2 sz2 = new Vec2();
            if( eDps > 0 )
                sz2 = rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - Settings.OffsetInnerX, clientRect.Y + Settings.OffsetInnerY + sz.Y), eDps.ToString("#.#"), eDpsColor, Settings.DpsFontSize, DrawTextFormat.Right);
            rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - Settings.OffsetInnerX, clientRect.Y + Settings.OffsetInnerY + sz.Y + sz2.Y), "DPS", Color.White, 8, DrawTextFormat.Right);
        }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:92,代码来源:AdvTooltopRenderer.cs

示例13: RenderItemLevel

 private void RenderItemLevel(RenderingContext rc, Rect clientRect)
 {
     string text = _lastHovered.GetComponent<Mods>().ItemLevel.ToString();
     #if DEBUG
     text += " @ " + _lastHovered.Address.ToString("X8");
     #endif
     rc.AddTextWithHeight(new Vec2(clientRect.X + Settings.OffsetInnerX, clientRect.Y + Settings.OffsetInnerY), text, Color.White, Settings.ItemLevelFontSize, DrawTextFormat.Left);
 }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:8,代码来源:AdvTooltopRenderer.cs

示例14: drawStatLine

        private static int drawStatLine(RenderingContext rc, RollValue roll, Rect clientRect, int yPos, bool isImp = false)
        {
            const int leftRuler = 50;
            Color textColor = isImp ? HudSkin.MagicColor : Color.White;

            bool isUniqAffix = roll.AffixType == ModsDat.ModType.Hidden;
            string prefix = isImp ? "[Impl]" : roll.AffixType == ModsDat.ModType.Prefix
                ? "[P]"
                : roll.AffixType == ModsDat.ModType.Suffix ? "[S]" : "[?]";
            if (!isUniqAffix || isImp)
            {
                if( !isImp && roll.CouldHaveTiers())
                    prefix += " T" + roll.Tier + " ";

                rc.AddTextWithHeight(new Vec2(clientRect.X + 5, yPos), prefix, textColor, 8, DrawTextFormat.Left);
                var textSize = rc.AddTextWithHeight(new Vec2(clientRect.X + leftRuler, yPos), roll.AffixText, roll.TextColor, 8,
                    DrawTextFormat.Left);
                yPos += textSize.Y;
            }

            for (int iStat = 0; iStat < 4; iStat++)
            {
                IntRange range = roll.TheMod.StatRange[iStat];
                if(range.Min == 0 && range.Max == 0)
                    continue;

                var theStat = roll.TheMod.StatNames[iStat];
                int val = roll.StatValue[iStat];
                float percents = range.GetPercentage(val);
                bool noSpread = !range.HasSpread();

                double hue = 120 * percents;
                if (noSpread) hue = 300;
                if (percents > 1) hue = 180;

                Color col = ColorUtils.ColorFromHsv(hue, 1, 1);

                string line2 = string.Format(noSpread ? "{0}" : "{0} [{1}]", theStat, range);

                rc.AddTextWithHeight(new Vec2(clientRect.X + leftRuler, yPos), line2, Color.White, 8, DrawTextFormat.Left);

                if( null == theStat) // crazy maps
                    continue;

                string sValue = theStat.ValueToString(val);
                var txSize = rc.AddTextWithHeight(new Vec2(clientRect.X + leftRuler - 5, yPos), sValue,
                    col, 8,
                    DrawTextFormat.Right);

                yPos += txSize.Y;
            }
            return yPos;
        }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:53,代码来源:AdvTooltopRenderer.cs

示例15: DrawEntityHealthbarText

 private void DrawEntityHealthbarText(Color textColor, String healthString, Rect bg, RenderingContext rc)
 {
     // Draw monster health ex. "163 / 12k"
     rc.AddTextWithHeight(new Vec2(bg.X + bg.W / 2, bg.Y), healthString, textColor, 9, DrawTextFormat.Center);
 }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:5,代码来源:HealthBarRenderer.cs


注:本文中的RenderingContext.AddTextWithHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。