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; }
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; }
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); }
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; }
public Sprite(TileSheet tileSheet, int frame) { TileSheet = tileSheet.TextureKey; Frame = frame; }
public SpriteHelper(TileSheet tileSheet, int frame, Point?pos = null, float scale = 1f, float depth = 1f) : base(tileSheet, pos, scale, depth) { Frame = frame; }
public static void WriteToFile(string outputFile, TileSheet tileSheet) { string serTileSheet = JsonConvert.SerializeObject(tileSheet, Formatting.Indented); File.WriteAllText(outputFile, serTileSheet); }
public AnimationHelper(TileSheet tileSheet, Animation animation, Point?pos = null, float scale = 1f, float depth = 1f) : base(tileSheet, pos, scale, depth) { Animation = animation; }
public AnimationState(TileSheet tileSheet, Animation animation, Point? pos = null, float scale = 1f, float depth = 1f) : base(tileSheet, animation, pos, scale, depth) { }
public SpriteHelper(TileSheet tileSheet, int frame, Point? pos = null, float scale = 1f, float depth = 1f) : base(tileSheet, pos, scale, depth) { Frame = frame; }
public void Draw(SpriteBatch spriteBatch) { TileSheet.Draw(spriteBatch, Pos, Frame, Scale, Depth); }
public AnimationHelper(TileSheet tileSheet, Animation animation, Point? pos = null, float scale = 1f, float depth = 1f) : base(tileSheet, pos, scale, depth) { Animation = animation; }