Version 6, last updated by wycc at Sep 29 03:46 2010 UTC

Current Inkscape extention

Please remember that The cuurent inkscape extention is still very buggy. Don't be surprise if you find any bug.

Currently, we have implemented the following functions. * Convert a SVG group into MadButterfly sprite symbol. * Convert a MadButterfly symbol into MadButterfly button. * Edit one of the normal/active/click frame inside the MadButterfly button.

Convert a SVG group into MadButterfly sprite symbol.

MadButterfly->Button->Convert to symbol

This function can assign a mbname attribute to a group element. The MadButterfly will generate symbol table for all elements which can mbname attribute. In this way, we can access the elements inside an sprite easily from the program.

Convert a MadButterfly symbol into MadButterfly button.

MadButterfly->Button->Convert to button

A button is actually a sprite with three obejcts inside it. These objects are normal/active and click frame of the object. The normal frame is displayed initially. The active frame is used when the mouse is over the object to implement a mouse over effect. The click frame is used when we press the mouse button when the mouse pointer is over the object.

A button can be used in two different way. Firstly, when we define a button in a SVG file, it will create a button on the screen automatically. In this case, we can use mb_button_get to reteurn an button object from the sprite. For example, if we defeine an button whose mbname is 'btn', we can get the button by using.

sprite_t *btn = mb_button_get(sprite,"btn");

In the other way, we can use the button as a template to create a new button by using

sprite_t *btn = mb_button_new(sprite,"btn");

Please remember to release the button by using btn->free(btn) if it is allocated by mb_button_new.

Edit one of the normal/active/click frame inside the MadButterfly button.

MadButterfly->Button->Edit Button

There are six buttons.

  • Edit Normal: Invoke a new inkscape to edit the normal frame.
  • Edit Active: Invoke a new inkscape to edit the active frame.
  • Edit Click: Invoke a new inkscape to edit the click frame.
  • Display Normal: Make the normal frame become visible.
  • Display Active: Make the normal frame become visible.
  • Display Click: Make the normal frame become visible.

These function are used to jump to the normal/active or click frame of a button. You need to select the button and then select the wanted frame by using the above procedure. Only the specified frame will be shown on the screen. You can edit it in any way. However, please don't change the group structure since the button rely on these structure to work correctly.

PS. We may implement a group locking mechanism in the inkscape to prevent users from destroying the group structure.

Scene Composer

The Scene composer extention can prepare a MadButterfly compatible SVG file which contains multiple scene in a SVG SVG file. The scene is added as meta data into the SVG files. Please refer to SVG Scene Extention for the details.