summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Inheritance/SObject.cs
diff options
context:
space:
mode:
authorClxS <slxxls92@gmail.com>2016-03-06 23:28:32 +0000
committerClxS <slxxls92@gmail.com>2016-03-06 23:28:32 +0000
commit49090c98fcdc11ca536de42875f50b763e83ce63 (patch)
tree184c24f76dc30e4e2ea6383b58b9e33cdd5db93d /StardewModdingAPI/Inheritance/SObject.cs
parent8bf9e7409692a59c880158cf851f55da35f3022e (diff)
downloadSMAPI-49090c98fcdc11ca536de42875f50b763e83ce63.tar.gz
SMAPI-49090c98fcdc11ca536de42875f50b763e83ce63.tar.bz2
SMAPI-49090c98fcdc11ca536de42875f50b763e83ce63.zip
Fixed mod content path not being set correctly. Fixed object draw code. Custom objects can now be placed and show up correctly.
Diffstat (limited to 'StardewModdingAPI/Inheritance/SObject.cs')
-rw-r--r--StardewModdingAPI/Inheritance/SObject.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/StardewModdingAPI/Inheritance/SObject.cs b/StardewModdingAPI/Inheritance/SObject.cs
index 28254c24..3dcddb9e 100644
--- a/StardewModdingAPI/Inheritance/SObject.cs
+++ b/StardewModdingAPI/Inheritance/SObject.cs
@@ -65,17 +65,18 @@ namespace StardewModdingAPI.Inheritance
}
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1)
- {
+ {
if (Texture != null)
{
- int targSize = Game1.tileSize;
-
- Vector2 local = Game1.GlobalToLocal(Game1.viewport, new Vector2(x,y));
- Rectangle targ = new Rectangle((int)local.X, (int)local.Y, targSize, targSize);
- spriteBatch.Draw(Texture, targ, null, new Color(255, 255, 255, 255f * alpha));
+ spriteBatch.Draw(Texture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(((x * Game1.tileSize) + (Game1.tileSize / 2)) + ((this.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0)), (float)(((y * Game1.tileSize) + (Game1.tileSize / 2)) + ((this.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0)))), new Rectangle?(Game1.currentLocation.getSourceRectForObject(this.ParentSheetIndex)), (Color)(Color.White * alpha), 0f, new Vector2(8f, 8f), (this.scale.Y > 1f) ? this.getScale().Y : ((float)Game1.pixelZoom), this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.isPassable() ? ((float)this.getBoundingBox(new Vector2((float)x, (float)y)).Top) : ((float)this.getBoundingBox(new Vector2((float)x, (float)y)).Bottom)) / 10000f);
}
}
+ public void drawAsProp(SpriteBatch b)
+ {
+
+ }
+
public override void draw(SpriteBatch spriteBatch, int xNonTile, int yNonTile, float layerDepth, float alpha = 1)
{
Log.Debug("THIS DRAW FUNCTION IS NOT IMPLEMENTED I WANT TO KNOW WHERE IT IS CALLED");