Surface

From FusionWiki

Jump to: navigation, search
Surface
General Information
Author: Lukas Meller
Release Date: 2010
Status: Released
Last updated: Unknown
Version: 1.0
Build:

249

Developer-only: No
Website: Not available
Download: Direct
Runtime Versions
HWA: Yes (No support)
Flash: Yes (Limited features)
Java: No
Java Mobile: No
Vitalize!: No
Unicode: No


The Surface object is a graphical extension that allows the user to draw and modify images at runtime. It is the unofficial successor to Overlay Redux.

Contents

Main features

  • Basic drawing tools, e.g. set pixel or flood fill
  • Drawing shapes and custom polygons with color or fill data (see below)
  • Transparency via transparent colors and alpha channels
  • Switching between and adding multiple images at runtime
  • Loading images from files: AVI, BMP, GIF, JPEG, PCX, PNG, TGA
  • Saving images to files: BMP, JPEG, PNG
  • Interacting with the clipboard
  • Blitting (pasting) from or to the Surface (e.g. from an Active Object)
  • Applying adjustments (e.g. making the image brighter) easily
  • Looping through images with a callback

Fill data

Fill data is a part of MMF's programming library and utilized by many of the core objects. By drawing a shape with fill data, each pixel is given a different color which is calculated based on a formula. This formula can utilize the coordinates of the pixel, which is used for gradients. Before fill data can be used, it has to be created. Each fill data is identified by a name. The Surface object supports several types of fill data:

  • Color
    • A solid color - Much similar to the traditional drawing tools that utilize color
  • Linear gradient
    • An either horizontal or vertical gradient
  • Radial gradient
    • A circular gradient starting in the middle of the shape
  • Tiled image
    • An image (In the Surface object's local image bank) that is tiled like a Quick Backdrop

Usage

This example renders an ellipse with a radial gradient. The result is shown below.

1
  • Start of Frame
  •  : Create radial gradient fill data "fill" with colors (RGB(255,192,0),RGB(192,0,0))

     : Create color fill data "outline" with color RGB(128,0,0)

2Now that we have created the fill data, we can use it to draw the ellipse.
3
  • Start of Frame
  •  : Draw ellipse at (80,80) with size (150,150) and fill data "fill", outline 5 data "outline"

Visual examples

Since the extension has a wide range of features, many people don't know what they actually do. Here are a few examples of what can be achieved.


Flash support

The Flash version of the Surface object is rather limited. As of now, it supports:

  • "Polygons" sub-menu
  • "With color" sub-menu
  • Adding/Deleting images at runtime
  • Resize, Rotate, Reverse X/Y
  • Alpha channels
  • Partial fill data support
  • A lot of expressions and conditions
Personal tools