In Files

Parent

TextureBrush

A TextureBrush allows shapes to be 'painted' with a multi-coloured texture that is defined by a Bitmap object.

The Bitmap will be tiled so that it can cover a shape of any size, and can optionally be scale, shifted and rotated to give the desired effect.

TextureBrushes can be used to fill any object that you might use a normal single color Brush on.

Public Class Methods

new(Bitmap) → TextureBrush click to toggle source

Defines a new TextureBrush which allows filling any closed object with the given Bitmap. If the Bitmap is too small to fit the object, it will be tiled.

# File GUI_Classes.rb, line 1457
def self.new
  #DUMMY
end

Public Instance Methods

resetTransform click to toggle source

Resets all transformations, returning the texture to its original scale, rotation and position

# File GUI_Classes.rb, line 1528
def resetTransform
  #DUMMY
end
rotateTransform(angle) click to toggle source

Rotates the bitmap texture by the given angle, which is a Float value measured in degrees.

This can be reset by calling the resetTransform method.

# File GUI_Classes.rb, line 1491
def rotateTransform
  #DUMMY
end
scaleTransform(x_scale, y_scale) click to toggle source

Scales the bitmap texture by stretching it in the X and Y dimensions. Each value should be a Float - a value of 1.0 represents the original size. The two values can be different so that the proportions of the texture can be altered.

This can be reset by calling the resetTransform method.

# File GUI_Classes.rb, line 1518
def scaleTransform
  #DUMMY
end
setWrapMode(String/Integer) click to toggle source

By default, the texture Bitmap will be tiled by simply laying copied of the image side by side - however, this can result in obvious joins between the tiles unless the Bitmap has been designed specifically for tiling.

Setting the wrap mode allows alternate tiles to be flipped either vertically, horizontally or both. This can often help to diguise the joins. or just be used as a visual effect in its own right.

The tiling mode is set by giving either an Integer index or a short String descriptor from the following list...

  • 0 or "tile" -> Normal tiling with no flipping.

  • 1 or "flipx" -> Flip alternate horizontal tiles.

  • 1 or "flipy" -> Flip alternate vertical tiles.

  • 1 or "flipxy" -> Flip horizontally and vertically.

# File GUI_Classes.rb, line 1479
def setWrapMode
  #DUMMY
end
translateTransform(x, y) click to toggle source

Shifts the tiles to reposition the texture. The x and y values are Floats giving the shift amount in each dimension in 'grid' steps.

This can be reset by calling the resetTransform method.

# File GUI_Classes.rb, line 1504
def translateTransform
  #DUMMY
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.