Noah Petherbridge
5a1ec156ca
* 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
26 lines
422 B
Go
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]
|
|
}
|