# Fighter Factory Studio - Reference Documentation

For problems and bug report, go to VirtuallTek Game Studio web site. For doubts related to some specific engine, go to their own web pages or community forums.

# Preset system

The Preset system controls the interface of Fighter Factory. Within this sysem, all buttons, sliders, ..., are placed in the desired position.

This file is written in Lua.

Fighter Factory supports a large set of widgets and some classes to change them, as described bellow:

# Lua Enumerations

## FF.Align

FF.Left

FF.HCenter

FF.Right

FF.Top

FF.VCenter

FF.Bottom

# Lua classes

## FF.Toolbar

A toolbar that contains a set of icons that can trigger functions.

### Properties

iconSize: changes the size of icons in this toolbar.

### Functions

addButton(string): appends a button to execute the function specified by first argument. The string argument can be any action of Fighter Factory. To see all possible actions, go to Iconset.

addSeparator(): appends a separator (vertical line).

## FF.Panel

A panel that contains other widgets and has a title.

### Properties

layout: controls the panel layout (FF.Layout).

## FF.Control

A widget.

### Functions

size(int, int): changes the size of the widget (width, height).

icon(int): changes the size of the icon (for button controls).

flat(): setup button appearance to be flat, without depth.

horizontal(): set slider orientation to horizontal.

vertical(): set slider orientation to vertical.

align(int, int): appends a separator (vertical line).

## FF.Layout

Control widget alignment, size and spacing.

### Properties

spacing: manage layout's spacing between widgets.

margin: manage the margins from the edges of parent widget.

## FF.GridLayout

Control widget alignment, size and spacing in a uniform grid.

### Functions

addLayout(layout, row, column) / addLayout(layout, row, column, rowSpan, colSpan): adds another 'layout' in the grid specified by 'row', 'column'. 'rowSpan' and 'colSpan' can optionally be set to extend the item to next cells. All values are integer.

addControl(name, row, column) / addControl(name, row, column, rowSpan, colSpan): adds a control (widget) in the grid specified by 'row', 'column'. 'rowSpan' and 'colSpan' can optionally be set to extend the item to next cells. All values are integer. 'name' must be a valid control. See Controls for details.

addVerticalSpacer(row, column) / addHorizontalSpacer(row, column): adds a spacer that extends to the edge of the panel, in the direction specified by the function name. All values are integer.

## FF.VerticalLayout / FF.HorizntalLayout

Control widget alignment, size and spacing in a single direction. Each child control will fill the entire length of that direction, and will be displayed in the order they were added.

### Functions

addLayout(layout): adds another 'layout'.

addControl(name): adds a control (widget). 'name' must be a valid control. See Controls for details.

addSpacing(size): adds a blank space of 'size'.

addVerticalSpacer() / addHorizontalSpacer(): adds a spacer that extends to the edge of the panel, in the direction specified by the function name.

# Lua functions

## FF.toolBar(string)

Returns an instance of an interface toolbar, by name.

Return value: 'FF.ToolBar' class

## FF.panel(string)

Returns an instance of an interface panel (the left ones), by name.

Return value: 'FF.ToolBar' class

## FF.extraPanel(string)

Returns an instance of an interface panel (the right ones), by name.

Return value: 'FF.Panel' class

## FF.gridLayout()

Returns a new instance of FF.GridLayout. 'margin' and 'spacing' are set to 0.

Return value: 'FF.GridLayout' class

## FF.horizontalLayout()

Returns a new instance of FF.HorizontalLayout. 'margin' and 'spacing' are set to 0.

Return value: 'FF.HorizontalLayout' class

## FF.verticalLayout()

Returns a new instance of FF.VerticalLayout. 'margin' and 'spacing' are set to 0.

Return value: 'FF.VerticalLayout' class

# Controls

Any other supported interface widget, manageable by FF.Control class.

Some controls have additional functions:

Button: 'flat' and 'icon'. Buttons are treated in the same way as the toolbar ones, then you can use any action supported by toolbars as 'name' (except the ones prefixed with 'advpal').

Label: 'align'.

Slider: 'horizontal' and 'vertical'".

All supported controls are listed below, except those listed for buttons (see Iconset for more details).

Here, we will use the notation: "ctrl_name: Widget; Description".

For controls that are editor-dependent, we use a underlined ctrl_name. When the user activates one of these controls, the program will switch to the editor of the control's preffix. Eg.: 'spr_sel' will switch to the sprites editor even if used in another editor. Most of the actions listed in the Iconset section are editor-dependent.

## All engines

### Current editor

editor_new: ToolButton; New.

editor_open: ToolButton; Open.

editor_save: ToolButton; Save.

editor_saveas: ToolButton; Save as.

### Edit menu

edit_undo: ToolButton; Edit/Undo menu item.

edit_redo: ToolButton; Edit/Redo menu item.

edit_cut: ToolButton; Edit/Cut menu item.

edit_copy: ToolButton; Edit/Copy menu item.

edit_paste: ToolButton; Edit/Paste menu item.

edit_find_replace: ToolButton; Edit/Find/Replace menu item.

edit_find_replace_multi: ToolButton; Edit/Find/Replace (multi-line) menu item.

### View menu

view_left_panel: ToolButton; View/Left panel menu item.

view_right_panel: ToolButton; View/Right panel menu item.

view_organizer: ToolButton; View/Organizer menu item.

view_actions: ToolButton; View/Action list menu item.

view_calculator: ToolButton; View/Calculator menu item.

view_clipboard: ToolButton; View/Clipboard menu item.

### Tools menu

tools_pal_editor: ToolButton; Tools/Advanced Palette Editor menu item.

### Sprites editor

spr_add: ToolButton; Sprites/Add menu item.

spr_delete: ToolButton; Sprites/Delete menu item.

spr_duplicate: ToolButton; Sprites/Duplicate menu item.

spr_openimg: ToolButton; Sprites/Change image menu item.

spr_saveimg: ToolButton; Sprites/Save image changes menu item.

spr_saveimgas: ToolButton; Sprites/Save image menu item.

spr_resize: ToolButton; Sprites/Resize menu item.

spr_crop: ToolButton; Sprites/Crop menu item.

spr_split_channels: ToolButton; Sprites/Split channels menu item.

spr_import_proj: ToolButton; Sprites/Import from another project menu item.

spr_frame_spr: ToolButton; Sprites/Switch to the frame's menu item.

spr_layers_blendmode: ComboBox; Layer blend mode.

spr_layers_opacity: IntEdit; Layer opacity.

spr_layers_menu: ToolButton; Sprites/Layers menu.

spr_layers_list: ListView; List of layers.

spr_layer_add: ToolButton; Sprites/Layers/Add menu item.

spr_layer_delete: ToolButton; Sprites/Layers/Delete menu item.

spr_layer_duplicate: ToolButton; Sprites/Layers/Duplicate menu item.

spr_layer_mergevis: ToolButton; Sprites/Layers/Merge visible menu item.

spr_layer_mergeall: ToolButton; Sprites/Layers/Merge all menu item.

spr_layer_save: ToolButton; Sprites/Layers/Save as individual sprites menu item.

spr_layer_play: ToolButton; Sprites/Layers/Play menu item.

spr_view_original: ToolButton; Sprites/Image/Original menu item.

spr_image_properties: ToolButton; Sprites/Image/Properties menu item.

spr_select_all: ToolButton; Sprites/Select/All menu item.

spr_select_none: ToolButton; Sprites/Select/Deselect menu item.

spr_select_invert: ToolButton; Sprites/Select/Invert menu item.

spr_image_rotate: ToolButton; Sprites/Rotation/Rotate menu item.

spr_image_fliph: ToolButton; Sprites/Rotation/Flip horizontally menu item.

spr_image_flipv: ToolButton; Sprites/Rotation/Flip vertically menu item.

spr_sel: Slider; Current sprite selector.

spr_sel_lb: Label; Current sprite (current index / count).

spr_switch_pal: CheckBox; Auto switch to sprite's palette.

spr_prev: ToolButton; Previous sprite.

spr_next: ToolButton; Next sprite.

spr_tool_canvasmove: ToolButton; Canvas move tool.

spr_tool_selmove: ToolButton; Selection move tool.

spr_tool_rectsel: ToolButton; Rectangle selection tool.

spr_tool_freesel: ToolButton; Free selection tool.

spr_tool_magicwand: ToolButton; Magic Wand tool.

spr_tool_picker: ToolButton; Color picker tool.

spr_tool_pen: ToolButton; Pen tool.

spr_tool_eraser: ToolButton; Eraser tool.

spr_tool_remap_pen: ToolButton; Remap Pen tool.

spr_tool_paintbucket: ToolButton; Paint Bucket tool.

spr_tool_options: Widget; Tool options.

spr_foreground: Widget; Foreground color.

spr_background: Widget; Background color.

### Palettes editor

pal_clear: ToolButton; Palettes/Clear menu item.

pal_clear_unused: ToolButton; Palettes/Clear all unused menu item.

pal_add: ToolButton; Palettes/Add menu item.

pal_delete: ToolButton; Palettes/Delete menu item.

pal_delete_duplicates: ToolButton; Palettes/Remove all duplicates menu item.

pal_open: ToolButton; Palettes/Change menu item.

pal_save: ToolButton; Palettes/Save as menu item.

pal_remap: ToolButton; Palettes/Remap menu item.

pal_undo: ToolButton; Palettes/Undo menu item.

pal_redo: ToolButton; Palettes/Redo menu item.

pal_switch_color: ToolButton; Palettes/Exchange position of selected colors menu item.

pal_set_color: ToolButton; Palettes/Sets the color of the specified slot menu item.

pal_apply_sprite: ToolButton; PAlettes/Apply to the sprites menu item.

pal_sel: Slider; Current palette selector.

pal_sel_lb: Label; Current palette (current index / count).

pal_view: Palette; Palette widget.

pal_prev: ToolButton; Previous palette.

pal_next: ToolButton; Next palette.

pal_view: Palette; The palette.

### Animations editor

anim_editcode: ToolButton; Animations/Edit code menu item.

anim_code: ToolButton; Animations/Edit animation code menu item.

anim_add: ToolButton; Animations/Add code menu item.

anim_delete: ToolButton; Animations/Delete menu item.

anim_duplicate: ToolButton; Animations/Duplicate menu item.

anim_save_gif: ToolButton; Animations/Save as animated GIF menu item.

anim_play: ToolButton; Animations/Play menu item.

anim_stop: ToolButton; Animations/Stop menu item.

anim_frame_add: ToolButton; Animations/Add frame menu item.

anim_frame_delete: ToolButton; Animations/Delete frame menu item.

anim_frameall_offset: ToolButton; Animations/Apply offset to all next frames menu item.

anim_frameall_time: ToolButton; Animations/Apply time to all next frames menu item.

anim_frameall_flip: ToolButton; Animations/Apply flip to all next frames menu item.

anim_frameall_scale: ToolButton; Animations/Apply scale to all next frames menu item.

anim_frame_align: ToolButton; Animations/Alignment tool menu item.

anim_box_add_attack: ToolButton; Animations/Add attack box menu item.

anim_box_add_collision: ToolButton; Animations/Add collision box menu item.

anim_box_del: ToolButton; Animations/Delete selected contact boxes menu item.

anim_box_delall: ToolButton; Animations/Delete all contact boxes menu item.

anim_box_delall_anim: ToolButton; Animations/Delete all contact boxes of current animation menu item.

anim_box_type: ToolButton; Animations/Switch contact box type menu item.

anim_box_prev: ToolButton; Animations/Copy contact boxes of previous frame menu item.

anim_box_allinst: ToolButton; Animations/Use these contact boxes in all other instances of this frame menu item.

anim_optimize: ToolButton; Animations/Optimize menu item.

anim_export: ToolButton; Animations/Export menu item.

anim_import: ToolButton; Animations/Import menu item.

anim_import_proj: ToolButton; Animations/Import from another project menu item.

anim_sel: Slider; Current animation selector.

anim_sel_lb: Label; Current animation (current index / count).

anim_frame_lb: Label; Animation frame.

anim_frame_sel: Slider; Animation frame selector.

anim_frame_sel_lb: Label; Current frame position (current index / count - tick count).

anim_frame_xaxis_lb: Label; Frame's x axis.

anim_frame_xaxis: IntEdit; Frame's x axis.

anim_frame_yaxis_lb: Label; Frame's y axis.

anim_frame_yaxis: IntEdit; Frame's y axis.

anim_pos_left: Button; Move the frame's position 1px to the left.

anim_pos_up: Button; Move the frame's position 1px up.

anim_pos_right: Button; Move the frame's position 1px to the right.

anim_pos_down: Button; Move the frame's position 1px down.

anim_frame_time_lb: Label; Frame's time.

anim_frame_time: IntEdit; Frame's time.

anim_frame_flip_lb: Label; Frame's flip effect.

anim_frame_flip: ComboBox; Frame's flip effect.

anim_frame_loop: CheckBox; Start loop in the current frame.

anim_frame_xscale_lb: Label; Frame's x scale.

anim_frame_xscale: FloatEdit; Frame's x scale.

anim_frame_yscale_lb: Label; Frame's y scale.

anim_frame_yscale: FlotEdit; Frame's y scale.

anim_frame_angle_lb: Label; Frame's angle.

anim_frame_angle: FloatEdit; Frame's angle.

anim_onion_skin: CheckBox; OnionSkin.

anim_onion_sel: Slider; Current OnionSkin animation.

anim_onion_framesel: Slider; Current OnionSkin frame.

anim_onion_lb: Label; OnionSkin label (animation / frame).

anim_onion_find: ToolButton; OnionSkin find animation.

anim_prev_anim: ToolButton; Previous animation.

anim_next_anim: ToolButton; Next animation.

anim_prev_frame: ToolButton; Previous frame.

anim_next_frame: ToolButton; Next frame.

### Sounds editor

snd_add: ToolButton; Sound/Add menu item.

snd_delete: ToolButton; Sound/Delete menu item.

snd_duplicate: ToolButton; Sound/Duplicate menu item.

snd_open_sample: ToolButton; Sound/Change sound menu item.

snd_save_sample: ToolButton; Sound/Save sound as menu item.

snd_resample: ToolButton; Sound/Resample menu item.

snd_play: ToolButton; Sound/Play menu item.

snd_play_loop: ToolButton; Sound/Play with Loop menu item.

snd_stop: ToolButton; Sound/Stop menu item.

snd_import_proj: ToolButton; Sound/Import from another project menu item.

snd_volume: Slider; Playback volume.

snd_sel: Slider; Current sound selector.

snd_sel_lb: Label; Current sound position (current index / count).

snd_info_lb: Label; Sound information (Channels, sample rate, bit count, duration).

snd_prev: ToolButton; Previous sound.

snd_next: ToolButton; Next sound.

### Organizer

org_up: ToolButton; Move one position up.

org_down: ToolButton; Move one position down.

org_up_10: ToolButton; Move ten positions up.

org_down_10: ToolButton; Move ten positions down.

org_top: ToolButton; Move to the top.

org_bottom: ToolButton; Move to the bottom.

org_auto: ToolButton; Automatic sorting.

org_palette: ToolButton; Palette mode on organizer.

org_list: ListView; Orginizer list.

### Sprite explorer (thumbnails)

thumb_action1: ToolButton; First custom action.

thumb_action2: ToolButton; Second custom action.

thumb_action3: ToolButton; Third custom action.

thumb_action4: ToolButton; Fourth custom action.

thumb_save: ToolButton; Save selected.

thumb_view: ListView; Thumbnail container.

### Debug

debug_start: ToolButton; Debug/Continue menu item.

debug_interrupt: ToolButton; Debug/Interrupt menu item.

debug_stop: ToolButton; Debug/Stop menu item.

debug_restart: ToolButton; Debug/Restart menu item.

debug_step_over: ToolButton; Debug/Step over menu item.

debug_step_into: ToolButton; Debug/Step into menu item.

debug_step_out: ToolButton; Debug/Step out menu item.

debug_step_frame: ToolButton; Debug/Step frame menu item.

debug_variables: TreeView; Debugger variables inspection.

## M.U.G.E.N.

### Definitions editor

def_new: ToolButton; Definitions/New menu item.

def_open: ToolButton; Definitions/Open menu item.

def_save: ToolButton; Definitions/Save menu item.

def_saveas_utf8: ToolButton; Definitions/Save as UTF-8 menu item.

def_saveas: ToolButton; Definitions/Save as menu item.

def_tree: TreeView; Hierarchical list of groups in the definitions document.

### Commands editor

cmd_new: ToolButton; Commands/New menu item.

cmd_open: ToolButton; Commands/Open menu item.

cmd_save: ToolButton; Commands/Save menu item.

cmd_saveas_utf8: ToolButton; Commands/Save as UTF-8 menu item.

cmd_saveas: ToolButton; Commands/Save as menu item.

cmd_tree: TreeView; Hierarchical list of groups in the commands document.

### States editor

st_new: ToolButton; States/New menu item.

st_open: ToolButton; States/Open menu item.

st_save: ToolButton; States/Save menu item.

st_saveas_utf8: ToolButton; States/Save as UTF-8 menu item.

st_saveas: ToolButton; States/Save as menu item.

st_var_list: ToolButton; States/View variable usage list menu item.

st_var_log: ToolButton; States/Insert variable usage log menu item.

st_palfx: ToolButton; States/PalFX editor menu item.

st_offset: ToolButton; States/Offset viewer menu item.

st_throw: ToolButton; States/Throw creator menu item.

st_tree: TreeView; Hierarchical list of groups in the states document.

### Sprites editor

spr_new: ToolButton; Sprites/New menu item.

spr_open: ToolButton; Sprites/Open menu item.

spr_save: ToolButton; Sprites/Save menu item.

spr_saveas: ToolButton; Sprites/Save as menu item.

spr_saveimg_aligned: ToolButton; Sprites/Save image (aligned) menu item.

spr_delete_grp: ToolButton; Sprites/Delete group menu item.

spr_rename_grp: ToolButton; Sprites/Rename group menu item.

spr_align: ToolButton; Sprites/Alignment tool menu item.

spr_edit_img: ToolButton; Sprites/Image editor menu item.

spr_export: ToolButton; Sprites/Export menu item.

spr_import: ToolButton; Sprites/Import menu item.

spr_grp_lb: Label; Sprite group.

spr_grp: IntEdit; Sprite group.

spr_num_lb: Label; Sprite index.

spr_num: IntEdit; Sprite index.

spr_xaxis_lb: Label; Sprite x axis.

spr_xaxis: IntEdit; Sprite x axis.

spr_yaxis_lb: Label; Sprite y axis.

spr_yaxis: IntEdit; Sprite y axis.

spr_prev_grp: Button; Previous sprte group.

spr_next_grp: Button; Next sprite group.

spr_pos_left: Button; Move sprite 1px to the left.

spr_pos_up: Button; Move sprite 1px up.

spr_pos_right: Button; Move sprite 1px to the right.

spr_pos_down: Button; Move sprite 1px down.

spr_dec_load: CheckBox; Decompress sprite on load.

spr_trans_color: CheckBox; Displays the transparency color.

spr_switch_pal: CheckBox; Switch to the sprite palette.

spr_info_lb: Label; Sprite's image information (size, format and sharing).

spr_onion_skin: CheckBox; OnionSkin activation.

spr_onion_sel: Slider; Current OnionSkin sprite selector.

spr_onion_lb: Label; OnionSkin position.

spr_align_topleft: ToolButton; Align Top Left from guide lines.

spr_align_topright: ToolButton; Align Top Right from guide lines.

spr_align_bottomleft: ToolButton; Align Bottom Left from guide lines.

spr_align_bottomright: ToolButton; Align Bottom Right from guide lines.

spr_align_topcenter: ToolButton; Align Top Center from guide lines.

spr_align_bottomcenter: ToolButton; Align Bottom Center from guide lines.

spr_align_centercenter: ToolButton; Align Center Center from guide lines.

spr_align_centerleft: ToolButton; Align Center Left from guide lines.

spr_align_centerright: ToolButton; Align Center Right from guide lines.

### Palette editor

pal_switch_count: ToolButton; Palettes/Switch color count (32-256) menu item.

pal_grp_lb: Label; Palette group.

pal_grp: IntEdit; Palette group.

pal_num_lb: Label; Palette index.

pal_num: IntEdit; Palette index.

pal_prev_grp: Button; Previous group.

pal_next_grp: Button; Next group.

### Animations editor

anim_new: ToolButton; Animations/New menu item.

anim_open: ToolButton; Animations/Open menu item.

anim_save: ToolButton; Animations/Save menu item.

anim_saveas_utf8: ToolButton; Animations/Save as UTF-8 menu item.

anim_saveas: ToolButton; Animations/Save as menu item.

anim_box_default: ToolButton; Animations/Switch contact boxes to default menu item.

### Sprite explorer (thumbnails)

thumb_grp_list: ComboBox; Thumbnails sprite group.

anim_frameall_trans: ToolButton; Animations/Apply transparency to all next frames menu item.

anim_number_lb: Label; Animation number.

anim_number: IntEdit; Animation number.

anim_name_lb: Label; Animation name.

anim_name: TextEdit; Animation name.

anim_frame_grp_lb: Label; Frame's sprite group.

anim_frame_grp: IntEdit; Frame's sprite group.

anim_frame_num_lb: Label; Frame's sprite index.

anim_frame_num:IntEdit; Frame's sprite index.

anim_frame_trans_lb: Label; Frame's transparecy.

anim_frame_trans: ComboBox; Frame's transparecy type.

anim_frame_transsrc_lb: Label; Alpha source.

anim_frame_transsrc: IntEdit; Alpha source.

anim_frame_transdst_lb: Label; Alpha destination.

anim_frame_transdst: IntEdit; Alpha destination.

anim_frame_loop: CheckBox; Start loop in the current frame.

anim_frame_intp: Label; Frame interpolation.

anim_frame_intp_offset: CheckBox; Interpolate offset.

anim_frame_intp_blend: CheckBox; Interpolate blend.

anim_frame_intp_scale: CheckBox; Interpolate scale.

anim_frame_intp_angle: CheckBox; Interpolate angle.

### Sounds editor

snd_new: ToolButton; Sounds/New menu item.

snd_open: ToolButton; Sounds/Open menu item.

snd_save: ToolButton; Sounds/Save menu item.

snd_saveas: ToolButton; Sounds/Save as menu item.

snd_delete_grp: ToolButton; Sounds/Delete group menu item.

snd_rename_grp: ToolButton; Sounds/Rename group menu item.

snd_export: ToolButton; Sounds/Export menu item.

snd_import: ToolButton; Sounds/Import menu item.

snd_grp_lb: Label; Sound group.

snd_grp: IntEdit; Sound group.

snd_num_lb: Label; Sound index.

snd_num: IntEdit; Sound index.

snd_prev_grp: Button; Previous group.

snd_next_grp: Button; Next group.

### Sprite explorer (thumbnails)

thumb_grp_list: ComboBox; Sprite group list.