aboutsummaryrefslogtreecommitdiff
path: root/src/tool/icon_tool.rs
diff options
context:
space:
mode:
authorArne Dußin2020-12-21 01:22:15 +0100
committerArne Dußin2020-12-21 21:15:55 +0100
commitd7e9c3cc46d616c2fcd1a6e9f73adbb79c6570b4 (patch)
treee5633f4d3b18472922c943d759e9f58722ba4405 /src/tool/icon_tool.rs
parent48f321a80970ebeb8374072b1d2e0a4d297aa348 (diff)
downloadgraf_karto-d7e9c3cc46d616c2fcd1a6e9f73adbb79c6570b4.tar.gz
graf_karto-d7e9c3cc46d616c2fcd1a6e9f73adbb79c6570b4.zip
Add previously missing docs where appropriate
Diffstat (limited to 'src/tool/icon_tool.rs')
-rw-r--r--src/tool/icon_tool.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tool/icon_tool.rs b/src/tool/icon_tool.rs
index 09b0ac1..c9e671e 100644
--- a/src/tool/icon_tool.rs
+++ b/src/tool/icon_tool.rs
@@ -1,3 +1,6 @@
+//! Tool for creating icons. For explanation of icons, please see
+//! [the icon module](crate::map::icon).
+
use crate::button::Button;
use crate::config::IconToolKeys;
use crate::map::icon_renderer::IconRenderer;
@@ -8,10 +11,8 @@ use crate::transform::Transform;
use raylib::core::drawing::RaylibDrawHandle;
use std::rc::Rc;
-pub const ICON_DIR: &str = "assets/icons";
-
+/// The icon tool itself.
pub struct IconTool {
- // TODO: support svg
keybindings: IconToolKeys,
/// Saves whether the IconTool is the currently active tool or not.
active: bool,
@@ -22,6 +23,8 @@ pub struct IconTool {
}
impl IconTool {
+ /// Create a new icon tool that renders icons with the provided icon renderer. There should only
+ /// be one instance of the tool for the program, which should be created in the editor.
pub fn new(keybindings: IconToolKeys, renderer: Rc<IconRenderer>) -> Self {
Self {
keybindings,