Skip to content

Commit

Permalink
Merge pull request #226 from SoPra18-07/#217-Graphical-Blueprints
Browse files Browse the repository at this point in the history
Buildings are now transparent while they are blueprints
  • Loading branch information
yvan674 committed Jun 27, 2018
2 parents 3bca0f3 + 79cee0e commit a357241
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Singularity/Singularity/Platform/PlatformBlank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,16 @@ public void SetmRequested(EResourceType resource, int number)
/// <inheritdoc cref="Singularity.Property.IDraw"/>
public void Draw(SpriteBatch spritebatch)
{
var transparency = mIsBlueprint ? 0.35f : 1f;

switch (mSheet)
{
case 0:
// Basic platform
spritebatch.Draw(mPlatformBaseTexture,
AbsolutePosition,
null,
Color.White,
Color.White * transparency,
0f,
Vector2.Zero,
1f,
Expand All @@ -308,7 +310,7 @@ public void Draw(SpriteBatch spritebatch)
spritebatch.Draw(mPlatformBaseTexture,
Vector2.Add(AbsolutePosition, new Vector2(-3, 73)),
null,
Color.White,
Color.White * transparency,
0f,
Vector2.Zero,
1f,
Expand All @@ -318,7 +320,7 @@ public void Draw(SpriteBatch spritebatch)
spritebatch.Draw(mPlatformSpriteSheet,
AbsolutePosition,
new Rectangle(PlatformWidth * mSheetPosition, 0, 148, 148),
Color.White,
Color.White * transparency,
0f,
Vector2.Zero,
1f,
Expand All @@ -331,7 +333,7 @@ public void Draw(SpriteBatch spritebatch)
spritebatch.Draw(mPlatformBaseTexture,
Vector2.Add(AbsolutePosition, new Vector2(-3, 82)),
null,
Color.White,
Color.White * transparency,
0f,
Vector2.Zero,
1f,
Expand All @@ -341,7 +343,7 @@ public void Draw(SpriteBatch spritebatch)
spritebatch.Draw(mPlatformSpriteSheet,
AbsolutePosition,
new Rectangle(PlatformWidth * mSheetPosition, 0, 148, 153),
Color.White,
Color.White * transparency,
0f,
Vector2.Zero,
1f,
Expand All @@ -353,7 +355,7 @@ public void Draw(SpriteBatch spritebatch)
spritebatch.Draw(mPlatformBaseTexture,
Vector2.Add(AbsolutePosition, new Vector2(-3, 38)),
null,
Color.White,
Color.White * transparency,
0f,
Vector2.Zero,
1f,
Expand All @@ -363,7 +365,7 @@ public void Draw(SpriteBatch spritebatch)
spritebatch.Draw(mPlatformSpriteSheet,
AbsolutePosition,
new Rectangle(148 * (mSheetPosition % 4), 109 * (int) Math.Floor(mSheetPosition / 4d), 148, 109),
Color.White,
Color.White * transparency,
0f,
Vector2.Zero,
1f,
Expand Down

0 comments on commit a357241

Please sign in to comment.