doodle/pkg/drawtool/tools.go
Noah Petherbridge 5a1ec156ca Editor Mode: Line Tool and Rectangle Tool
* Add support for the LineTool and RectTool while in the EditorMode to
  easily draw straight lines and rectangle outlines.
* Key bindings were added to toggle tools in lieu of a proper UI to
  select the tool from a toolbar.
  * "F" for Pencil (Freehand) Tool (since "P" is for "Playtest")
  * "L" for Line Tool
  * "R" for Rectangle Tool
2019-07-03 17:19:25 -07:00

26 lines
422 B
Go

package drawtool
// Tool is a draw mode for an editable Canvas.
type Tool int
// Draw modes for editable Canvas.
const (
PencilTool Tool = iota // draw pixels where the mouse clicks
LineTool
RectTool
ActorTool // drag and move actors
LinkTool
)
var toolNames = []string{
"Pencil",
"Line",
"Rectangle",
"Doodad", // readable name for ActorTool
"Link",
}
func (t Tool) String() string {
return toolNames[t]
}