Bars
Info
Dependencies:
- PermMem
- View
Implementation:
Bars.d on GitHub
This package makes it very easy to add new bars, for e.g. stamina.
Initialization
Initialize with LeGo_Bars
flag.
Functions
Note
If the GothicBar
prototype is selected as the initial type (GothicBar@
as the constructor), the user's own bars are visually indistinguishable from those used in Gothic.
Bar_Create
Bar_Create
Creates a new bar from a constructor instance.
Parameters
var int inst
Constructor instance ofBar
class
Return value
The function returns the address of the new bar, aka the handle.
Examples
var int bar; bar = Bar_Create(GothicBar@);
Bar_Delete
Bar_Delete
Deletes a bar from the screen and from memory.
Parameters
var int bar
Handle returned fromBar_Create
Bar_SetMax
Bar_SetMax
Changes a bar's maximum value but does not update its bar length (only Bar_SetPercent
, Bar_SetPromille
and Bar_SetValue
)
-
var int bar
Handle returned fromBar_Create
-
var int max
New maximum value
Bar_SetValue
Bar_SetValue
Sets the value of the bar.
var int bar
Handle returned fromBar_Create
var int val
New value of the bar
Bar_SetPercent
Bar_SetPercent
Sets the value of the bar but as a percentage (0..100).
var int bar
Handle returned fromBar_Create
var int perc
New value of the bar in percent
Bar_SetPromille
Bar_SetPromille
Sets the value of the bar but per mille (0..1000).
var int bar
Handle returned fromBar_Create
var int pro
New value of the bar in per mille
Bar_Hide
Bar_Hide
Hides a bar. It will not be deleted.
var int bar
Handle returned fromBar_Create
Bar_Show
Bar_Show
Displays a bar again after using Bar_Hide
.
var int bar
Handle returned fromBar_Create
Bar_MoveTo
Bar_MoveTo
Move the bar to virtual position.
var int bar
Handle returned fromBar_Create
var int x
New horizontal position in virtual coordinatesvar int y
New vertical position in virtual coordinates
Bar_MoveToPxl
Bar_MoveToPxl
Move the bar to pixel position.
var int bar
Handle returned fromBar_Create
var int x
New horizontal position in pixelsvar int y
New vertical position in pixels
Bar_SetAlpha
Bar_SetAlpha
Sets the transparency of the bar.
var int bar
Handle returned fromBar_Create
var int alpha
Transparency value (0..255)
Bar_SetBarTexture
Bar_SetBarTexture
Sets the foreground texture of the bar.
var int bar
Handle returned fromBar_Create
var string barTex
The new foreground texture
Bar_SetBackTexture
Bar_SetBackTexture
Sets the background texture of the bar.
var int bar
Handle returned fromBar_Create
var string backTex
The new background texture
Bar_Resize
Bar_Resize
Resize an existing bar.
var int bar
Handle returned fromBar_Create
var int width
New width in virtual coordinatesvar int height
New height in virtual coordinates
Bar_ResizePxl
Bar_ResizePxl
Resize existing bar (in pixels).
var int bar
Handle returned fromBar_Create
var int x
New width in pixelsvar int y
New height in pixels
Examples
Note
The bars assume a certain basic understanding of the PermMem module.
A dedicated experience bar
Bars implement the Bar
class. It looks like this:
GothicBar
prototype is a bar, which mimics the standard Gothic status bar. It is much easier to set up a new instance using this prototype. GothicBar
without modifications can be found as the GothicBar@
instance, which we used to create the bar in the example above. GothicBar
is located in the middle of the screen and looks exactly like the Gothic underwater bar.
Note
This is translation of article originally written by Gottfried and Lehona and hosted on LeGo's official documentation website.