Skip to content
Watson Tungjunyatham edited this page Sep 28, 2016 · 7 revisions

In order to use any of the following methods, ensure that the class you're working with is an extension of StoryboardObjectGenerator. This shouldn't be a problem, since everything you're working with should be within that environment anyway, but if any these methods are supposedly missing, do check to see if this is the culprit.

Log

Saves a message to a dialog of the effect. Logs are typically used to keep better track of your variables and specific method behavior, such as debugging. It behaves like println in other programming languages.

Log(string message)

Assert

An assertion is a statement that expects a condition – if the condition is false, then the effect will fail execution and throw an exception at the offending line. You can also add a custom message to provide more details for the failure.

Assert(bool condition)
Assert(bool condition, string message)

File Loading

Storybrew also supports loading image files, called Bitmaps, or arbitrary files. These methods are instrumental in that.

Loading a Bitmap

Storybrew can load up an image file and convert it to the Bitmap class as specified in System.Drawing. For more details about the class and what can be manipulated, refer to MSDN's documentation. The supported file types are BMP, GIF, JPEG, PNG, TIFF.

Image files can be obtained from the project or mapset folder. These methods return Bitmaps, so be sure to have an appropriate variable to assign them.

GetProjectBitmap(string path)
GetMapsetBitmap(string path)

Normally, with file loading, the file must be disposed after you finish using it. However, there is no need to dispose the bitmap after you finish, as the script will do that for you.

Loading an Arbitrary File

Opens a file in read-only mode. You are responsible for disposing it.

OpenFilePath(string path)
OpenMapsetPath(string path)