Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading...
#1
How do i make a loading bar... i have tried but i cant do it run smooth... i want it like this:

| and - is a rectangular box
: is a green filled rectangular box that will fill up the white box


|-----------------------------------|
|:::::::::::::::::::::::::::::::::::|
|-----------------------------------|


gah, cant tell any good but if no one understands what i want i can show an example in flash...
Reply
#2
Well, you draw a bar with the length being based on a certain percentage. Maybe like so:


PRINT STRING$( (percentage% \ 5) , CHR$(219) )

where it will increase the bar every 5% and where percentage% is just a variable holding the current percentage.

If it's more of a graphical bar, instead of using print to draw a block, draw a rectangle with coordinates X1,Y1,X2,Y2 where X1,Y1 and Y2 don't change, but X2 increases by a few pixels as the percentage bar goes up.

You should make a sub-routine that displays a percentage bar based on the percentage like so:

SUB PercentBar(Percentage%)
draw rectangle at (X1, Y1)-(X1+Percentage%,Y2)
END SUB

To make it nice and smooth, use a graphical library such as Rellib or cosmox, and by using an off-screen buffer, you can have flickerless animation.
Reply
#3
To make it smooth, just call often the bar routine...
Antoni
Reply
#4
k, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)