|
Contents
|
Introduction
This build is based on Litestep 0.24.7 RC3, with the following changes:
There is only one new feature really—the ability to define images completely from the step.rc. An important side effect to this is the ability to provide color themes, without having to recreate every image in the new color. Taking advantage of the color theme features requires only slight modification to the step.rc for existing themes, but to really take advantage of it the way images are made needs to be rethought a bit. These new features are provided by Gdi+. As a side effect of moving to Gdi+, bmp, png, jpeg, tiff, gif and emf/wmf files can all be loaded. Obviously, everything that is new in this distribution calls out to be an image loading module. If and when Litestep gains this ability, I fully intend to turn this into such a module. InstallationThe easiest way to install is to overwrite the existing files in your Litestep directory with those from this distribution. Your system needs to have msvcp71.dll, msvcrt71.dll and gdiplus.dll available. If these are not available they copies should be obtained and placed into the same directory where you have installed Litestep. Gdiplus.dll, msvcp71.dll and msvcrt71.dll are available here. Due to the changes this distribution is not dependent on zlib or libpng (zlib.dll, and libpng13.dll), however do not remove zlib.dll if you are using netloadmodule (if you're using OTS2 then you are using it, however if you don't know, don't remove it). ExamplesThe examples folder contains several examples that are more hands on than this readme. xLabel AlertIf you are loading an image with ".image=" in xlabel the name of the image must contain ".png" or ".bmp" (sans quotes). This is a limitation of xlabel and likely any xmodules that can load the associated icon of arbitrary path. e.g.: MyLabelImage .image=.png_MyLabelBg ContactPlease send any comments, suggestions and bug reports to hollow1@myrealbox.com. |
An image is defined as a list of Actors in the step.rc. Each Actor is a single line that begins with *Image. There is no limit, other than available memory, for the number of Actors in any image or the number of images. All of the available Actors are described below, in the Image Definition, Drawing, Transformation, Configuration and Color Adjustment sections.
Somethings to remember when creating images:
Inside an image definition two evars are set: $ImageWidth$ and $ImageHeight$. These are set to zero outside of an image definition. Remember that the bottom right pixel is $ImageWidth-1$, $ImageHeight-1$.
There are several Global Actors that can appear outside of image definitions. These include the Prefix Actors, the Postfix Actors and reset. Reset is the only Global Actor that cannot also be used within an image definition.
Whenever an error occurs it will be added to the Litestep log. The log can be enabled in the step.rc with the LSLogLevel n and LSLogFile file directives. Check the Litestep documentation for information about these directives. All Sidestep errors log at the error log level, n=1. It is highly advised that you enable the log while creating images even if you disable after you finish development.
Sidestep errors have the general form:
The image name and a copy of the line received are appended to the error to make tracking down and correcting the error easier. Note that any evars will have been expanded in the appened line. Following are a few examples of actual errors that may be reported.
Clears the current cache of Global Actors.
When used without a parameter all global actors are cleared. This actor is only legal as a Global Actor, and cannot appear within an image definition.
Colors a pixel.
Draws a line.
This actor is affected by the current smoothing mode.
Draws a rectangle.
This actor is affected by the current smoothing mode.
Draws a closed polygon.
The polygon may intersect with itself. This actors is affected by the current smoothing mode.
Note: Polygons are currently limited to 127 sides.
Draws an ellipse.
This actor is affected by the current smoothing mode.
Draws an arc. The arc is part of an ellipse.
This actor is affected by the current smoothing mode.
Composites an image with the current image.
The optional source parameters can be used to specify a subsection of an image to composite. If any of the source coordinates are given, they all must be given.
This actor is affected by the current scaling mode.
Icons are handled properly, including Windows XP icons (32bit icons). This includes selection of a subsection of an icon to composite and smoothed scaling (when enabled).
An image may not be composited with itself or any image that contains it. The offending composites will be removed as they are found, and an error message will be posted to the Litestep log.
For example:
Writes the given text to the image
Not all font types are supported. Specifically, .fon will not work. These are limitations of Gdi+ which is used to render the text. In the event that the specifed font cannot be used the system sans serif font will be used.
Scales all subsequent actions on the image, relative to the origin.
This actor is equivalent to: *Image transform sx 0 0 sy 0 0, as such the scaling factor cannot be zero.
Rotates all subsequent actions on the image, relative to the origin.
The angle is measured from the positive x-axis rotating toward the positive y-axis. This Actor is equivalent to: *Image transform cos(angle) -sin(angle) sin(angle) cos(angle) 0 0.
Shears all subsequent actions on the image.
This actor is equivalent to: *Image transform 1 sx sy 1 0 0.
Translates all subsequent actions on the image.
This actor is equivalent to: *Image transform 1 0 0 1 dx dy.
Arbitrarily transforms all subsequent actions on the image.
When used as shown in the following example, this actor can be used to reset (to no transformation) the transformations applied to the image.
When .set is not used the transformation matrices are multiplied CN where C is the current transformation matrix and N is the matrix defined by this actor. (this is true all transformation actors.) The transformation is carried out as the following. The first two values in the resulting vector are the new x and y coordinates.
| m11 | m12 | dx | x | |||||||
| m21 | m22 | dy | y | |||||||
| 0 | 0 | 1 | 1 |
Changes the smoothing mode.
This actor is a Prefix Actor.
Changes the scaling mode.
This actor is a Prefix Actor.
Adjusts the image colors in the ARGB colorspace.
The new color will be a+da, r+dr, g+dg and b+db. If the new value for any channel is outside of 0 to 255, it will be replaced with 0 or 255 respectively.
If all parameters are 0, the actor will be ignored and a warning will be placed in the Litestep log.
This actor is a Postfix Actor.
Adjusts within the HSB colorspace.
This conversion is lossy. The internal image format uses the ARGB colorspace and conversion to HSB and back will result in a slightly different image. The saturation and brightness are clamped to 0 to 255; the hue results in a valid transformation at all times.
If all parameters are 0, the actor will be ignored and a warning will be placed in the Litestep log.
This actor is a Postfix Actor.
Adjusts the contrast of the image.
If dc is 0, the actor will be ignored and a warning will be placed in the Litestep log.
This actor is a Postfix Actor.