Parent Paint Library display.* Revision Release 2024.3703 Keywords imageSheetPaint See also object.fill object.stroke
An image sheet paint is a special kind of BitmapPaint used to fill/stroke an object with an image sheet frame.
It is not possible to use texture wrap modes (reference) in conjunction with image sheet frames. This is because OpenGL only supports wrap modes on entire textures, not subsections of textures.
local paint = { type = "image", sheet = , frame = }
String. String value of "image"
.
ImageSheet. An image sheet object returned by graphics.newImageSheet().
Number. The frame index from the image sheet.
(Inherits properties from Paint)
-- Set up the image sheet local options = { width = 40, height = 100, numFrames = 8, sheetContentWidth = 160, -- width of original 1x size of entire sheet sheetContentHeight = 200 -- height of original 1x size of entire sheet } local imageSheet = graphics.newImageSheet( "textures.png", options ) -- Create a vector rectangle local rect = display.newRect( 200, 200, 300, 300 ) -- Set the fill (paint) to use frame #2 from the image sheet local paint = { type = "image", sheet = imageSheet, frame = 2 } -- Fill the rectangle rect.fill = paint