#include <CAUGuiMoreImages.h>
Inheritance diagram for CAUGuiSpinImage:

Public Member Functions | |
| CAUGuiSpinImage (char *pngFileName, float min, float max, SInt32 pivotOffsetX, SInt32 pivotOffsetY, bool fixed) | |
| constructor for a CAUGuiSpinImage | |
| virtual | ~CAUGuiSpinImage () |
| destructor | |
| virtual void | draw (CGContextRef context, UInt32 portHeight, eRect *rect, float value) |
| letting Graphics draw themselves | |
| virtual void | draw (CGContextRef context, UInt32 portHeight, eRect *rect, float value, SInt32 pivotOffsetX, SInt32 pivotOffsetY) |
| special case when used in a knob and the knob's internal pivot isn't in the center | |
This CAUGuiGraphic obviously handles an image.
It does this in two ways:
For both ways it has a so called Pivot point that by default sits in the center of the image. For both cases, this may be in most cases sufficient, but for orbital movement the there's another Pivot to be passed from the control object that should commonly be shifted _below_ the image by half the diameter of the circle.
The image passed is assumed to point to the top.
The amount rotation is scaled and mapped to a definable angle. Commonly it is a 270 degree rotation which means minimum value is 135 degree to the left (counter clockwise) and maximum value is 135 degree to the right (clockwise)
The scaling itself isn't done in degree or radians but in normalized measure of the unit circle, so the values look like this:
min = -0.375f // 135 degree counter clockwise
max = 0.375f // 135 degree clockwise
example:
the typical rotating knob:
CAUGuiGraphic* needle_handle = new CAUGuiSpinImage ( "knob_needle.png", -0.375f, 0.375f, 0, 0, false ); |
an orbiting handle with an Pivot offset to compensate for a little shadow on bottom right:
CAUGuiGraphic* round_handle = new CAUGuiSpinImage ( "round_handle.png", -0.375f, 0.375f, -2, 2, true ); |
Definition at line 50 of file CAUGuiMoreImages.h.
|
||||||||||||||||||||||||||||
|
constructor for a CAUGuiSpinImage
Definition at line 12 of file CAUGuiMoreImages.cpp. References CAUGuiGraphic::getHeight(), CAUGuiGraphic::getWidth(), kCAUGui_SpinImage, PI, and CAUGuiItem::setType(). |
|
|
destructor
Definition at line 68 of file CAUGuiMoreImages.h. |
|
||||||||||||||||||||||||||||
|
special case when used in a knob and the knob's internal pivot isn't in the center
Definition at line 72 of file CAUGuiMoreImages.cpp. References CAUGuiGraphic::getImage(), and eRect::to(). |
|
||||||||||||||||||||
|
letting Graphics draw themselves
Reimplemented from CAUGuiGraphic. Definition at line 40 of file CAUGuiMoreImages.cpp. References CAUGuiGraphic::getImage(), and eRect::to(). |
| (c) 2002 - 2003 by Urs Heckmann www.u-he.com |
1.3.6