Commit Graph

19 Commits

Author SHA1 Message Date
David Capello 98f8086b04 lua: Fix Image:putSprite() when position is specified 2018-11-13 12:53:13 -03:00
David Capello dea603753b lua: Add Image:isEqual() 2018-11-13 12:52:51 -03:00
David Capello 6108d2d5ad lua: add missing get_image_from_arg() function 2018-09-13 11:53:41 -03:00
David Capello ded3b8ba77 lua: add Image:putSprite() 2018-09-13 11:50:30 -03:00
David Capello b2f83e0a90 lua: complete some app.active* set/get properties 2018-09-12 12:17:48 -03:00
David Capello 4ab94e9982 lua: add Sprite/Image.spec (ImageSpec metatable) 2018-09-11 21:52:53 -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 10d7020b23 lua: add Image:pixels(Rectangle) function 2018-09-07 18:03:33 -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
David Capello 24b28ae064 lua: use push_new instead of push_obj with move ctor 2018-09-03 18:37:45 -03:00
David Capello a107dd29a4 lua: add image iterators
In this way we can use:

    local img = Image(32, 32)
    for it in img:pixels() do
      local pixelValue = it() -- get pixel
      ...
      it(pixelValue)          -- set pixel
    end
2018-09-03 18:20:23 -03:00
David Capello f292b4b96a lua: Add Image:putImage() method 2018-08-30 23:21:44 -03:00
David Capello 17366056b6 Use a ImageObj with a ImageRef for scripts
Also added __gc/new/clone methods, and colorMode property.
2018-08-30 20:47:11 -03:00
David Capello 4fe66f2ffb Change scripting language to Lua 2018-08-22 14:54:51 -03:00
David Capello 587f697bda js: Add Site class and app.site property 2018-08-20 15:15:38 -03:00
David Capello bc300bf986 Remove Image/SpriteWrap for scripting
From now on we can share the transaction in the app::Context instead
of having the transaction in a SpriteWrap. This is useful to run
macros/scripts in a near future calling commands (and all commands
could share the same transaction).

Some changes with this:

* Added app::Context::setTransaction/transaction() methods.
* Added Tx class to create a new Transaction or use the currenet
  app::Context transaction.
* Added App.transaction() scripting method.
2018-08-20 14:20:27 -03:00
David Capello bcf7efc9bb Replace duktape with mujs
Added other classes like Rectangle, Size, and Point.
2017-08-11 17:22:28 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello 956349f87b Add Image class to scripting
With this change we introduce SpriteWrap and ImageWrap to keep track
of modifications made by the script in one transaction. So we can undo
the script action as one simple action.
2016-04-06 19:05:06 -03:00