Well...
I wrote this function that draws a box(title bar in my case).
you must input:
a pattern type(explained in the code)
an x and y start point
an x and y end point
an initial color
and a final color
based on your input it will draw a box(title bar) that fades from the initial color to the final color(and back).
you fellow "programmers" might hate me for this but i have a bad habit of programming in CAPS <sorry>
...tell me what you think...
GLOBAL T_BAR_PATTERN_TYPE AS INTEGER :`THIS SETS THE VISUAL PROPERTIES OF THE TITLE BAR
:`WHERE "I" REFERS TO THE INITIAL COLOR
:`AND "F" REFERS TO THE FINAL COLOR
:`YOUR OPTIONS ARE AS FOLLOWS:
:`"1" FOR: I -> F -> I (TOP TO BOTTOM)
:`"2" FOR: I -> F (TOP TO BOTTOM)
:`"3" FOR: I -> F -> I (LEFT TO RIGHT)
:`"4" FOR: I -> F (LEFT TO RIGHT)
GLOBAL T_BAR_START_X AS INTEGER :`THIS SETS THE TITLE BAR'S STARTING POSITION ON THE X AXIS
GLOBAL T_BAR_START_Y AS INTEGER :`THIS SETS THE TITLE BAR'S STARTING POSITION ON THE Y AXIS
GLOBAL T_BAR_END_X AS INTEGER :`THIS SETS THE TITLE BAR'S ENDING POSITION ON THE X AXIS
GLOBAL T_BAR_END_Y AS INTEGER :`THIS SETS THE TITLE BAR'S ENDING POSITION ON THE Y AXIS
:`SET THE FOLLOWING SIX VARIABLES AS
:`AN INTEGER FROM "0" TO "255"
GLOBAL T_BAR_RED_START AS INTEGER :`THIS SETS THE RED VALUE FOR THE INITIAL INK COLOR
GLOBAL T_BAR_GREEN_START AS INTEGER :`THIS SETS THE GREEN VALUE FOR THE INITIAL INK COLOR
GLOBAL T_BAR_BLUE_START AS INTEGER :`THIS SETS THE BLUE VALUE FOR THE INITIAL INK COLOR
GLOBAL T_BAR_RED_END AS INTEGER :`THIS SETS THE RED VALUE FOR THE FINAL INK COLOR
GLOBAL T_BAR_GREEN_END AS INTEGER :`THIS SETS THE GREEN VALUE FOR THE FINAL INK COLOR
GLOBAL T_BAR_BLUE_END AS INTEGER :`THIS SETS THE BLUE VALUE FOR THE FINAL INK COLOR
`NOTE!: IF T_BAR_START_X > T_BAR_END_X OR T_BAR_START_Y > T_BAR_END_Y
` THE TITLE BAR WILL NOT SHOW.
DO
TITLE_BAR(1,0,0,SCREEN WIDTH(),20,255,0,0,0,0,0)
TITLE_BAR(3,0,21,20,SCREEN HEIGHT()-20,0,0,0,255,255,255)
TITLE_BAR(3,SCREEN WIDTH()-20,21,SCREEN WIDTH(),SCREEN HEIGHT()-20,255,255,255,0,0,0)
TITLE_BAR(1,0,SCREEN HEIGHT()-20,SCREEN WIDTH(),SCREEN HEIGHT(),255,255,0,0,0,255)
TITLE_BAR(RND(3)+1,RND(SCREEN WIDTH()),RND(SCREEN HEIGHT()),RND(SCREEN WIDTH()),RND(SCREEN HEIGHT()),RND(255),RND(255),RND(255),RND(255),RND(255),RND(255))
LOOP
FUNCTION TITLE_BAR(T_BAR_PATTERN_TYPE,T_BAR_START_X,T_BAR_START_Y,T_BAR_END_X,T_BAR_END_Y,T_BAR_RED_START,T_BAR_GREEN_START,T_BAR_BLUE_START,T_BAR_RED_END,T_BAR_GREEN_END,T_BAR_BLUE_END)
IF T_BAR_PATTERN_TYPE=1
TOTAL_LINES=T_BAR_END_Y-T_BAR_START_Y
HALF_POINT=TOTAL_LINES*.5
COL_GRAD_RED#=ABS(T_BAR_RED_START-T_BAR_RED_END)/(TOTAL_LINES*.5)
COL_GRAD_GREEN#=ABS(T_BAR_GREEN_START-T_BAR_GREEN_END)/(TOTAL_LINES*.5)
COL_GRAD_BLUE#=ABS(T_BAR_BLUE_START-T_BAR_BLUE_END)/(TOTAL_LINES*.5)
IF T_BAR_RED_START>T_BAR_RED_END THEN COL_GRAD_RED#=COL_GRAD_RED#*-1
IF T_BAR_GREEN_START>T_BAR_GREEN_END THEN COL_GRAD_GREEN#=COL_GRAD_GREEN#*-1
IF T_BAR_BLUE_START>T_BAR_BLUE_END THEN COL_GRAD_BLUE#=COL_GRAD_BLUE#*-1
CURRENT_RED#=T_BAR_RED_START+COL_GRAD_RED#
CURRENT_GREEN#=T_BAR_GREEN_START+COL_GRAD_GREEN#
CURRENT_BLUE#=T_BAR_BLUE_START+COL_GRAD_BLUE#
FOR CURRENT_LINE = 0 TO HALF_POINT
INK RGB(CURRENT_RED#-COL_GRAD_RED#,CURRENT_GREEN#-COL_GRAD_GREEN#,CURRENT_BLUE#-COL_GRAD_BLUE#),1
LINE T_BAR_START_X,T_BAR_START_Y+CURRENT_LINE,T_BAR_END_X,T_BAR_START_Y+CURRENT_LINE
CURRENT_RED#=CURRENT_RED#+COL_GRAD_RED#
CURRENT_GREEN#=CURRENT_GREEN#+COL_GRAD_GREEN#
CURRENT_BLUE#=CURRENT_BLUE#+COL_GRAD_BLUE#
NEXT CURRENT_LINE
FOR CURRENT_LINE = HALF_POINT TO TOTAL_LINES
INK RGB(CURRENT_RED#-(COL_GRAD_RED#*2),CURRENT_GREEN#-(COL_GRAD_GREEN#*2),CURRENT_BLUE#-(COL_GRAD_BLUE#*2)),1
LINE T_BAR_START_X,T_BAR_START_Y+CURRENT_LINE,T_BAR_END_X,T_BAR_START_Y+CURRENT_LINE
CURRENT_RED#=CURRENT_RED#-COL_GRAD_RED#
CURRENT_GREEN#=CURRENT_GREEN#-COL_GRAD_GREEN#
CURRENT_BLUE#=CURRENT_BLUE#-COL_GRAD_BLUE#
NEXT CURRENT_LINE
ENDIF
IF T_BAR_PATTERN_TYPE=2
TOTAL_LINES=T_BAR_END_Y-T_BAR_START_Y
COL_GRAD_RED#=ABS(T_BAR_RED_START-T_BAR_RED_END)/(TOTAL_LINES)
COL_GRAD_GREEN#=ABS(T_BAR_GREEN_START-T_BAR_GREEN_END)/(TOTAL_LINES)
COL_GRAD_BLUE#=ABS(T_BAR_BLUE_START-T_BAR_BLUE_END)/(TOTAL_LINES)
IF T_BAR_RED_START>T_BAR_RED_END THEN COL_GRAD_RED#=COL_GRAD_RED#*-1
IF T_BAR_GREEN_START>T_BAR_GREEN_END THEN COL_GRAD_GREEN#=COL_GRAD_GREEN#*-1
IF T_BAR_BLUE_START>T_BAR_BLUE_END THEN COL_GRAD_BLUE#=COL_GRAD_BLUE#*-1
CURRENT_RED#=T_BAR_RED_START+COL_GRAD_RED#
CURRENT_GREEN#=T_BAR_GREEN_START+COL_GRAD_GREEN#
CURRENT_BLUE#=T_BAR_BLUE_START+COL_GRAD_BLUE#
FOR CURRENT_LINE = 0 TO TOTAL_LINES
INK RGB(CURRENT_RED#-COL_GRAD_RED#,CURRENT_GREEN#-COL_GRAD_GREEN#,CURRENT_BLUE#-COL_GRAD_BLUE#),1
LINE T_BAR_START_X,T_BAR_START_Y+CURRENT_LINE,T_BAR_END_X,T_BAR_START_Y+CURRENT_LINE
CURRENT_RED#=CURRENT_RED#+COL_GRAD_RED#
CURRENT_GREEN#=CURRENT_GREEN#+COL_GRAD_GREEN#
CURRENT_BLUE#=CURRENT_BLUE#+COL_GRAD_BLUE#
NEXT CURRENT_LINE
ENDIF
IF T_BAR_PATTERN_TYPE=3
TOTAL_LINES=T_BAR_END_X-T_BAR_START_X
HALF_POINT=TOTAL_LINES*.5
COL_GRAD_RED#=ABS(T_BAR_RED_START-T_BAR_RED_END)/(TOTAL_LINES*.5)
COL_GRAD_GREEN#=ABS(T_BAR_GREEN_START-T_BAR_GREEN_END)/(TOTAL_LINES*.5)
COL_GRAD_BLUE#=ABS(T_BAR_BLUE_START-T_BAR_BLUE_END)/(TOTAL_LINES*.5)
IF T_BAR_RED_START>T_BAR_RED_END THEN COL_GRAD_RED#=COL_GRAD_RED#*-1
IF T_BAR_GREEN_START>T_BAR_GREEN_END THEN COL_GRAD_GREEN#=COL_GRAD_GREEN#*-1
IF T_BAR_BLUE_START>T_BAR_BLUE_END THEN COL_GRAD_BLUE#=COL_GRAD_BLUE#*-1
CURRENT_RED#=T_BAR_RED_START+COL_GRAD_RED#
CURRENT_GREEN#=T_BAR_GREEN_START+COL_GRAD_GREEN#
CURRENT_BLUE#=T_BAR_BLUE_START+COL_GRAD_BLUE#
FOR CURRENT_LINE = 0 TO HALF_POINT
INK RGB(CURRENT_RED#-COL_GRAD_RED#,CURRENT_GREEN#-COL_GRAD_GREEN#,CURRENT_BLUE#-COL_GRAD_BLUE#),1
LINE T_BAR_START_X+CURRENT_LINE,T_BAR_START_Y,T_BAR_START_X+CURRENT_LINE,T_BAR_END_Y
CURRENT_RED#=CURRENT_RED#+COL_GRAD_RED#
CURRENT_GREEN#=CURRENT_GREEN#+COL_GRAD_GREEN#
CURRENT_BLUE#=CURRENT_BLUE#+COL_GRAD_BLUE#
NEXT CURRENT_LINE
FOR CURRENT_LINE = HALF_POINT TO TOTAL_LINES
INK RGB(CURRENT_RED#-(COL_GRAD_RED#*2),CURRENT_GREEN#-(COL_GRAD_GREEN#*2),CURRENT_BLUE#-(COL_GRAD_BLUE#*2)),1
LINE T_BAR_START_X+CURRENT_LINE,T_BAR_START_Y,T_BAR_START_X+CURRENT_LINE,T_BAR_END_Y
CURRENT_RED#=CURRENT_RED#-COL_GRAD_RED#
CURRENT_GREEN#=CURRENT_GREEN#-COL_GRAD_GREEN#
CURRENT_BLUE#=CURRENT_BLUE#-COL_GRAD_BLUE#
NEXT CURRENT_LINE
ENDIF
IF T_BAR_PATTERN_TYPE=4
TOTAL_LINES=T_BAR_END_X-T_BAR_START_X
COL_GRAD_RED#=ABS(T_BAR_RED_START-T_BAR_RED_END)/(TOTAL_LINES)
COL_GRAD_GREEN#=ABS(T_BAR_GREEN_START-T_BAR_GREEN_END)/(TOTAL_LINES)
COL_GRAD_BLUE#=ABS(T_BAR_BLUE_START-T_BAR_BLUE_END)/(TOTAL_LINES)
IF T_BAR_RED_START>T_BAR_RED_END THEN COL_GRAD_RED#=COL_GRAD_RED#*-1
IF T_BAR_GREEN_START>T_BAR_GREEN_END THEN COL_GRAD_GREEN#=COL_GRAD_GREEN#*-1
IF T_BAR_BLUE_START>T_BAR_BLUE_END THEN COL_GRAD_BLUE#=COL_GRAD_BLUE#*-1
CURRENT_RED#=T_BAR_RED_START+COL_GRAD_RED#
CURRENT_GREEN#=T_BAR_GREEN_START+COL_GRAD_GREEN#
CURRENT_BLUE#=T_BAR_BLUE_START+COL_GRAD_BLUE#
FOR CURRENT_LINE = 0 TO TOTAL_LINES
INK RGB(CURRENT_RED#-COL_GRAD_RED#,CURRENT_GREEN#-COL_GRAD_GREEN#,CURRENT_BLUE#-COL_GRAD_BLUE#),1
LINE T_BAR_START_X+CURRENT_LINE,T_BAR_START_Y,T_BAR_START_X+CURRENT_LINE,T_BAR_END_Y
CURRENT_RED#=CURRENT_RED#+COL_GRAD_RED#
CURRENT_GREEN#=CURRENT_GREEN#+COL_GRAD_GREEN#
CURRENT_BLUE#=CURRENT_BLUE#+COL_GRAD_BLUE#
NEXT CURRENT_LINE
ENDIF
ENDFUNCTION
B.T.W. - if you didn't know, what i do is:
(1)make the title bar i want
(2)execute the program
(3)press "alt" and "prt sc" at the same time
(4)open up "ms paint"
(5)press "ctrl" and "v" at the same time
(6)cut out all but the title bar
(7)save as image
(8)then i use it as a sprite
- it works much faster in DBP that way
metal is not music but a way of life...all hail to the reigning king METALLICA!!!