pan_setneedle (PANEL*, var num, var x, var y, BMAP* bmap, var cx, var cy, var angle, var min, var max, var* pv)
Adds or modifies a needle element on a panel. 7.71 LC
Parameters:
PANEL* |
Panel pointer. |
num |
Number of an existing needle element (1 = first needle of the panel) or 0 for adding a new needle element to the panel. |
x, y, ... |
Needle parameters to be set - see needle. |
Returns:
Number of the element, or 0 if the element could not be found or created.
Example (lite-C):
// display an analog clock
function main()
{
wait(1); // wait with bmap_fill until the video device is opened
PANEL* clock = pan_create(NULL,0);
set(clock,SHOW);
pan_setneedle(clock,0,screen_size.x/2,screen_size.y/2,
bmap_fill(bmap_createblack(140,8,32),vector(255,255,255),100),
10,4,90,12,0,sys_hours);
pan_setneedle(clock,0,screen_size.x/2,screen_size.y/2,
bmap_fill(bmap_createblack(180,6,32),vector(255,255,255),100),
10,3,90,60,0,sys_minutes);
pan_setneedle(clock,0,screen_size.x/2,screen_size.y/2,
bmap_fill(bmap_createblack(190,4,32),vector(0,0,255),100),
20,2,90,60,0,sys_seconds);
}
See also:
PANEL, needle, pan_setbutton, pan_setslider, pan_setdigits, pan_setwindow, pan_setpos
► latest
version online