Hi All.
This function allows you to put in a text string say throttle and then by moving the slide control on the joystick will get amount used.
run it and see.
Rem Project: joy slider
Rem Created: 05/01/2006 04:44:57
Rem ***** Main Source File *****
rem Standard Setup Code
sync on : sync rate 0 :
backdrop on
color backdrop rgb(0,0,128)
hide mouse
set text font "arial"
set text size 22
set text transparent
#constant barwidth = 162
#constant textwidth =text width("W")
#constant textheight = text height("I")
#constant colorblack = RGB(0,0,0)
#constant colorgreen = RGB(0,255,0)
#constant colororange = RGB(255,128,0)
#constant colorgrey = RGB(192,192,192)
#constant colordarkgrey = RGB(128,128,128)
do
rem get slider value
power=joystick slider a()
rem call function
joyslidethrust(100,0,colororange," Thrust ",power,12,colorgrey,colorblack,colorgreen)
rem call function again
joyslidethrust(150,50,colororange," Thrust2 ",power,20,colorgrey,colorblack,colorgreen)
joyslidethrust(50,250,colororange,"Very long slider bar",power,72,colorgrey,colorblack,colorgreen)
rem update screen
sync
loop
function joyslidethrust(x1,y1,text_color,t$,joypower,fontsize,backgroundcolor,bar_back_ground_color,bar_fore_ground_color)
rem order of function
rem postion x1,y1
rem set text color
rem string of text
rem joystick slider %
rem set font size
rem box boarder color
rem slider bar back ground color
rem slider bar fore ground color
rem set font size
set text size fontsize
rem find % of slider
per#=abs(int((joypower/65535.0)*100.0))
rem find % of text and show bar
tl=((text width(t$)+10.0)/100.0)*per#
rem display gray box background
box x1,y1,x1+text width(t$)+13,y1+text height(t$)+6,backgroundcolor,backgroundcolor,backgroundcolor,backgroundcolor
box x1+3,y1+3,x1+text width(t$)+11,y1+3+text height(T$),bar_back_ground_color,bar_back_ground_color,bar_back_ground_color,bar_back_ground_color
rem green power foreground
box x1+4,y1+4,x1+text width(t$)+10-tl,y1+3+text height(t$)-1,bar_fore_ground_color,bar_fore_ground_color,bar_fore_ground_color,bar_fore_ground_color
rem set text color
ink text_color,0
rem place text
text x1+10,y1+3,t$
endfunction
I'm not getting you down am I, Ho Look! another fancy Door?