Rozsvěcení a zhasínání světel, sprity pro místnosti, indikátory rozsvícených světel, po konci hry je hráč vrácen do hlavního menu
This commit is contained in:
parent
25a62af483
commit
55fd052072
27 changed files with 338 additions and 113 deletions
|
|
@ -13,6 +13,7 @@ public class UIElement {
|
|||
public bool Active { get; set; } = true;
|
||||
public bool Pressable { get; set; } = false;
|
||||
public bool Visible { get; set; } = true;
|
||||
public int DrawPriority { get; } = 0;
|
||||
|
||||
protected (Point, Point) _bounds;
|
||||
public (Point, Point) Bounds{
|
||||
|
|
@ -45,14 +46,16 @@ public class UIElement {
|
|||
screenSpaceBounds = (Bounds.Item1.MultiplyByScalar(pixelScaleMultiplier), Bounds.Item2.MultiplyByScalar(pixelScaleMultiplier));
|
||||
}
|
||||
|
||||
public UIElement(TextureRegion texture, Point position) {
|
||||
public UIElement(TextureRegion texture, Point position, int drawPriority = 0) {
|
||||
Textures.Add(texture);
|
||||
Bounds = (position, position + new Point(texture.Width, texture.Height));
|
||||
DrawPriority = drawPriority;
|
||||
LoadPixelScaleMultiplier();
|
||||
}
|
||||
public UIElement(TextureRegion[] textures, Point position) {
|
||||
public UIElement(TextureRegion[] textures, Point position, int drawPriority = 0) {
|
||||
this.Textures.AddRange(textures);
|
||||
Bounds = (position, position + new Point(textures[0].Width, textures[0].Height));
|
||||
DrawPriority = drawPriority;
|
||||
LoadPixelScaleMultiplier();
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +65,7 @@ public class UIElement {
|
|||
LoadPixelScaleMultiplier();
|
||||
}
|
||||
|
||||
public void SetTexture(int textureId) {
|
||||
public virtual void SetTexture(int textureId) {
|
||||
if (textureId >= Textures.Count){
|
||||
Console.WriteLine($"WARNING: TEXTURE {textureId} OUT OF BOUNDS");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue