public void PlayAnimation(string name, Vector2 pos, Vector2 scale, float roation, string sortingLayer, int sortingOrder) { //Create a new temp sprite and add it to the active sprite list TempSprite tmp = new TempSprite(new Animation2D(_spriteList[name]), pos, scale, roation, sortingLayer, sortingOrder); _activeSprites.Add(tmp); }
public void PlayAnimation(string name, Vector2 pos, Vector2 scale) { //Create a new temp sprite and add it to the active sprite list TempSprite tmp = new TempSprite(new Animation2D(_spriteList[name]), pos, scale); _activeSprites.Add(tmp); }
private void Button_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrWhiteSpace(json) && !string.IsNullOrWhiteSpace(code.Text)) { File.WriteAllText(json, code.Text); if (sprite != null) { sprite.AnimationModule.ClearAnimations(); } } json = json_path.Text; image = sheet_path.Text; if (sprite == null) { sprite = new TempSprite(); } if (world == null) { world = new EmptyWorld(); world.Load(); world.Display(); } if (watcher == null) { WatchImageFile(image); } sprite.TexPath = image; sprite.JsonPath = json; sprite.HitboxConfigPath = hitbox_path.Text; original_texture = null; if (world.Sprites.Contains(sprite)) { world.RemoveSprite(sprite); } world.AddSprite(sprite); Screen.Camera.Z = 200; code.Text = File.ReadAllText(json); }