1 using Microsoft.Xna.Framework;
2 using Microsoft.Xna.Framework.Graphics;
4 using System.Collections.Generic;
5 using System.Collections.Immutable;
9 partial class StructurePrefab : MapEntityPrefab
26 Rectangle newRect =
new Rectangle((
int)position.X, (
int)position.Y, (
int)size.X, (
int)size.Y);
34 newRect.X = (int)position.X;
35 newRect.Y = (
int)position.Y;
39 Vector2 placeSize = size;
80 newRect.X = (int)position.X;
81 newRect.Y = (
int)position.Y;
97 public override void DrawPlacing(SpriteBatch spriteBatch, Rectangle placeRect,
float scale = 1.0f,
float rotation = 0.0f, SpriteEffects spriteEffects = SpriteEffects.None)
99 var position = placeRect.Location.ToVector2().FlipY();
100 position += placeRect.Size.ToVector2() * 0.5f;
105 placeRect.Size.ToVector2(),
106 color: Color.White * 0.8f,
107 origin: placeRect.Size.ToVector2() * 0.5f,
static int GraphicsHeight
static Vector2 placePosition
static MapEntityPrefab Selected
void DrawTiled(ISpriteBatch spriteBatch, Vector2 position, Vector2 targetSize, float rotation=0f, Vector2? origin=null, Color? color=null, Vector2? startOffset=null, Vector2? textureScale=null, float? depth=null, SpriteEffects? spriteEffects=null)
readonly ImmutableDictionary< int, ImmutableArray< DecorativeSprite > > DecorativeSpriteGroups
override void UpdatePlacing(Camera cam)
readonly ImmutableArray< DecorativeSprite > DecorativeSprites
override void DrawPlacing(SpriteBatch spriteBatch, Rectangle placeRect, float scale=1.0f, float rotation=0.0f, SpriteEffects spriteEffects=SpriteEffects.None)
readonly Color BackgroundSpriteColor
override void DrawPlacing(SpriteBatch spriteBatch, Camera cam)
static void StoreCommand(Command command)
static Vector2 MouseToWorldGrid(Camera cam, Submarine sub, Vector2? mousePos=null, bool round=false)
static readonly Vector2 GridSize
static Rectangle AbsRect(Vector2 pos, Vector2 size)
override Vector2? Position