Exemple #1
0
        private void DrawSearchBox(string text, float x, float y, float w, float h)
        {
            float cornerRadius = h / 2.0f - 1.0f;

            Paint bg = _nvg.BoxGradient(x, y + 1.5f, w, h, h / 2.0f, 5.0f, _nvg.Rgba(0, 0, 0, 16), _nvg.Rgba(0, 0, 0, 92));

            _nvg.BeginPath();
            _nvg.RoundedRect(x, y, w, h, cornerRadius);
            _nvg.FillPaint(bg);
            _nvg.Fill();

            _nvg.BeginPath();
            _nvg.RoundedRect(x + 0.5f, y + 0.5f, w - 1.0f, h - 1.0f, cornerRadius - 0.5f);
            _nvg.StrokeColour(_nvg.Rgba(0, 0, 0, 48));
            _nvg.Stroke();

            _nvg.BeginPath();
            _nvg.FontSize(h * 1.3f);
            _nvg.FontFace("icons");
            _nvg.FillColour(_nvg.Rgba(255, 255, 255, 64));
            _nvg.TextAlign(Align.Centre | Align.Middle);
            _ = _nvg.Text(x + h * 0.55f, y + h * 0.55f, CpToUTF8(ICON_SEARCH));

            _nvg.FontSize(17.0f);
            _nvg.FontFace("sans");
            _nvg.FillColour(_nvg.Rgba(255, 255, 255, 32));

            _nvg.TextAlign(Align.Left | Align.Middle);
            _ = _nvg.Text(x + h * 1.05f, y + h * 0.5f, text);

            _nvg.FontSize(h * 1.3f);
            _nvg.FontFace("icons");
            _nvg.FillColour(_nvg.Rgba(255, 255, 255, 32));
            _nvg.TextAlign(Align.Centre | Align.Middle);
            _ = _nvg.Text(x + w - h * 0.55f, y + h * 0.55f, CpToUTF8(ICON_CIRCLED_CROSS));
        }