Image.transformBlitMask

From Spheriki

Jump to: navigation, search

Draw the image into the video buffer by giving the corner locations clockwise, and tinting the result with a color.


Usage

image.transformBlitMask(x1, y1, x2, y2, x3, y3, x4, y4, mask);
  • image Sphere Image object. The image to draw transformed.
  • x1, y1 Numbers. The coordinates on the screen where the upper-left corner of the image should be.
  • x2, y2 Numbers. The coordinates on the screen where the upper-right corner of the image should be.
  • x3, y3 Numbers. The coordinates on the screen where the lower-right corner of the image should be.
  • x4, y4 Numbers. The coordinates on the screen where the lower-left corner of the image should be.
  • mask Sphere Color object. The color which is applied as the mask.


Examples

var Image = LoadImage("Arrow.png");
var White = CreateColor(255, 255, 255);

function TransformImage()
{
  Image.transformBlitMask(10,1, 20,5, 20,10, 10,10, White);
  FlipScreen();
  while (!IsKeyPressed(KEY_Z)) {
    // Wait for 'z' to be pressed.
  }
}

The above example demonstrates the basic principle behind the Image.transformBlitMask(). An image is loaded, and a color is created. The image is then blitted onto the screen using the coordinates of the function, with the color that was created as a mask over the image.


See also

Personal tools