Example #1
0
 void DrawLegendItem(InternalLabeler labeler, Vector2 position, string labelName, string valueName, string labelText, int value, Color color)
 {
     //Format...[] GenX {count}
     _memoryMonitor.TempBoxDrawer.ShowGradientBoxOnce(position, position - new Vector2(10, 10), color, color);
     labeler.ShowLabel(labelName, position + new Vector2(4, -10), labelText, color);
     _stringBuilder.SetText(value);
     labeler.ShowLabelEx(valueName, position + new Vector2(44, -10), _stringBuilder, color);
 }
Example #2
0
        void PlotTickMemoryGraph(InternalLabeler labeler, float graphWidth)
        {
            _plot.Sampler.Values.Clear();
            _plot.Position = new Vector2(Position.X + LegendWidth, Position.Y);
            _plot.Size     = new Vector2(graphWidth, Size.Y);

            var i  = 0;
            var id = _memoryMonitor.FrameId;

            while (i < MemoryMonitor.MaxFrames)
            {
                id++;
                if (id == MemoryMonitor.MaxFrames)
                {
                    id = 0;
                }

                //Display Kilobytes per tick
                _plot.Sampler.Values.Enqueue(_memoryMonitor.Frames[id].TickMemoryBytes / 1024.0f);
                i++;
            }

            labeler.ShowLabel(LabelName.MinYAxis, Position + new Vector2(2 + LegendWidth, Size.Y - 12), "0", Color.White);

            _stringBuilder.SetText(_maxTotalYScaleMb).Append(" MB");
            labeler.ShowLabelEx(LabelName.MaxYAxis, Position + new Vector2(2 + LegendWidth, 0), _stringBuilder, Color.White);

            float actualmin, actualmax;

            _plot.Sampler.GetLimits(out actualmin, out actualmax);

            var min = _plot.Min = _plot.Min + (actualmin - _plot.Min) * 0.3f;
            var max = _plot.Max = _plot.Max + (actualmax - _plot.Max) * 0.3f;

            GearsetResources.Console.Plotter.PlotGraph(_plot, _memoryMonitor.LineDrawer, labeler, MemoryMonitor.MaxFrames, min, max, _plot.Position, _plot.Size, actualmin, actualmax, Size.X - LegendWidth - 40.0f);
        }