示例#1
0
        public TileSheetHelper(TileSheet tileSheet, Point? pos = null, float scale = 1f, float depth = 1f)
        {
            TileSheet = tileSheet;

              if (pos == null) pos = new Point(0, 0);
              Pos = (Point)pos;
              Scale = scale;
              Depth = depth;
        }
示例#2
0
        public TileSheetRenderJob(TileSheet tileSheet, int frame, Point? pos = null, float scale = 1f, float rotation = 0f,
			      float depth = 1f)
        {
            if (pos == null) pos = new Point(0, 0);
              TileSheet = tileSheet;
              Frame = frame;
              Pos = (Point)pos;
              Scale = scale;
              Rot = rotation;
              Depth = depth;
        }
示例#3
0
        public static TileSheet ReadFromFile(string filePath)
        {
            TileSheet res = null;

            try {
                if (File.Exists(filePath))
                {
                    string serTileSheet = File.ReadAllText(filePath);
                    res = JsonConvert.DeserializeObject <TileSheet>(serTileSheet);
                }
            } catch (Exception e) {
                System.Console.WriteLine("Exception while parsing JSON file: " + e.Message);
            }
            return(res);
        }
示例#4
0
        public static TileSheet GetTileSheetFromUser()
        {
            pln(" -- Tile Sheet --");
              TileSheet tileSheet = new TileSheet();
              pnn("TextureKey: ");
              string response = getLine();
              tileSheet.TextureKey = response;

              pnn("FrameWidth: ");
              int numResponse;
              Int32.TryParse(getLine(), out numResponse);
              tileSheet.FrameWidth = numResponse;

              pnn("FrameHeight: ");
              Int32.TryParse(getLine(), out numResponse);
              tileSheet.FrameHeight = numResponse;

              return tileSheet;
        }
示例#5
0
 public Sprite(TileSheet tileSheet, int frame)
 {
     TileSheet = tileSheet.TextureKey;
       Frame = frame;
 }
示例#6
0
 public SpriteHelper(TileSheet tileSheet, int frame, Point?pos = null, float scale = 1f, float depth = 1f)
     : base(tileSheet, pos, scale, depth)
 {
     Frame = frame;
 }
示例#7
0
        public static void WriteToFile(string outputFile, TileSheet tileSheet)
        {
            string serTileSheet = JsonConvert.SerializeObject(tileSheet, Formatting.Indented);

            File.WriteAllText(outputFile, serTileSheet);
        }
示例#8
0
 public static void WriteToFile(string outputFile, TileSheet tileSheet)
 {
     string serTileSheet = JsonConvert.SerializeObject(tileSheet, Formatting.Indented);
       File.WriteAllText(outputFile, serTileSheet);
 }
示例#9
0
 public AnimationHelper(TileSheet tileSheet, Animation animation, Point?pos = null, float scale = 1f, float depth = 1f)
     : base(tileSheet, pos, scale, depth)
 {
     Animation = animation;
 }
示例#10
0
        public AnimationState(TileSheet tileSheet, Animation animation,
			  Point? pos = null, float scale = 1f, float depth = 1f)
            : base(tileSheet, animation, pos, scale, depth)
        {
        }
示例#11
0
 public SpriteHelper(TileSheet tileSheet, int frame, Point? pos = null, float scale = 1f, float depth = 1f)
     : base(tileSheet, pos, scale, depth)
 {
     Frame = frame;
 }
示例#12
0
 public void Draw(SpriteBatch spriteBatch)
 {
     TileSheet.Draw(spriteBatch, Pos, Frame, Scale, Depth);
 }
示例#13
0
 public AnimationHelper(TileSheet tileSheet, Animation animation, Point? pos = null, float scale = 1f, float depth = 1f)
     : base(tileSheet, pos, scale, depth)
 {
     Animation = animation;
 }