A Sphere spriteset object
Наследование: IDisposable
Пример #1
0
 public FramePanel(Frame frame, Spriteset sprite, ISettings settings)
 {
     _sprite = sprite;
     _frame = frame;
     DoubleBuffered = true;
     BackgroundImage = Properties.Resources.EditAreaBG2;
     Dock = DockStyle.Left;
     _showDelay = settings.GetBoolean("spriteset-showdelay", false);
     Margin = new Padding(3);
 }
Пример #2
0
        public DirectionLayout(Spriteset sprite, Direction direction, SpritesetEditView parent)
        {
            InitializeComponent();
            NameTextBox.Text = direction.Name;
            NameLabel.Text = direction.Name;
            _sprite = sprite;
            _direction = direction;
            _parent_editor = parent;
            _showDelay = _parent_editor.Settings.GetBoolean("spriteset-showdelay", false);

            foreach (Frame f in direction.Frames) { AddImage(f); }
        }
Пример #3
0
        public SpritesetEditView(PluginMain main)
        {
            InitializeComponent();
            InitializeDocking();

            Icon = Icon.FromHandle(Properties.Resources.PersonIcon.GetHicon());
            Settings = main.Settings;

            _sprite = new Spriteset();
            DirectionAnim.Sprite = _sprite;
            FrameBaseEditor.Sprite = _sprite;
            FrameBaseEditor.Invalidate(true);
        }
Пример #4
0
        /// <summary>
        /// Takes the images of a spriteset and creates a ileset representation of it.
        /// </summary>
        /// <param name="set">The spriteset to use.</param>
        /// <returns>A tileset of the spritesets images.</returns>
        public static Tileset FromSpriteset(Spriteset set)
        {
            Tileset tileset = new Tileset();
            foreach (Bitmap image in set.Images)
                tileset.Tiles.Add(new Tile(image));

            tileset.TileWidth = set.SpriteWidth;
            tileset.TileHeight = set.SpriteHeight;

            return tileset;
        }
Пример #5
0
 /// <summary>
 /// Get an image representation of this trigger / person
 /// </summary>
 /// <param name="rootpath">The root path of the project to find the spriteset.</param>
 /// <returns>A System.Draw.Bitmap representing the entity.</returns>
 public Image GetSSImage(string rootpath)
 {
     if (Type == EntityType.Trigger) return Properties.Resources.trigger;
     using (var s = new Spriteset())
     {
         if (s.Load(rootpath + "/spritesets/" + Spriteset))
         {
             Image img = s.GetImage("south");
             if (img == null && s.Images.Count > 0) img = s.Images[0];
             if (img != null)
             {
                 return s.Images.Count == 0 ? Properties.Resources.person : new Bitmap(img);
             }
         }
         return Properties.Resources.person;
     }
 }
Пример #6
0
 /// <summary>
 /// Gets a list of sprite directions fgor this person object:
 /// </summary>
 /// <param name="rootpath">The root path to find the spriteset with.</param>
 /// <returns>A list of spriteset directions.</returns>
 public string[] GetSpriteDirections(string rootpath)
 {
     using (Spriteset s = new Spriteset())
     {
         if (s.Load(rootpath + "/spritesets/" + Spriteset))
         {
             return s.GetDirections();
         }
     }
     return null;
 }