Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
105 lines (69 sloc) 2.41 KB


This class is used to represent the range of selected objects in the timeline.

Timeline Example

It can be:

  • A list of layers
  • A list of frames
  • A list of cels

Or a combination of those.


local type = app.range.type

Returns a RangeType.


local booleanResult = app.range.isEmpty

Returns true if the range is empty, i.e. there is no selected range in the timeline (a thick border in the timeline), only the active cel in the sprite editor.

This is the same as asking for app.range.type == RangeType.EMPTY.

Note that if the range is empty, you can still use Range.layers to get the active layer (the Range.layers property will be an array of one element, just the active layer). The same is true for Range.frame and app.activeFrame, Range.cel and app.activeCel, etc.


Sprite to which this range is pointing to.


Returns an array of selected layers.


Returns an array of selected frames.


Returns an array of selected cels.


Returns an array of selected images (images from linked cels are counted just one time in this array).


Returns an array of selected images in the range that are in unlocked layers (editable).


local selectedColors = app.range.colors
app.range.colors = { ... }

Gets or sets the array of selected palette entries in the color bar. Each element of the array is an integer (the palette index)

Example to select the colors with index 0 and 3 in the color bar:

app.range.colors = { 0, 3 }


local hasLayer = app.range:contains(layer)
local hasFrame = app.range:contains(frame)
local hasCel = app.range:contains(cel)

Returns true if the given object (layer/frame/cel) is inside the selected range.


local hasColor = app.range:containsColor(colorIndex)

Returns true if the given color index is selected in the color bar.

You can’t perform that action at this time.