# How do developers make knob labels into values when mouseOver?

**URL:** <https://iplug2.discourse.group/t/how-do-developers-make-knob-labels-into-values-when-mouseover/925>\
**Category:** Uncategorized\
**Created:** [19 July 2024 17:29 UTC](https://iplug2.discourse.group/t/how-do-developers-make-knob-labels-into-values-when-mouseover/925 "2024-07-19T17:29:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rramirez](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/rramirez/32/128_2.png) [@rramirez](https://iplug2.discourse.group/u/rramirez)\
**Post date:** [19 July 2024 17:29 UTC](https://iplug2.discourse.group/t/how-do-developers-make-knob-labels-into-values-when-mouseover/925/1 "2024-07-19T17:29:29Z")

</div>

I feel like im doing something wrong with this, I have my knob setup with labels and values in the same bounds, when I mouse over the knob the value shows up however the label is under the value thus showing label and value, I would like the label to transform into the value like SurrealMachines or Outobugi

```auto
    ExampleKnob(const IRECT bounds, int param, const char* label)
        : IVKnobControl(bounds, param, label)
    {
        AttachIControl(this, label);
    }

    void OnMouseOver(float x, float y, const IMouseMod& mod)
    {
        if (mStyle.showValue && !mDisablePrompt)
            mValueMouseOver = mValueBounds.Contains(x, y);

        IKnobControlBase::OnMouseOver(x, y, mod);

        SetDirty(false);
    }

    void OnMouseDown(float x, float y, const IMouseMod& mod)
    {
        OnMouseOver(x, y, mod);

        mMouseDown = true;
        mMouseDragValue = GetValue();

        if (mod.A)
            SetValueToDefault();
        else
            GetUI()->HideMouseCursor();
    }

    void _DrawLabel(IGraphics& g, bool mouseOver)
    {
        mValueMouseOver = true;

        IBlend blend = mControl->GetBlend();

        g.DrawText(text, mLabelStr.Get(), mValueBounds, &BLEND_DST_IN);

        if (mouseOver)
            g.DrawText(text, mValueStr.Get(), mValueBounds, &BLEND_DST_OVER);
    }

```

and on void Draw i have \_DrawLabel at the bottom of the drawing of knob.

---

<div class="post-metadata">

**Author:** ![rramirez](https://yyz2.discourse-cdn.com/free1/user_avatar/iplug2.discourse.group/rramirez/32/128_2.png) [@rramirez](https://iplug2.discourse.group/u/rramirez)\
**Post date:** [29 July 2024 04:56 UTC](https://iplug2.discourse.group/t/how-do-developers-make-knob-labels-into-values-when-mouseover/925/2 "2024-07-29T04:56:52Z")

</div>

The code was correct, however it wasn’t working because of the order of operations for the mouseOver  
it should be:

```auto
if(mouseOver)
    g.DrawText(text, mValueStr.Get(), mValueBounds, &blend);
else
    g.DrawText(text, mLabelStr.Get(), mValueBounds, &blend);

```
