:::: MENU ::::

GameStudioHx

Genuine experience in making cross-platform games

Documentation

System requirements

GameStudioHx should run on WindowsXP, Windows Vista, Windows 7 and Windows 8.
Linux version coming soon. Mac version will come when I get a Mac :)

General information

GameStudioHx was inspired by Adobe Photoshop, Illustrator, Flash and After Effects and by Unity3D. Great effort was made to make this software and its workflow as similar as possible to these applications. You’ll find GameStudioHx easy and intuitive to work with.
GameStudioHx creates projects in “USER/Documents/GameStudioHx Project” folder on Windows machines. For each project GSHx creates a folder with projects name.
The structure of project is essentially the same as the structure of OpenFL project with some additional files.

projectstructure
Structure of a project

You can recognize files/folder from OpenFL project structure. You can also recognize “.hxproj” file which is FlashDevelop project file.
“.gsproj” is GameStudioHx project file which holds basic info about your project, like project name, short description of a project, author name and date when project was created. It is also used by GSHx to identify folder as GSHx project folder.

For each game level in your project/game, a screenshot is created every time when you save your work. It is used to show you level preview in “Open Project” dialog. Screenshots created manually by the user are also placed in root directory of a project.
Additional folder/files can be created in root directory of a project during project development. For example, folder named “SVG_export” will be created in projects root folder when user exports level to .svg format, folder “brushes” will be created in “assets/img/” folder when user creates spritesheet for brush etc…

Top tool bar

toptoolbar

From left to right:

1. Rectangle drawing tool. Regular rectangle and rounded rectangle are available. Right-click on button to bring up selection popup.
Press and hold left mouse button and move mouse around to draw a rectangle. Releasing left mouse button will finish drawing and will crate an object.
With rounded rectangle, while drawing, press and hold CTRL key on your keyboard and then scroll your mouse wheel to increase/decrease roundness of the corners (in effect, this will increase/decrease number of points that define curve of the corner)

2. Circle drawing tool. Press and hold left mouse button and move mouse around to draw a circle. Releasing left mouse button will finish drawing and will crate an object.

3. Ellipse drawing tool. Press and hold left mouse button and move mouse around to draw an ellipse. With your left mouse button pressed, scroll your mouse to increase/decrease resolution of an object (this will increase or decrease number of points that define ellipse. More points will make smoother ellipse). Releasing left mouse button will finish drawing and will crate an object.

4. Gear/Cog drawing tool. Press and hold left mouse button and move mouse around to draw a cog. With your left mouse button pressed, scroll your mouse to increase/decrease number of teeth in cog. Releasing left mouse button will finish drawing and will crate an object.

5. Star drawing tool. Regular and rounded stars are available. Right-click on button to bring up selection popup.
Press and hold left mouse button and move mouse around to draw a star. Releasing left mouse button will finish drawing and will crate an object.
With rounded star, while drawing, press and hold CTRL key on your keyboard and then scroll your mouse wheel to increase/decrease roundness of the corners (in effect, this will increase/decrease number of points that define curve of the corner)

6. Regular Polygon drawing tool. Regular and rounded polygons are available. Right-click on button to bring up selection popup.
Press and hold left mouse button and move mouse around to draw a polygon. Releasing left mouse button will finish drawing and will crate an object.
With rounded polygon, while drawing, press and hold CTRL key on your keyboard and then scroll your mouse wheel to increase/decrease roundness of the corners (in effect, this will increase/decrease number of points that define curve of the corner)

7. CatmullRom Spline drawing tool. Click anywhere in drawing surface to create first control point of the spline. Then create as many additional points as you need. Finally, to finish drawing and create an objects, click on first control point (red one).
Self intersecting shapes are not allowed.

8. Polygon from points drawing tool. Drawing method is the same as for CatmullRom Spline. Restriction on self intersection apply here too.

9. Free hand drawing tool. Press and hold left mouse button to create first control point. With your left mouse button pressed, move your mouse around to draw a shape. Finally, to finish drawing and create an objects, release left mouse button and click on first control point (red one). Drawing method of CatmullRom spline can be used here too. Restriction on self intersection apply here too.

10. Chain drawing tool
TODO

Note: Depending on active object group, drawing tools will create different types of objects. When used in “Physics” object group, object drawing tools will create physical objects. In any other group, “GFX” objects will be created.

11. Image import button. GameStudioHx recognizes .PNG, .JPG, .BMP, .TGA, .SVG, .PSD formats. PSD file support is VERY LIMITED, all layers have to be fully rasterized for “PSD import” to work. .BMP and .TGA files are converted to .PNG format for final use. .SVG is rasterized and and saved to .PNG format for final use.
Depending on active object group, different object types are created from imported bitmaps. If bitmap is imported into “Physics” object group, GameStudio will create “body from bitmap” which means that polygon will be created based on contours of imported bitmap. This method usually creates very large number of points in polygon. You can “Enable automatic points number reduction” in GameStudio properties to auto optimize object, but you can also do this manually.
If bitmap is imported in any other group, simple GFX object will be created.

12. Import particles button. Particles can be imported in any object group except in “Physics” group (but can be imported as InnerGFX of existing physical objects). Clicking the button will bring up “Particles designer”. You can select one of existing templates and modify it to suit your needs. Clicking “ADD PARTICLES” button will import your design in active object group. You can also save your design as a “.plist” file and use it elsewhere. You can add your own bitmaps for particles to “assets/particles/” folder of your GameStudioHx copy.

13. Import animation button. Animations can be imported in any object group except in “Physics” group (but can be imported as InnerGFX of existing physical objects). Clicking the button will bring up “Animation browser” dialog from which you can select spritesheet animation to import. You can create spritesheet animations using GameStudio built in “Texture packer”.

14. Import shape button. The idea behind the “Shape library” is that you can have your own library of shapes that you can use in every project you create. “Shape library” is simple collection of .SVG files that GameStudio will import to your game as “GFX” or physical object, depending on active object group.
Those are regular .SVG files which can be created by applications like Adobe Illustrator, Inkscape or any other vector editing app. When “Physics” object group is active, you can select physical type for the object that will be created.
You can also save any object that you’ve created with any of GameStudio “drawing tools” to your shape library by selecting an object and selecting “Save to shape library” option from “Object” menu (only “Stroke” and “Color overlay” will be saved from objects FX !)

15. Create Pivot Joint tool. Available only in “Physics” object group.
TODO

16. Create Motor Joint tool. Available only in “Physics” object group.
TODO

17. Create Distance Joint tool. Available only in “Physics” object group.
TODO

18. Create Weld Joint tool. Available only in “Physics” object group.
TODO

19. Create Line Joint tool. Available only in “Physics” object group.
TODO

20. Play/Pause button. Starts or pauses game simulation.

21. Stop/Reset button. Stops game simulation and resets current level. Returns GameStudio to editing mode.

22. Build project button. Builds your game for platform selected in dropdown list on the right. To be able to build game from GameStudio, you must have Haxe, OpenFl, Nape and Tilelayer library installed on your system.

23. Toggle fullscreen button. On the far right is the button you can use to switch fullscreen mode on and off.

Left tool bar

TODO

Bottom tool bar

bottomtoolbar

From left to right:

1. infosmall Toggle Object info window button. Info window shows basic info about selected object, like objects ID, type, objects depth or zIndex, x and y position in space, objects bounding box width and height, number of joints of that object and number of points in objects polygon.

2. history Toggle History window button. In history window you can steps you’ve made so far in design process. Number of history steps is configurable via GameStudio properties.

3. zoomactual Reset Zoom level button. Quickly reset zoom level to 100% by clicking this button.

4. gravity Toggle gravity dialog button. In gravity dialog you can set the gravity for the current level.

5. gamecode Toggle game code editor. Code editor is very basic and limited. It is recommended that you use FlashDevelop project file that is generated by GameStudio in your projects folder and code your game in it (or any other code editor).

6. script Toggle script/extensions library button. You can access GameStudioHx scripts/extensions via “Scripts library” dialog. Compiled (binary) scripts will looked up first and executed if found.

7. btncamera Attach/detach camera to selected object. Select an object and attach camera to it by pressing this button. Same can be achieved by going to “Camera” menu and selecting “Attach to object …” option.

8. music Toggle level music dialog. You can preview and set background music for active level via “Set level background music” dialog. All music files you’ve placed in your projects “assets/sound” folder will be listed in this dialog.

9. screenshot Save screenshot button. You can create screenshot of your game by clicking this button. You can create screenshot while your game is running too. Same can be achieved by going to “Level” menu and selecting “Screenshot” option, or via keyboard shortcut -> “Print Scr”.

10. stylesbuffer Toggle styles buffer button. “Styles buffer” window has 10 free slots to hold 10 different object styles. You can fill these slots by selecting an object which style you want to copy. Then, click on little “arrow” button. This will show “target” icon above each slot. Now you can assign style of selected object to any of these slots by clicking on them. If slot wasn’t empty, it will be overwritten by new style.
To set style from any of these slots to an object, select that object and then click on the slot with desired style to copy its style to that object.

11. objectbuffer Toggle objects buffer button. “Objects buffer” is similar to “Styles buffer”. The difference is that “Objects buffer” hold definition of entire objects instead only of their styles. Whenever you copy an object (via right click menu, via “Object->Copy” action or via keyboard shortcut “CTRL+C”) that copy goes to “default Objects buffer slot” (located at the bottom of “Objects buffer” window). While “default slot” is selected (its marked with red outline), clicking “arrow” button will show target icons above all slots. To copy “default slot” content to any other slot, simply click on that slot.
When you “paste” an object to your game level, object definition from currently active slot is used to create a copy of that object. You can activate any slot at any time simply by clicking on desired slot.

12. polyclip Mark object for clipping button. It will mark selected object for clipping (little green button will show up next to objects ID).

13. union Polyclip – UNION. Requires two objects to be marked for clipping. Performs UNION clipping operations between marked objects.

14. intersection Polyclip – INTERSECTION. Requires two objects to be marked for clipping. Performs INTERSECTION clipping operation between marked objects.

15. difference Polyclip – DIFFERENCE. Requires two objects to be marked for clipping. Performs DIFFERENCE clipping operation between marked objects.

16. exposepoints Expose points button. Objects created with “Rectangle”, “Circle”, “Ellipse”, “Gear/Cog”, “Star” and “Regular Polygon” tools won’t have control points visible when you try to transform them. “Transform tool” in case of these object behaves much like “recreation” or “redrawing” tool. For example, if your object was created with “Draw rounded star” tool, “Transform tool” will give you the same options for controlling number of arms with your mouse wheel or to control roundness with “CTRL+mouse wheel” and so on. If you want to have full control over each point that defines that object, you’ll have to expose them first.
With all points exposed, you have full control over each one of them via “Transform tool”.

17. optimize Optimize object button. Some object creating tools/methods create objects with very large number of points. This can have serious impact on performance of your game. “Free hand drawing mode” and “Body from bitmap” method both create very large number of points in objects. While you can tell GameStudio to automatically optimize these objects, you can also turn this option off, and take full control over optimization process.
Objects should be “smoothed out” first by clicking (once or several times) “Smooth” button in “Polygon optimization” dialog. Then you reduce number of points by clicking “Simplify” button. With “Tolerance” and “Look ahead” parameters you control number/percentage of points to remove.
You can always return to objects original state by clicking “Reset” button and start over. When you are satisfied with the result, click “Save” button to save changes and close window.

18. rename Rename object button. You can change ID of selected object by bringing up “Object rename” dialog with this button. Enter new name for an object in required field and click “SAVE” button.

19. find Toggle object finder. When you’re working on large game level with big zoom, finding objects requires panning the world to that object or locating that object in “Objects tab” and clicking “Locate object” button. You can quickly locate an object even if its not in active object group with “object finder”. Enter objects ID in required field and click “FIND” button to center object on editors screen.

20. rasterize Rasterize object button. Usage of some FX (style) effects can really kill the performance of GameStudio, and especially performance of your final game. Such effects are “Blur”, “Drop shadow”, “Inner and outer glow” and “Inner shadow” as these effects are “software rendered”. Instead of using these effects in your game, you can use “Rasterize object” button to create bitmap ( .png file ) of your object. Then you can turn off all these effects and import that bitmap as InnerGFX to your object style.

21. parallax Enable/disable parallax scrolling. You can have parallax scrolling in your game easily by turning it on in this dialog. You can enable/disable scrolling both on x and y axes. You can include/exclude object groups from parallax effect by clicking the “padlock” icon on that group tab.

22. server Web server button. GameStudioHx comes with built-in HTTP server that can be used to test games in web browser. Clicking “START” button will start server on selected port. Build your game for “HTML5” target and after successful build, open your web browser and navigate to “localhost:selected_port”, for example:
http://localhost:5000/
to test your game in browser.
You can set default port and add/remove MIME types to server via GameStudioHx properties.

23. Default object type selection. Whenever you change type of a physical object, that will also change “Default object type”. This behavior can be turned on or off in GameStudio settings. You can also set “Default object type” by hand, at any time.

24. Snap to grid option. You can enable or disable grid snapping in GameStudio. Actions affected by this are:
Drawing objects (with all GameStudio drawing tools)
Object move
Object transform
Brush painting

25. Grid cell size. You can control and set grid cell size. When using “Brush paint” tool, you can turn on “Auto set grid cell size” option to set grid size to match selected brush size (selected brush must be square shaped).

Right below bottom toolbar is located GameStudio status bar.
From left to right:

26. Current zoom level

27. FPS counter

28. Active mode. Shows current GameStudioHx mode

29. WORLD. Shows current position/dimensions of your games world.

30. Project:. Shows the name of current project.

Object groups, Object and Properties tabs

Objects are organized in “Object groups”. Every object you create in GameStudioHx has its parent “Object group”. This is concept similar to the concept of layers and groups in Photoshop. The difference is that you can’t create subgroups in GameStudioHx.
“Object groups” are represented by vertical tabs on the right side:

objectgroups
GameStudioHx Object Groups and Objects

Clicking on “Object Group” tab will activate that group. Only one group is active at a time. Only objects from active group are available for manipulation. If you want to access object from another group, you’ll have to activate that group first.

You can rearrange groups (change their depth or zIndex) by dragging their tabs above or below other. You can change groups visibility by clicking on “eye” icon on their tabs. When parallax scrolling is enabled, you can control which group is involved in parallax effect by locking/unlocking group (click on “padlock” icon). Locked groups will move at the same speed as “Physics” object group and unlocked groups will move at different speed (relative to “Physics” object group) depending on their depth. Deeper groups (relative to “Physics” object group) will move slower, higher groups (relative to “Physics” object group) will move faster.

“Physics” and “HUD” object groups are special groups created automatically by GameStudioHx for every level you create. You can’t delete or rename these groups but you don’t have to use them if you don’t need them. Every other object group is created by the user and they can be deleted/renamed at any time.

For every object that you create in GSHx, its representation in “Objects” tab on the right side of the editor is created (similar to layers in Photoshop).

object
Objects representation in “Objects tab”

warning_16 Warning icon will show every time when number of points in object you’ve created exceeds maximal number of points in object which is defined in GameStudioHx global settings. Clicking this icon will bring “Polygon optimization” dialog.
Each object is given auto-generated ID which can be changed anytime.
You can bring an object above or put below other objects by clicking on “drag handle” and drag’n’drop that object elsewhere.

With your object selected, click on “Properties” tab to access objects properties panel.

If an objects has any joints, a “joints” icon joints will show up. Clicking this icon will bring up the list of all joints of that object. Clicking any joint from the list will activate “Properties” tab and give you access to “Joint properties panel”.

Keyboard shortcuts

M – activates Move selected object tool.
R – activates Rotate selected object tool.
T – activates Transform selected object tool.
S – activates Scale selected object tool.
K – activates Knife tool.
CTRL+SHIFT+H – flip selected object horizontally.
CTRL+SHIFT+V – flip selected object vertically.
CTRL+SHIFT+C – creates identical copy of selected object.
DELETE – deletes selected object.
Alt+B – activates Brush tool.
SPACE – temporarily activates Move world mode. While holding down SPACE key on your keyboard use your mouse to pan your games world. This will not affect current GameStudioHx mode. When you release SPACE key, GameStudioHx returns to whatever mode it was before. For example, if Move selected object tool was active before pressing SPACE key and panning game world, when you release SPACE key Move selected object tool will still be active.
CTRL+SHIFT+X – lock movement on X axis.
CTRL+SHIFT+Y – lock movement on Y axis.
CTRL+ALT+B – toggle debug view.
Alt+G – toggle grid in editor.
Alt+R – toggle rulers in editor.
Alt+C – toggle mouse cross-hair in editor.
CTRL+ – zoom in.
CTRL- – zoom out.
CTRL+Q – start/pause game.
CTRL+R – reset game.
CTRL+S – save current level.
LEFT_ARROW – if Move selected object tool is active it will move selected object to the left by 1 unit at a time. If Rotate selected object is active it will rotate selected object counter-clockwise by 1 unit at a time. If Move world tool is active it will move/pan game world left by 1 unit at a time.
RIGHT_ARROW – if Move selected object tool is active it will move selected object to the right by 1 unit at a time. If Rotate selected object is active it will rotate selected object clockwise by 1 unit at a time. If Move world tool is active it will move/pan game world right by 1 unit at a time.
UP_ARROW – if Move selected object tool is active it will move selected object up by 1 unit at a time. If Move world tool is active it will move/pan game world up by 1 unit at a time.
DOWN_ARROW – if Move selected object tool is active it will move selected object down by 1 unit at a time. If Move world tool is active it will move/pan game world down by 1 unit at a time.
SHIFT+LEFT_ARROW – if Move selected object tool is active it will move selected object to the left by 10 units at a time. If Move world tool is active it will move/pan game world left by 10 units at a time. If Rotate selected object is active it will rotate selected object counter-clockwise by 10 units at a time.
SHIFT+RIGHT_ARROW – if Move selected object tool is active it will move selected object to the right by 10 units at a time. If Move world tool is active it will move/pan game world right by 10 units at a time. If Rotate selected object is active it will rotate selected object clockwise by 10 units at a time.
SHIFT+UP_ARROW – if Move selected object tool is active it will move selected object up by 10 units at a time. If Move world tool is active it will move/pan game world up by 10 units at a time.
SHIFT+DOWN_ARROW – if Move selected object tool is active it will move selected object down by 10 units at a time. If Move world tool is active it will move/pan game world down by 10 units at a time.
CTRL+Z – history undo.
CTRL+Z – history redo.
CTRL+C – copy selected item.
CTRL+V – paste selected item on current mouse position.
Print Scr – saves screenshot of current view in editor. Screenshots can be saved both in design mode and in game running mode.

Working with SVG files (import and export)

GameStudioHx has built-in support for SVG file format.
You can design your game level or individual object group (for example “Physics” object group) in vector graphics editor of your choice (like Adobe Illustrator or Inkscape), save it to .svg format and import it in GameStudioHx.

When importing svg to GameStudioHx, only color stroke and fill will be recognized !

If you’re importing “Physics” object group, you have two options to tell GameStudio about object types.
One way is to give type prefix to each of your objects/layers (Inkscape is recommended, Adobe Illustrator messes with layers ids), for example: “static_pathId” or “dynamic_pathId”. If type is omitted, “STATIC” type will be used.

Another way is to use color fill for object type. For example, you can use red color (#FF0000) to mark “DYNAMIC” object and black color (#000000) to mark static objects. You can use any number of (distinct) colors for each physics object type.
In “Import from SVG” dialog, you’ll have to enter all color values for all three types (hex values separated by comma).
If both type prefix and colors are available, type prefix will be used and color will be ignored.
If svg is imported in object group other than “Physics” group, simple GFX objects will be created.
It is also possible to export object group or level to svg file. Only objects created with GameStudioHx drawing tools will be exported (only color stroke and fill will be exported). Exported files will be placed in “projects_root_dir/SVG_export”.

Working with spritesheets

GameStudios texture packer can be used to generate spritesheets for animations or brushes. Spritesheets for animations are placed in “project_root_dir/assets/animations” and brushes are placed in “project_root_dir/assets/img/brushes”.
When creating brushes, it is important to turn on “Extrude” option when creating brush spritesheet if you’re planning to use “Snap to grid” option with brush painting. This is to prevent some glitches in rendering (small gaps between individual brush strokes that can show up on OpenFL CPP targets).
When creating spritesheets for animations, it is recommended to set padding to value bigger then 0 (1px is enough and recommended).

GameStudioHx API (writing extensions)

You can write your own scripts/extensions for GameStudioHx using its API. Scripts are written in Haxe programming language but with some restrictions.

Supported Haxe features are Basic Syntax, Classes, Interfaces, Inheritance, Imports.

Unssuported features are Enums, Macros, TypeDefs.

Extensions are places in “GameStudioHx_root_folder/scripts” folder.

You can create extension by going to “Script” menu and selecting “Script editor”. Clicking on “Create new extension” button will open popup window to fill basic info about your extension. Clicking “OK” button will create folder for your extension with “Main.hx” and “description.xml” files in it. Every extension must have “Main.hx” file in its root directory, but you’re free to make subfolder/files as you like. “description.xml” file is used to identify folder as extension holder.
Scripts/extensions can be compiled to binary form (.gse – GameStudio Extension) and it is recommended form of script publishing/distribution as these are faster in execution then scripts in text form. GameStudioHx will always look for binary (.gse) file first when user runs script. If binary file is not found, it will parse text file and will execute it.
Select script in GameStudio “Script editor” and click “Compile” button to build .gse file. Binary file will be given name of extension with whitespaces replaced by “_”, for example: “Polygon_clipping.gse”.

Minimal example of working GameStudioHx script/extension would look like this:


package;

import flash.geom.Point;
import flash.geom.Rectangle;

class Main {
  function new() {
    GSHx.createRectangle(new Rectangle(400, 400, 200, 100));
  }

  static function main() {
    new Main();
  }
}

All API is exposed through GSHx global object. In example above you can see how createRectangle() function is called:

GSHx.createRectangle(new Rectangle(400, 400, 200, 100));

The list of available classes/namespaces:

//Std
Type
Date
DateTools
IntIterator
Lambda
List
Math
Reflect
Std
String
StringBuf
StringTools
Sys
Type
Xml

haxe.CallStack
haxe.Http
haxe.Int64
haxe.Json
haxe.Log
haxe.Serializer
haxe.Template
haxe.Timer
haxe.Unserializer
haxe.Utf8

haxe.crypto.Adler32
haxe.crypto.BaseCode
haxe.crypto.Crc32
haxe.crypto.Md5
haxe.crypto.Sha1

haxe.ds.ArraySort
haxe.ds.HashMap
haxe.ds.IntMap
haxe.ds.ObjectMap
haxe.ds.StringMap
haxe.ds.Vector
haxe.ds.WeakMap

haxe.io.BufferInput
haxe.io.Bytes
haxe.io.BytesBuffer
haxe.io.BytesData
haxe.io.BytesInput
haxe.io.BytesOutput
haxe.io.Eof
haxe.io.Input
haxe.io.Output
haxe.io.Path
haxe.io.StringInput

sys.FileSystem
sys.io.File
sys.io.FileInput
sys.io.FileOutput

flash.geom.Rectangle
flash.geom.Matrix
flash.geom.Point
flash.display.Bitmap
flash.display.BitmapData
flash.events.Event
flash.events.MouseEvent

Check “scripts” folder of your GameStudioHx copy for a few simple examples of API usage.
Below are listed all functions/properties/global settings available through GSHx object.

Functions:

getSelectedObject():GSObject
Returns currently selected object in editor or null if no object is selected.

cloneObject: GSObject->GSObject
Returns clone of an object you passed to it.

deleteObject(obj:GSObject):Void
Deletes an object you passed to it.

showMessage(message:String):Void
Shows message you passed to it in a ‘growl-like’ style on screen.

log(message:Dynamic):Void
Writes your message to log window (Log window can be toggled through Tools > Show Log Window menu).

getJointById(id:String):GSJoint
Returns GSJoint with an ID you passed to it, or null if such joint does not exist.

deleteJointById(id:String):Void
Deletes GSJoint with ID you passed to it.

flipObject(obj:GSObject, flip:String = “v”):GSObject
First parameter is GSObject you want to flip and seccond parameter is how you want it to be flipped (“v” for vertical and “h” for horizontal flip).
Returns flipped object.

sliceObjects(objects:Array, point1:Point, point2:Point):Array
First parameter is an array of GSObjects you want to slice. point1 is starting point of slicing line and point2 is ending point of slicing line.
Returns an array of GSObjects created by slicing.

clipPolygons(object1:SuperBody, object2:SuperBody, operation:String):Void
Polygon clipping happens only between two overlapping/colliding GSObjects. If objects do not overlap, nothing happens.
First parameter is first clipping GSObject, second parameter is seccond clipping object.
Third parameter is type of clipping operation with possible values: “union”, “difference”, “intersection”.
When performing “difference” operation, order of GSObjects matters.
TODO: This function should return GSObject(s) created by clipping.

rotateObject(obj:GSObject, rot:Float):GSObject
Rotates given object by number of degrees defined by rot parameter. Returns rotated GSObject.

moveObject(obj:GSObject, x:Float, y:Float):GSObject
Moves given object to new point in space defined by x and y parameters. Returns GSObject with changed position.

createPolygonFromPoints(points:Array, x:Float, y:Float, angle:Float = 0, id:String = “”, compound:String = “”):GSObject
Creates GSObject from array of points, which is moved to location defined by x and y parameters and rotated by number of degrees defined by angle parameter. Created GSObject is given ID defined by id parameter (if no id is passed it will be auto-generated). Returns created GSObject.

createRegularPolygon(resolution:Int, x:Float, y:Float, radius:Float, angle:Float = 0, id:String = “”):GSObject
Creates regular polygon shape. Number of polygon sides is defined by resolution parameter, position in space defined by x and y parameters. Returns created GSObject.

createRoundedRegularPolygon(resolution:Int, roundness:Int, x:Float, y:Float, radius:Float, angle:Float = 0, id:String = “”):GSObject
Creates rounded regular polygon shape. Number of polygon sides is defined by resolution parameter, edge roundness defined by roundness parameter (min. 3 max 50, bigger number creates smoother curve), position in space defined by x and y parameters. Returns created GSObject.

createEllipse(resolution:Int, x:Float, y:Float, xRadius:Float, yRadius:Float, angle:Float = 0, id:String = “”):GSObject
Creates ellipse shape. Number of points in ellipse is defined by resolution parameter (min. 3 max. 100, bigger number gives smoother curve), position in space defined by x and y parameters, xRadius and yRadius parameters define ellipse shape. Returns created GSObject.

createGear(resolution:Int, x:Float, y:Float, innerRadius:Float, outerRadius:Float, angle:Float = 0, id:String = “”):GSObject
Creates gear shape. Number of gears “teeth” is defined by resolution parameter (min. 3 max. 50), position in space defined by x and y parameters. Returns created GSObject.

createStar(resolution:Int, x:Float, y:Float, innerRadius:Float, outerRadius:Float, angle:Float = 0, id:String = “”):GSObject
Creates star shape. Number of stars “arms” is defined by resolution parameter (min. 3 max. 50), position in space defined by x and y parameters. Returns created GSObject.

createRoundedStar(resolution:Int, roundness:Int, x:Float, y:Float, innerRadius:Float, outerRadius:Float, angle:Float = 0, id:String = “”):GSObject
Creates rounded star shape. Number of stars “arms” is defined by resolution parameter (min. 3 max. 50), edge roundness defined by roundness parameter (min. 3 max 50, bigger number creates smoother curve), position in space defined by x and y parameters. Returns created GSObject.

createCircle(x:Float, y:Float, radius:Float, id:String = “”):GSObject
Creates circle shape located at point defined by x and y. Returns created GSObject.

createRectangle(rect:Rectangle, rotation: Float = 0, id:String = “”):GSObject
Creates rectangle shape. Returns created GSObject.

createRoundedRectangle(rect:Rectangle, roundness:Int = 5, rotation: Float = 0, id:String = “”):GSObject
Creates rounded rectangle shape. Returns created GSObject.

centerObjectInEditor(object:GSObject):Void
Positions given GSObject at the center of editor screen.

createObjectGroup(name:String, isBrushCanvas:Bool = false):Void
Creates new object group with given name. Second parameter defines this object group as brush canvas or as regular object group.

getObjectById(id:String):GSObject
Returns GSObject with given id if one exists. Otherwise returns null.

setObjectType(object:GSObject, type:String = “DYNAMIC”):GSObject
This function will change the type of given object to new type (Possible types are “DYNAMIC”, “STATIC”, “KINEMATIC”). Returns updated GSObject.

createPivotJoint(object1:String, object2:String, anchorPoint:Point, stiff:Bool = true, damping:Float = 10, frequency:Float = 10):PivotJoint
Connects object1 and object2 (one object can be “world”, at least one object must be of “DYNAMIC” type) with PivotJoint.
Position of joint is defined by anchorPoint. Returns created joint.

createMotorJoint(object1:String, object2:String, rate:Float, ratio:Float):Void
Creates MotorJoint between object1 and object2 (one object can be “world”, at least one object must be of “DYNAMIC” type).
TODO: should return created joint

createDistanceJoint(object1:String, object2:String, anchor1:Point, anchor2:Point, minDist:Float, maxDist:Float, stiff:Bool = true, damping:Float = 10, frequency:Float = 10):Void
Creates DistanceJoint between object1 and object2 (one object can be “world”, at least one object must be of “DYNAMIC” type).
anchor1 and anchor2 are first and second anchor points of joint.
minDist and maxDist are minimum and maximum distance of joint.

createLineJoint(object1:String, object2:String, anchor1:Point, anchor2:Point, direction:Point, minDist:Float, maxDist:Float, stiff:Bool = true, damping:Float = 10, frequency:Float = 10):Void
Creates LineJoint between object1 and object2 (one object can be “world”, at least one object must be of “DYNAMIC” type).
anchor1 and anchor2 are first and second anchor points of joint.
minDist and maxDist are minimum and maximum distance of joint.

startGame():Void
Starts simulation in current level.

pauseGame():Void
Pauses simulation.

stopGame():Void
Stops simulation and resets current level. Returns GameStudioHx to editing mode.

runGSE(gseName:String):Void
One extension can call another extension. Extension which calls can be eather in text or binary form, called extension must be in binary form (.gse file).
Called extension can be any GameStudioHx extension currently installed. Extension which calls can call as many other extension as needed. Chained calls are also possible.
gseName is the name of extension to be called/executed. GameStudioHx will search entire “scripts” folder. If “.gse” file is found it will be executed, otherwise an error message will be shown.

saveLevel():Void
Saves active level.

saveLevelAsXml():Void

Properties:

worldPosition(get, set):Point
Gets/sets world position of current game level.

cameraOffset(get, set):Point
Gets/sets cammera position in current game level.

worldZoom(get, set):Float
Gets/sets current level world zoom.

cameraObject(get, set):GSObject
Gets/sets camera carrier in current level.

gravity(get, set):Point
Gets/sets gravity vector of current level.

activeObjectGroup(get, set):String
Gets/sets currently active object group.

Settings:
You can access global GameStudioHx settings from your extension.
All settings are accessed through GSHx.settings object.
Some settings are read-only but some of them you can change too.
When you change a setting, you’re changing it for current session only but you should return that setting to its original state after your code affected by that settings has run. For example:

// save original state to temp var
var originalState = GSHx.settings.objectClippingKeepOriginals;
// you're interested only in polygon clipping result and you don't want to keep original objects after clipping
// and you want to be sure that original objects are removed
GSHx.settings.objectClippingKeepOriginals = false;
.
.
.
GSHx.clipPolygons(...);
// return it to original state
GSHx.settings.objectClippingKeepOriginals = originalState;

objectClippingKeepOriginals(get, set):Bool
Determines if original objects upon which clipping was done (by GSHx.clipPolygons() function) should be preserved or not.

autoChangeDefaultObjectType(get, set):Bool
Whenever an object is created in “Physics” object group, the type of that object becomes “default object type” of GSHx.
You can control this behavior through this property.

defaultObjectType(get, set):String

currentProjectPath(get, never):String
Returns full path of currently active project.

Tips

Value of GUI controls like numeric steppers and sliders can be changed quickly using mouse wheel.
Add your own textures/patterns to “GameStudioHx_root_dir/patterns” folder. They have to be power of two.
You can also use Photoshop .pat files. In GameStudioHx “Item style” dialog, select “Pattern overlay” option and then select .pat file from drop-down list.
This will extract all images from .pat file and save them as PNG images.
Add your own particles templates and bitmaps to “GameStudioHx_root_dir/assets/particles” folder.
Slice/cut cuttable objects in runtime with your mouse by holding “K” key on your keyboard.

TODO list and plans for the future

  • Fixing bugs :)
  • Implement History ( Undo/Redo ). History buffer would be configurable via settings.
  • Multiple object selection/manipulation ( Rectangle, Ellipse and Lasso selection modes ).
  • Multiple control points selection/manipulation (transform tool).
  • More drawing tools (bezier curve).
  • Improve SVG import/export
  • ImageMagick integration (reading PSD files – one click game from PSD)
  • DragonBones support/integration – http://dragonbones.github.io/ (Check http://esotericsoftware.com/spine-download/ for GUI/workflow, Spriter also)
  • Animation app with GUI timeline (similar to Flash) with support for shape tweening.
  • Improve and optimize texture packer. Fix bug where trimming some images (usually very small ones) doesn’t work right (bug in BitmapData.getColorBoundsRect ???)
  • Implement camera animation system
  • More flexible camera
  • Support for Box2D and JellyPhysics
  • Decide about the best way to render brushes in game ? (quad trees, r-trees, something else ???). Fix HTML5 brush rendering (alpha …).
  • Improve/fix brush: fix eraser, fix brush zIndexing, controls over each brush stoke (representation in objects tab – changing zIndex, alpha, rotation, scale). Fix brush behavior when grid snapping is on/off. Improve brush dialog/browser.
  • Improve scripting system. Implement meta-tags that would be used by GameStudio to generate GUI controls for an extension. For example:
    @VehicleMaxSpeed @Float[120] @Range[50,200] @Step[0.5]
    var maxSpeed:Float;This would create a GUI controls like NumericStepper for example which will be connected with maxSpeed variable,
    @Float[120] is the type of variable with initial value,
    @Range[50,200] is the min and max values for this variable
    @Step[0.5] is the step for increasing/decreasing value of NumericStepper when user changes this value.This way, extension author would be able to give extension users some control over the extension execution. In example above, user would be able to control maximal speed of the vehicle.
    GSHx would read/parse this metadata and would generate GUI (NumericStepper in this case) in properties panel for this extension.
  • Expose more core functionality to API
  • More robust API
  • Improve script parser (check for valid GSHx API calls, more error checking)
  • Configurable keyboard shortcuts
  • Basic image editor
  • Fix waxe (wxWidgets) integration problem (waxe eats some events so they never get to NME, like mouseMove, doubleClick, keyboard events …). If this gets solved, create code editor that would be integrated in GameStudio (based on wxWidgets Scintilla component).
  • Make Linux, Mac and web version of GameStudio
  • Make light version of GameStudio for tablets
  • Support for HaxeFlixel, HaxePunk
  • 3D (port Three.js to OpenFL ?)
  • Kha as backend ?
  • Support for GUI frameworks like HaxeUI or StablexUI for applications (visual app builder with drag’n’drop support, themes, … – VisualStudio style)