Get your own free workspace
View
 

CreateProgressBar

Page history last edited by Gamemaster 3 years, 10 months ago

 

CreateProgressBar

Usage:

                CreateProgressBar(Actor, R, G, B, X, Y, Width, Height, Maximum, Value, [Label])

Description:

The CreateProgressBar command displays a progress bar on screen for the player actor specified. The R, G and B parameters allow it to be given a colour. The X, Y, Width and Height parameters specify the position and size of the bar. Values should range from 0 to 1 where 0 is the left/top edge of the screen and 1 is the right/bottom edge. The Maximum parameter is the maximum value which can be applied to the progress bar, and the Value is the initial value to apply. The Label parameter is optional and allows text to be displayed over the top of the bar.

This command returns a handle to the created progress bar, to be used with the other progress bar commands.

Example:

                Function Main()
                        Player = Actor()
                        // Create a red progress bar displaying time remaining, count down 10 seconds
                        P = CreateProgressBar(Player, 255, 0, 0, 0.01, 0.48, 0.2, 0.04, 10, 10, "Time left")
                                Clicks = 10
                                .UpdateBar
                                        Clicks = Clicks - 1
                                        Delay(1000)
                                        UpdateProgressBar(Player, P, Clicks)
                                GoToIf(Clicks > 0, UpdateBar)
                        DeleteProgressBar(Player, P)
                        Return()
                End Function

Comments (0)

You don't have permission to comment on this page.