urMus - Audio and Media Interactions and Interfaces on Mobile Phones


urMus

API Documentation

Texture API

These functions are member functions of a created texture.

Texture:SetTexture

Synopsis

texture:SetTexture("imageName.ext")
texture:SetTexture(r,g,b,a)

Description

Sets the texture style for a given texture. If colors are specified a plain color empty texture will be assumed and existing textures will be removed.

Arguments

Texture:SetGradientColor

Synopsis

texture:SetGradientColor("orientation", minR, minG, minB, minA, maxR, maxG, maxB, maxA)

Description

Sets the texture to be a linear gradient in the given orientation. The texture will start at minRGBA and end at maxRGBA, with the linear interpolation between.

Arguments

Texture:SetSolidColor

Synopsis

texture:SetSolidColor(r,g,b[,a])

Description

Sets the color of a texture to a solid color specified by the RGBA values.

Arguments

Texture:SolidColor

Synopsis

r, g, b, a = texture:SolidColor()

Returns

Texture:SetTexCoord

Synopsis

texture:SetTexCoord(left%,right%,top%,bottom%)
texture:SetTexCoord(ULx%, ULy%, URx%, URy%, BLx%, BLy%, BRx%, BRy%)

Description

Sets the texture coordinates for a given shape. If the first form is specified, the texture will be place in a rectangular space specified by [left%, right%, top%, bottom%]. Otherwise it will be placed within a polygon give by the second form.

Arguments

Texture:TexCoord

Synopsis

ULx%, ULy%, URx%, URy%, BLx%, BLy%, BRx%, BRy% = texture:TexCoord()

Description

The coordinates of the texture. Defaults to (0,1,1,1,0,0,1,0)

Returns

Texture:SetTiling

Synopsis

SetTiling(tile)

Description

Set whether or not textures are tiled if the texture coordinate are below 0 and above 1.

Arguments

Texture:Tiling

Synopsis

tile = Tiling()

Description

Returns if the texture is current being tiled if the texture coordiates are below 0 and above 1.

Returns

Texture:SetRotation

Synopsis

texture:SetRotation(angle)

Description

Rotates the texture. This modifies the texture coordinates.

Arguments

Texture:BlendMode

Synopsis

mode = texture:BlendMode()

Returns

Texture:SetBlendMode

Synopsis

texture:SetBlendMode(mode)

Description

Sets the blend mode for this texture. Defaults to "DISABLED".

Arguments

Texture:Point

Synopsis

texture:Point(x,y)

Description

Draws a point at [x,y]. If Region:UseAsBrush() is enabled, it uses the texture of that region as brush, else it draws a point of width set by Texture:SetBrushSize().

Arguments

Texture:Line

Synopsis

texture:Line(startX, startY, endX, endY)

Description

Draws a line of width set by SetBrushSize() from [startX,startY] to [endX,endY].

Arguments

Texture:Ellipse

Synopsis

texture:Ellipse(centerX, centerY. width, height)

Description

Draws an ellipse at position [centerX,centerY] with a [width] and [height] into the current texture. If Region:UseAsBrush() is enabled, it uses the texture of that region as brush, else it draws a line of width set by Texture:SetBrushSize().

Arguments

Texture:Quad

Synopsis

texture:Quad(x1,y1,x2,y2,x3,y3,x4,y4)

Description

Draws a closed quadrangle with corners [x1,y1], [x2,y2], [x3,y3], [x4,y4] into the current texture. If Region:UseASBrush() is enabled, it uses the teture of that region as brush, else it draws a line of width set by Texture:SertBrushSize().

Arguments

Texture:Rect

Synopsis

texture:Rect(x,y,width ,height)

Description

Draws a closed rectangle at position [x,y], with [width] and [height] into the current texture. If Region:UseASBrush() is enabled, it uses the teture of that region as brush, else it draws a line of width set by Texture:SertBrushSize().

Arguments

Texture:SetFill

Synopsis

texture:SetFill(fill)

Description

Set if a close line drawing such as Quad, Rect or Ellipse is filled or not.

Arguments

Texture:Clear

Synopsis

texture:Clear()

Description

If the region is enabled with Region:UseAsBrush(), clears any brush strokes currently on the texture.

Texture:BrushSize

Synopsis

brushSizePx = texture:BrushSize()

Description

Returns the current width of the brush used to draw with drawing functions such as Point, Line, Ellipse, Quad and Rect.

Returns

Texture:SetBrushSize

Synopsis

texture:SetBrushSize(brushSizePx)

Description

Sets the width of the brush to be used by drawing functions such as Point, Line, Ellipse, Quad and Rect. Affects both texture brushes set with region:UseAsBrush() and pixel brushes.

Arguments

Texture:SetBrushColor

Synopsis

texture:SetBrushColor(r,g,b,a)

Description

Sets the color of the brush used for drawing functions such as Point, Line, Ellipse, Quad and Rect. Affects both texture brushes set with region:UseAsBrush() and pixel brushes.

Arguments

Texture:UseCamera

Synopsis

texture:UseCamera()

Description

Uses the live camera image of the currently active camera as texture.

Texture:PixelColor

Synopsis

r,g,b,a = texture:PixelColor(x,y)

Description

Reads the pixel color and alpha value at texture coordinate x and y within a texture.

Returns

urMus API Overview