Table of Contents

Shape:setFillStyle

Available since version: Gideros 2011.6

Description:

Sets the fill style that Shape object uses for subsequent drawings. The fill style remains in effect until you call setFillStyle() function with different
parameters.
type parameter can be one of the following values:

  • **Shape.NONE:** Clears the fill style.

  • **Shape.SOLID:** Sets the fill style as a solid color. In this mode, the parameters are color (in hexedecial value) and an optional alpha value.

  • **Shape.TEXTURE:** Sets the fill style as a textured. In this mode, the parameters are texture and an optional transformation matrix.


See the following example for more detailed usage of this function.

Syntax:

Shape:setFillStyle(type, ...)

Parameters:

  • type: (string) The type of the fill. Can be one of the Shape.NONE, Shape.SOLID or Shape.TEXTURE.
  • ...: Parameters of the fill style.

Examples:

setFillStyle(Shape.NONE)						-- clears the fill style

setFillStyle(Shape.SOLID, 0xff0000)				-- sets the fill style as solid red color

setFillStyle(Shape.SOLID, 0xff0000, 0.5)		-- sets the fill style as solid red color with 0.5 transparency

local texture = Texture.new("image.png")
setFillStyle(Shape.TEXTURE, texture)			-- sets the fill style as texture with "image.png"

local matrix = Matrix.new(0.5, 0, 0, 0.5, 0, 0)
setFillStyle(Shape.TEXTURE, texture, matrix)	-- sets the fill style as texture with "image.png" with a transformation matrix