Skip to content

How to: Integrate Panels

UnbelievableFlavour edited this page Sep 7, 2022 · 1 revision

Panels is an awesome library that can add comic-like cutscenes to your Cotton projects.

panels_with_cotton

  1. Download Panels from: https://github.com/cadin/panels
  2. Add Panels to your Cotton project under Source/libraries/panels.
  3. Add import "libraries/panels/Panels" to the top of your main.lua file.
  4. Wherever you want to add a cutscene, just add the following code:
local comicData = {
    { -- Sequence 1
        title = "Chapter 1",
        panels = { -- a list of PANELS for Sequence 1
            { -- Panel 1
                layers = {
                    -- list of layers for panel 1
                }
            },
            { -- Panel 2
                layers = {
                    -- list of layers for panel 2
                }
            }
        }
    },
}

function afterCutScene()
    scene.back()
end

scene.startCutScene(comicData, afterCutScene)
Clone this wiki locally