From 2b879f9b7d446455cefc8f04e4fe33c110cfbd00 Mon Sep 17 00:00:00 2001 From: badlogic Date: Mon, 3 Feb 2020 14:21:36 +0100 Subject: [PATCH] [lua] Fixed wrong frame array length calculation in TransformConstraintTimeline. Updated spine-love README.md with instructions for debugging the example project with IntelliJ IDEA and EmmyLua. Closes #1611. --- spine-love/README.md | 10 ++++++++++ spine-lua/Animation.lua | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/spine-love/README.md b/spine-love/README.md index 7720ce9d2..d444fe52d 100644 --- a/spine-love/README.md +++ b/spine-love/README.md @@ -32,5 +32,15 @@ Alternatively, the `spine-lua` and `spine-love/spine-love` directories can be co * To enable two color tinting, pass `true` to `SkeletonRenderer.new()`. ## Examples +If you want to run and debug the example project, use IntelliJ IDEA with the EmmyLua plugin. + +1. Install IntelliJ IDEA and the EmmyLua plugin. +2. Install LÖVE. +3. Copy the contents of `spine-lua` to `spine-love/spine-lua`. +4. Open the `spine-love` folder in IntelliJ IDEA. +5. Create a new launch configuration of the type `Lua Application`, with the following settings + 1. `Program` should point at the `love` or `love.exe` executable, e.g. `/Applications/love.app/Contents/MacOS/love` on macOS. + 2. `Working directory` should be the `spine-love/` directory. + 3. `Parameters` should be `./` so LÖVE loads the `main.lua` file from `spine-love/`. [Simple Example](main.lua) diff --git a/spine-lua/Animation.lua b/spine-lua/Animation.lua index 8ed608df1..02c3528ae 100644 --- a/spine-lua/Animation.lua +++ b/spine-lua/Animation.lua @@ -1372,7 +1372,7 @@ function Animation.TransformConstraintTimeline.new (frameCount) local scale = 0 local shear = 0 if time >= frames[zlen(frames) - ENTRIES] then -- Time is after last frame. - local i = zlen(frames.length) + local i = zlen(frames) rotate = frames[i + PREV_ROTATE] translate = frames[i + PREV_TRANSLATE] scale = frames[i + PREV_SCALE]