From 95e1fe197eddd87de0c5672249a930f9e1589694 Mon Sep 17 00:00:00 2001
From: Matthew Hall <matthew@quickbeam.me.uk>
Date: Sat, 11 Oct 2014 15:41:07 +0100
Subject: [PATCH] Add example to README

---
 README.md | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/README.md b/README.md
index 5ad18c5..956a7b0 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,29 @@
 Read maps from the [Tiled Map Editor](http://www.mapeditor.org/) into rust for use in video games. It is game engine agnostic and pretty barebones at the moment. Documentation is available [on rust-ci](http://rust-ci.org/mattyhall/rs-tiled/doc/tiled/).
 
 
+### Example
+
+```rust
+extern crate serialize;
+extern crate xml;
+extern crate tiled;
+
+use std::io::File;
+use std::io::BufferedReader;
+use xml::reader::EventReader;
+use tiled::parse;
+
+fn main() {
+    let file = File::open(&Path::new("assets/tiled_base64_zlib.tmx")).unwrap();
+    println!("Opened file");
+    let reader = BufferedReader::new(file);
+    let mut parser = EventReader::new(reader);
+    let map = parse(&mut parser).unwrap();
+    println!("{}", map);
+    println!("{}", map.get_tileset_by_gid(22));
+}
+```
+
 ### Things missing
 There are a few things missing at the moment:
 
@@ -15,6 +38,7 @@ There are a few things missing at the moment:
   * Image layers
   * A nice API. At the moment you can access attributes and properties, find tilesets by GID and loop through the tiles. This leaves a user of the library with a bit to do.
 
+### Licences
 assets/tilesheet.png by Buch (http://blog-buch.rhcloud.com/)
 
 Licenced under MIT
-- 
GitLab