public override void UpdateGraphics() { if (!inapp) { boundingbox.targetleft = boundingbox.origleft * Globals.panelanimationratio; boundingbox.targetright = boundingbox.origright * Globals.panelanimationratio; } else { boundingbox.origleft = boundingbox.targetright - 1; } boundingbox.animateupdate(Globals.panelanimated); if (hover) { animationratio = 0.7 * animationratio + 0.3 * 0.2; } else { animationratio = 0.7 * animationratio + 0.3 * 0.0; } RectangleBox highlight = new RectangleBox(boundingbox.left, boundingbox.right, boundingbox.bottom, animationratio * boundingbox.top + (1 - animationratio) * boundingbox.bottom); if (!border) { RendererWrapper.DrawRectangle(boundingbox, col, -1); RendererWrapper.DrawRectangle(highlight, col.Mix(col, new RGBAColor(1, 1, 1, 1), 0.5), -1); } else { RendererWrapper.DrawRectangle(boundingbox, new RGBAColor(0, 0, 0, 1), -1); RendererWrapper.DrawRectangle(highlight, col.Mix(col, new RGBAColor(1, 1, 1, 1), 0.5), -1); RendererWrapper.DrawRectangle(boundingbox, col, 2); } RendererWrapper.DrawString(boundingbox.left + 16, boundingbox.bottom + boundingbox.Height / 2 - 12.0 / 2, caption, new RGBAColor(1.0, 1.0, 1.0, 1.0)); }
public static void DrawPlate3D(double xpos, double ypos, double xang, double yang, double zang, RGBAColor col) { glColor4d(col.Mix(col, new RGBAColor(0, 0, 0, 1), 0.2)); Gl.glPushMatrix(); Gl.glTranslated(xpos, ypos, 0.7); Gl.glRotated(xang, 1, 0, 0); Gl.glRotated(yang, 0, 1, 0); Gl.glRotated(zang, 0, 0, 1); Gl.glScaled(0.7, 0.1, 0.7); Glut.glutSolidCube(1); Gl.glLineWidth(2); glColor4d(col); Glut.glutWireCube(1); Gl.glPopMatrix(); }