Okay, I really didn't want to give away the secret to the most interesting part of this battle system I'm working on, but since I'm just so darn proud of it, I figured I'd show off my code to the wonderful people here at the forums.
Essentially, this "meter" type can increase in size, have items added to it, have subdivisions added/subtracted, all while animating liquid smooth. It's essentially designed for queue logic, i.e. it will clear up the first bar, then continue on to the second, third, so forth.
Practical applications would be:
(With single meter)
RPG health/mp bars hovering over the character.
Basic time remaining bars
Upgrade/experience progress bars
Basic loading bar
(With multiple meters)
Attack-queue system
Segmented loading bar that keeps center
Progress bars for multiple tasks of the same unit in an RTS or similar.
Unless you want the meter to move to different parts of the screen using the same animation technique used to get it to grow, mcenter(0), propx, and propy need to be taken out in favor of the x and y variables of the type. I tried to simplify the code for general use, but I didn't remove that bit since I figured some would still use it.
In this (Demo) version of the code, you can increase progress by holding up. Notice how the bars recenter after every bar is removed. I would have added a separate key to add a new bar, but hey, I want to get this over with.
//Color Constants By Mr. 909
#CONSTANT col_white RGB(255,255,255)
#CONSTANT col_black RGB(0,0,0)
///RGB Color Constants
#CONSTANT col_blue RGB(0,0,255)
//RPG Classic Color Constants
#CONSTANT col_menblue RGB(0,0,171)
TYPE meter
active AS BOOLEAN
progress AS FLOAT
propx AS DWORD
propy AS DWORD
propv AS DWORD
x AS DWORD
y AS DWORD
h AS DWORD
v AS DWORD
length AS FLOAT
actype AS DWORD
ENDTYPE
SYNC ON
SYNC RATE 60
DIM pmet(0,4) AS meter
//cl_meter is used to blank out meter values.
DIM cl_meter(0) AS meter
DIM mcent(0,2) AS DWORD
//Create Center Hook For Meters
mcent(0,1)=64
mcent(0,2)=64
FOR a=0 TO 4
//Create Meter 0,0
pmet(0,a).active=1
pmet(0,a).x=mcent(0,1)
pmet(0,a).y=mcent(0,2)
pmet(0,a).propv=10
pmet(0,a).length=20
NEXT a
DO
proceed()
IF UPKEY()=1 AND pmet(0,0).active=1 THEN INC pmet(0,0).progress
IF DOWNKEY()=1 THEN END
LOOP
END
// Function Declarations
FUNCTION proceed()
CLS col_menblue
//Reset INK
INK col_white,col_black
//Processing Functions For Meters
//If Progress is complete, clear meter
IF pmet(0,0).progress>pmet(0,0).length THEN pmet(0,0)=cl_meter(0)
//Slide Meters
FOR a=1 TO 4
IF pmet(0,a-1).active=0 THEN pmet(0,a-1)=pmet(0,a) : pmet(0,a)=cl_meter(0)
NEXT a
//Drawing Functions For Meters
//Get Prop Position For Each Meter
//Proper X Values
met_length=0
basex=0
FOR a=0 TO 4
//Get Total Meter Length
INC met_length,pmet(0,a).length
NEXT a
//Get Reading Frame: BaseX-(Length/2)
basex=mcent(b,1)-(met_length/2)
//Get Meter Centers
pmet(b,0).propx=basex+(pmet(b,0).length/2)
pmet(b,1).propx=basex+(pmet(b,0).length)+(pmet(b,1).length/2)
pmet(b,2).propx=basex+(pmet(b,0).length)+(pmet(b,1).length)+(pmet(b,2).length/2)
pmet(b,3).propx=basex+(pmet(b,0).length)+(pmet(b,1).length)+(pmet(b,2).length)+(pmet(b,3).length/2)
pmet(b,4).propx=basex+(pmet(b,0).length)+(pmet(b,1).length)+(pmet(b,2).length)+(pmet(b,3).length)+(pmet(b,4).length/2)
//Proper Y Values
FOR a=0 TO 4
pmet(0,a).propy=mcent(0,2)
NEXT a
FOR a=0 TO 4
//Regulate Position For Each Meter
pmet(0,a).h=regulate(pmet(0,a).h,pmet(0,a).length)
pmet(0,a).v=regulate(pmet(0,a).v,pmet(0,a).propv)
pmet(0,a).x=regulate(pmet(0,a).x,pmet(0,a).propx)
pmet(0,a).y=regulate(pmet(0,a).y,pmet(0,a).propy)
//Draw Each Meter Background
INK col_blue,col_black
BOX (pmet(0,a).x-(pmet(0,a).h/2)),(pmet(0,a).y-(pmet(0,a).v/2)),(pmet(0,a).x+(pmet(0,a).h/2)),(pmet(0,a).y+(pmet(0,a).v/2))
outline((pmet(0,a).x-(pmet(0,a).h/2)),(pmet(0,a).y-(pmet(0,a).v/2)),(pmet(0,a).x+(pmet(0,a).h/2)),(pmet(0,a).y+(pmet(0,a).v/2)))
INK col_black,col_black
BOX (pmet(0,a).x+(pmet(0,a).h/2)-pmet(0,a).progress),(pmet(0,a).y-(pmet(0,a).v/2)),(pmet(0,a).x+(pmet(0,a).h/2)),(pmet(0,a).y+(pmet(0,a).v/2))
NEXT a
SYNC
ENDFUNCTION
FUNCTION regulate(a,b)
IF b>a THEN INC a
IF b<a THEN DEC a
ENDFUNCTION a
FUNCTION outline(fx,fy,sx,sy)
INK col_black,col_black
LINE fx,fy,sx,fy
LINE sx,fy,sx,sy
LINE fx,sy,sx,sy
LINE fx,fy,fx,sy
ENDFUNCTION