Added the ability to drag, rotate, scale and adjust the pivot point on objects on the canvas, and added a toolbar with a play/pause button which switches between play and edit mode. When in edit mode, we can select the objects directly from the canvas (when in play mode, we can only select the objects from the scene tree).
Also the game is now contained in a sub-window in the editor, so the game tree + inspector do not hide parts of the game.
Drag and move in pause mode will move the selected object. Pressing alt while dragging will clamp the moving object in a 5 pixel (currently hard-coded) grid. Pressing ctrl while dragging will ensure that the drag is either horizontal or vertical. When an object is selected you can also move the object with the arrow keys (and same rules still apply when pressing alt or ctrl).
After selecting an object, 9 handles will appear around the object to allow scaling in all directions. Click and drag the handle to resize. Pressing alt when resizing will clamp the scale in a 5 pixel (currently hard-coded) grid. Pressing ctrl while resizing will keep the same aspect ratio. When an object is selected you can also resize the object with the (+/-) keys (and same rules still apply when pressing alt or ctrl).
Besides the 9 resize handles, there's also a handle for the pivot point. You can drag it around to change the location of the pivot point. Pressing alt while dragging the pivot point will round the pivot to 1 digit after the decimal point (currently hard-coded). Pressing ctrl while dragging the pivot point will clamp the pivot point to be inside the region of the bounding box of the entity.
Clicking on an already selected object will remove the 9 resize handles and replace them with 4 rotate handles (and clicking again reverts back to the resize handles). Drag the handles to rotate the selected object. Pressing alt when rotating will clamp the rotated object to offsets of 5 degrees (currently hard-coded). When an object is selected you can also rotate it with the bracket keys ("]" or "[") (and same rules still apply when pressing alt).
The whole system was heavily inspired from Inkscape.
BREAKING CHANGES:
A lot has changed to support this, which include several breaking changes:
Instead of Calling game.Run with the settings, the settings are now a property of IGameStarter.
There's now an object containing default settings (IDefaultSettings) which replaces a few static properties.
Added the ability to drag, rotate, scale and adjust the pivot point on objects on the canvas, and added a toolbar with a play/pause button which switches between play and edit mode. When in edit mode, we can select the objects directly from the canvas (when in play mode, we can only select the objects from the scene tree). Also the game is now contained in a sub-window in the editor, so the game tree + inspector do not hide parts of the game.
Demo
The whole system was heavily inspired from Inkscape.
BREAKING CHANGES:
A lot has changed to support this, which include several breaking changes: