父级 Paint 库 display.* 修订 版本 2024.3703 关键词 imageSheetPaint 另请参阅 object.fill object.stroke
图像表单画笔是一种特殊的 BitmapPaint,用于使用 图像表单 帧填充/描边对象。
无法将**纹理环绕**模式(参考)与图像表单帧结合使用。这是因为 OpenGL 仅支持整个纹理的环绕模式,而不支持纹理的子部分。
local paint = { type = "image", sheet = , frame = }
字符串。 字符串值 "image"
。
ImageSheet。 由 graphics.newImageSheet() 返回的图像表单对象。
数字。 图像表单中的帧索引。
(继承自 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