Game Development Community

Error in GuiSliderCtrl::onRender (1.02 at least)

by Kirk Longendyke · in Torque Game Engine Advanced · 10/09/2007 (5:37 am) · 0 replies

When utilising a verticle sliderbar, the ticker-rail won't render. fix as follows:

change:
else
   {
      Point2I mid(ext.x/2, ext.y);
      GFX->drawLine(pos.x+mid.x, pos.y, pos.x+mid.x, pos.y+mid.y, ColorI(0,0,0,1));

      for (U32 t = 0; t <= (mTicks+1); t++)
      {
         S32 y = (S32)(F32(mid.y-1)/F32(mTicks+1)*F32(t));

         GFX->drawLine(pos.x+mid.x-mShiftPoint, pos.y+y,
                       pos.x+mid.x+mShiftPoint, pos.y+y, ColorI(0,0,0,1));
      }
to
else
   {
      Point2I mid(ext.x/2, ext.y);
      GFX->drawLine(pos.x+mid.x, pos.y, pos.x+mid.x, pos.y+mid.y, ColorI(0,0,0,255));

      for (U32 t = 0; t <= (mTicks+1); t++)
      {
         S32 y = (S32)(F32(mid.y-1)/F32(mTicks+1)*F32(t));

         GFX->drawLine(pos.x+mid.x-mShiftPoint, pos.y+y,
                       pos.x+mid.x+mShiftPoint, pos.y+y, ColorI(0,0,0,255));
      }

'course, a better long-term fix'd be to tack on a color-selector as part of the profile (not to mention flipping the value so up brings the value up, not down) , but meh. that'll get it going utilising the *stock* methodology, at least.