Commit Graph

25 Commits

Author SHA1 Message Date
David Capello e2024c6edd [lua] Add "properties" property to all objects with user data 2023-01-03 09:00:58 -03:00
David Capello 8f44b521b6 Merge branch 'main' into beta 2022-06-10 10:31:13 -03:00
David Capello 71d885d2a0 Replace base::clamp -> std::clamp as now we use C++17 2022-06-09 19:05:48 -03:00
David Capello 684d06ede8 Merge branch 'main' into beta 2022-05-23 18:04:55 -03:00
David Capello fd430603a0 [lua] Allow to compare different docobj types without failing (fix #3218)
Just return false if we compare a layer with a sprite, etc.
2022-05-23 17:15:15 -03:00
David Capello db44eeb269 Merge branch 'main' into beta 2021-10-12 10:45:33 -03:00
Jeremy Behreandt e0a747cad7 Expose Layer Is Reference
Exposes a getter for layer is reference in the Lua scripting API.
2021-10-06 14:04:54 -05:00
David Capello a10efb187b Merge branch 'master' into tilemap-editor 2020-06-01 16:21:32 -03:00
David Capello 0fc4989419 [lua] Fix crash when setting layer.parent to nil 2020-05-28 15:12:26 -03:00
David Capello 896387635b [lua] Fail if we give an invalid parent to layer.parent setter 2020-05-28 14:24:10 -03:00
David Capello 26139c4ae2 Add tilemap layers (#977)
This is the first commit with a simple tilemap editor. Still buggy but
functional in several ways. Several changes were made:

* NewLayer command can receive a tilemap=true to create a new tilemap
  layer
* New ToggleTilesMode command added to switch between the palette and
  the tileset in the ColorBar (the ColorBar was expanded to show
  colors or tilesets with a generic AbstractPaletteViewAdapter)
* All commands to create new layers were moved to Layer >
  New... submenu
* There are a new tileset chunk to save tilesets in .aseprite files,
  and a new kind of cels to save tilemaps
* Added doc::LayerTilemap, doc::Tileset, etc. and several other types
  to handle tilesets/tilemaps in the doc layer.
* Added doc::Grid class with grid specifications that indicates how a
  tilemap <-> tileset must be drawn
* Added and expanded cel operations to work with tilemaps and
  conversions between regular LayerImage cels <-> LayerTilemap cels
  (e.g. copy cels in the timeline between layer types)
2020-02-17 09:06:00 -03:00
David Capello 48c4e49d67 Fix Layer.stackIndex setter when we use a stackIndex greater than the current one 2019-11-29 11:08:18 -03:00
David Capello 75c127872b [lua] Add several properties to handle layer groups (fix aseprite/api#16)
New properties to manage groups/sublayers:
* Layer.layers: property to access sublayers of a group
* Layer.stackIndex: property with the index of the layer in the list
  of layers
* Layer.parent setter: to move the layer to other group
2019-08-27 19:57:49 -03:00
David Capello 0a558aabcf lua: Add Layer:cel() function 2018-12-06 12:31:46 -03:00
David Capello bf916fe029 lua: Add Range and RangeType 2018-11-23 13:10:12 -03:00
David Capello 34d1906034 lua: use ObjectId to refer doc objects from script variables
This should fix several crashes using objects in invalid ways where
the object doesn't exist anymore (e.g. an undo deleted referenced
objects in scripts).
2018-11-20 18:12:43 -03:00
David Capello 5b6c35aa86 lua: add Layer.parent/previous/next properties 2018-09-18 09:36:42 -03:00
David Capello a138f2bce6 lua: add more properties to Layer metatable 2018-09-18 00:21:40 -03:00
David Capello 03c663da21 lua: add functions to create layers/frames/cels/tags/slices
Some extra additions:
* Layer.cels
* AniDir constants
* Slice property setters
* Tag.sprite
* Fixed frame numbers in Tag properties
2018-09-11 18:29:15 -03:00
David Capello 0b72249fcd lua: add BlendMode constants 2018-09-10 15:11:59 -03:00
David Capello 240a83b7a0 lua: add Layer.isTransparent/isBackground 2018-09-06 13:02:50 -03:00
David Capello eb946438f5 lua: add __eq to some other metatables 2018-09-05 09:41:44 -03:00
David Capello 4a143cb902 lua: move user data fields to each class 2018-09-05 09:22:59 -03:00
David Capello 8ba664e306 lua: add Layer.isImage/isGroup properties 2018-09-04 17:30:18 -03:00
David Capello f456f3cba3 lua: Initial support for sprite properties
Frames, Palettes/Color, Layers, Cels, Tags, Slices, etc.
2018-09-04 16:10:32 -03:00