fontaine 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/lib/fontaine/canvas.rb +2 -1
- data/lib/fontaine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 238129a19436ad62d35add2711ed53ef9b81cfb8
|
4
|
+
data.tar.gz: b9a4742780ef3644f462689400d07d0e57ed815c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b41513abaa6465495ae81e0ecb5a6bc0cb51d009d78d3606d75291b715e5b2cccd4984d5741a6161c455db7511ef604f210c5e840b2cb7c105654ba0ecef49d5
|
7
|
+
data.tar.gz: 50763f178d3cda4e32d05955fb3159ee38af091bb5022d13d18a5c3e361eae2acbe4091ff17b05882181bd4276ea95bcb8dc9c0cdeec6dc0e75a743ad68f380d
|
data/README.md
CHANGED
@@ -120,6 +120,8 @@ file. @canvas.display will display the canvas.
|
|
120
120
|
|
121
121
|
**NOTE: All coordinates are in relation to the canvas, not to the document** 0, 0 is the top-left corner of the canvas, for example.
|
122
122
|
|
123
|
+
**on_open** Yields nothing- runs when the document is created
|
124
|
+
|
123
125
|
**on_click** Yields x, y, and button
|
124
126
|
|
125
127
|
**on_mousedown** Yields x, y, and button
|
@@ -134,8 +136,8 @@ file. @canvas.display will display the canvas.
|
|
134
136
|
|
135
137
|
**on_keydown** Yields key_code
|
136
138
|
|
137
|
-
(Note,
|
138
|
-
the value)
|
139
|
+
(Note, key_code is not the ascii value of the key pressed. See javascript documentation on the difference between the
|
140
|
+
keyCode and the value)
|
139
141
|
|
140
142
|
**on_keyup** Yields key_code
|
141
143
|
|
@@ -153,6 +155,10 @@ not canvas.fill_style = "#FF0000")
|
|
153
155
|
|
154
156
|
## Exceptions and Issues
|
155
157
|
|
158
|
+
**Currently, all drawing methods must be called within an Action Method block.**
|
159
|
+
|
160
|
+
**Actions Method blocks may only be called during initialization.**
|
161
|
+
|
156
162
|
Any "Drawing" method that returns an attribute doesn't "really" give you the attribute. It returns the value of the attribute from the
|
157
163
|
last time you changed it from the ruby Canvas object. In other words, if I call
|
158
164
|
|
@@ -186,7 +192,9 @@ implemented, and doesn't work right now. Don't even try.
|
|
186
192
|
|
187
193
|
**Soon**
|
188
194
|
|
189
|
-
* Implement on_keystroke methods for each key. For example, on_keystroke_a.
|
195
|
+
* Implement on_keystroke methods for each key. For example, on_keystroke_a or on_keystroke("a").
|
196
|
+
* Allow changing of action methods outside of initialize
|
197
|
+
* Allow calling of drawing methods outside of action blocks
|
190
198
|
|
191
199
|
**Later**
|
192
200
|
|
data/lib/fontaine/canvas.rb
CHANGED
@@ -46,6 +46,7 @@ class Canvas
|
|
46
46
|
@ws = ws
|
47
47
|
@ws.send("register ##{id}")
|
48
48
|
@settings.sockets << ws
|
49
|
+
trigger_on_open
|
49
50
|
end
|
50
51
|
ws.onmessage do |msg|
|
51
52
|
#puts("recieved message: #{msg}")
|
@@ -188,7 +189,7 @@ class Canvas
|
|
188
189
|
|
189
190
|
def canvas_array
|
190
191
|
return["response", "mousedown", "mouseup", "keyup", "keydown", "keypress", "click", "mouseover",
|
191
|
-
"mouseout", "mousemove", "touchstart", "touchmove", "touchend"]
|
192
|
+
"mouseout", "mousemove", "touchstart", "touchmove", "touchend", "open"]
|
192
193
|
end
|
193
194
|
|
194
195
|
def return_method_array
|
data/lib/fontaine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fontaine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- J. Paul Wetstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra-websocket
|