Corgi Engine  v8.8
MoreMountains.CorgiEngine.HeartsGUI Class Reference

Add this class to a GUI object, and it'll handle the instantiation and management of hearts based on the current lives of the player character It's best used on a HorizontalLayoutGroup that will handle correct positioning natively More...

Inheritance diagram for MoreMountains.CorgiEngine.HeartsGUI:
MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Attributes

Sprite HeartFull
 the sprite to use when the heart is full More...
 
Sprite HeartEmpty
 the sprite to use when the heart is empty More...
 
Vector2 HeartSize = new Vector2(50,50)
 the size of the heart to display More...
 
int HeartProvision = 10
 the number of hearts to provision (if you know you'll never have more than, say, 5 hearts in your game, set it to 5. More...
 

Protected Member Functions

virtual void Start ()
 On Start we initialize our hearts More...
 
virtual void Initialization ()
 On Init we draw all our provision hearts More...
 
virtual void DrawHearts ()
 Draws as many hearts as provisioned More...
 
virtual void Update ()
 On Update we'll keep our hearts updated More...
 
virtual void UpdateHearts ()
 Every frame we make sure all our hearts are in the desired state More...
 

Protected Attributes

List< Image > Hearts
 

Detailed Description

Add this class to a GUI object, and it'll handle the instantiation and management of hearts based on the current lives of the player character It's best used on a HorizontalLayoutGroup that will handle correct positioning natively

Member Function Documentation

◆ DrawHearts()

virtual void MoreMountains.CorgiEngine.HeartsGUI.DrawHearts ( )
protectedvirtual

Draws as many hearts as provisioned

◆ Initialization()

virtual void MoreMountains.CorgiEngine.HeartsGUI.Initialization ( )
protectedvirtual

On Init we draw all our provision hearts

◆ Start()

virtual void MoreMountains.CorgiEngine.HeartsGUI.Start ( )
protectedvirtual

On Start we initialize our hearts

◆ Update()

virtual void MoreMountains.CorgiEngine.HeartsGUI.Update ( )
protectedvirtual

On Update we'll keep our hearts updated

◆ UpdateHearts()

virtual void MoreMountains.CorgiEngine.HeartsGUI.UpdateHearts ( )
protectedvirtual

Every frame we make sure all our hearts are in the desired state

Member Data Documentation

◆ HeartEmpty

Sprite MoreMountains.CorgiEngine.HeartsGUI.HeartEmpty

the sprite to use when the heart is empty

◆ HeartFull

Sprite MoreMountains.CorgiEngine.HeartsGUI.HeartFull

the sprite to use when the heart is full

◆ HeartProvision

int MoreMountains.CorgiEngine.HeartsGUI.HeartProvision = 10

the number of hearts to provision (if you know you'll never have more than, say, 5 hearts in your game, set it to 5.

◆ Hearts

List<Image> MoreMountains.CorgiEngine.HeartsGUI.Hearts
protected

◆ HeartSize

Vector2 MoreMountains.CorgiEngine.HeartsGUI.HeartSize = new Vector2(50,50)

the size of the heart to display


The documentation for this class was generated from the following file: