Importing SVG files
Booty5 supports the import of SVG data that is exported by modern SVG editing packages such as Inkscape and Adobe Illustrator. This is useful if you have art work. game layouts, geometries or physics shapes that are in a SVG format as you can import them directly into Booty5. To import a SVG file simply drag and drop it onto the world tree or onto an existing scene within the world tree. The Booty5 game editor will import all scenes, images, brushes, shapes, geometries and actors that are defined within the SVG file.
The SVG importer will convert the following SVG objects:
- svg tag is converted to Scene and will convert attributes as shown below:
- id – This becomes scene name
- width, height – These become the scenes CanvasSize
- group tag is not used except for the layer attribute which is applied to all actors within that group and the transform
- Rects will be imported as and will convert attributes as shown below:
- id – This becomes the shapes name
- width, height – These become the shapes width and height
- label (Inkscape SVG format only) – If label is set to “circle” then the shape will imported as a circle shape with the radius set to half the width of the rect
- Images will be converted to Sprite actors which support the following attributes:
- id – This becomes the actors name
- x, y – These become Position
- width, height – These become Size
- transform – These become Position, Scale and Angle (does not support transform hierarchies)
- style.colour – This becomes Colour
- onclick – Becomes OnTapped event handler
- onmousedown – Becomes OnBeginTouch event handler
- onmouseup – Becomes OnEndTouch event handler
- onload – Becomes OnCreate event handler
- description – This is output directly within the tag, which allows you to add your own custom attributes
- Paths will be converted to shapes which support the following attributes:
- id – This becomes the geometries name
- Path commands are converted to coordinates
These features enable you to use SVG editors such as Inkscape as game layout editors to lay out levels and design complex shapes.
There are a few tips you should follow when using the likes of Inkscape to create Booty5 compatible data:
- Only single polygon shapes should be created
- All nodes are classed as vertices with no rounding and all lines are classed as straight with no control nodes
Importing Texture Packer files
TexturePacker is a tool that enables you to combine many images into a single image called a texture / sprite atlas. The advantage of using a texture atlas is that objects will be rendered faster as they can be drawn in batches by the underlying graphics hardware. The downside however is that brushes that are created from a texture atlas cannot be tiled.
To import a TexturePacker file, simply drag and drop it onto the world tree or a scene within the world tree, Booty5 will import the texture and all defined brushes.
Imported images and other resources
Dragging and dropping any other supported resources either as a single file or collection of files onto the world tree or a scene will import the resources into Booty5. Note that if resources are dragged onto a scene then the resources will become local to that scene.
NOTE: Imported images must be either 96 DPI or have no DPI information stored within the file.
3,114 total views, 1 views today