reflexion 0.3.15 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8766cf5812e53e4f488c3001691e2635435d0e40a92b336df21a86341d7e810c
4
- data.tar.gz: 294139e6497bf2418f1e8f7b0a216b614825d5403ea0badb758e8ac522ca278d
3
+ metadata.gz: 8781c6a2e533488f1529b59cdb98ed7922909330e254bdbd80b7ce67f40a8252
4
+ data.tar.gz: 449a81f9c5ba57c2daa68af18cc6e42d90319703beab674dee431e5bc2923d4b
5
5
  SHA512:
6
- metadata.gz: 872e3a7813e25cc17f481c57baf736204bae91a4f43e03b5f3b5b0273bd5892b8cd018c6cbba2c041d721afdea6103383ea8d54752bf3e01f208107591e72956
7
- data.tar.gz: baa908a9c4f4286abc4cf3aa0888ba280e15434348848a21c333f5462a8d4548a4cc3d4fa99b95a89fde45e8b865959307050a6a7cdc2ebb8396aee5cf99e3a5
6
+ metadata.gz: c746ba6a4b32c05eca98a2bd3c7ab5e459e44222d80794323757a8516401a91404c76aa4e7dbb08b084126bf08d65bf310ab8f3095f06bd2df29577fa7989604
7
+ data.tar.gz: 928aa64c73861dcb0848dc6c6ea6d770ccb3dff1e9e06ba6bb3cf470cb5104311af6ecfc543d4ca015f8efdc3a12d9bb6662b80014f9fc57a2bbc16c74bf5e43
@@ -152,13 +152,13 @@ VALUE get_key(VALUE self)
152
152
  CASE(LCONTROL):
153
153
  CASE(RCONTROL): SYMBOL1(control);
154
154
  CASE(ALT):
155
- #if !defined(LINUX)
155
+ #if !defined(IOS) && !defined(LINUX) && !defined(WASM)
156
156
  CASE(LALT):
157
157
  #endif
158
158
  CASE(RALT): SYMBOL1(alt);
159
159
  CASE(LWIN):
160
160
  CASE(RWIN): SYMBOL1(win);
161
- #if !defined(LINUX)
161
+ #if !defined(IOS) && !defined(LINUX) && !defined(WASM)
162
162
  CASE(LCOMMAND):
163
163
  CASE(RCOMMAND): SYMBOL1(command);
164
164
  CASE(LOPTION):
@@ -198,7 +198,7 @@ VALUE get_key(VALUE self)
198
198
  CASE(NUM_EQUAL): SYMBOL1(equal);
199
199
  CASE(NUM_COMMA): SYMBOL1(comma);
200
200
  CASE(NUM_DECIMAL): SYMBOL1(decimal);
201
- #if !defined(LINUX)
201
+ #if !defined(IOS) && !defined(LINUX) && !defined(WASM)
202
202
  CASE(NUM_CLEAR): SYMBOL1(clear);
203
203
  #endif
204
204
  CASE(NUM_ENTER): SYMBOL1(enter);
@@ -36,23 +36,9 @@ jobs:
36
36
  echo path=$(ruby -e 'print Dir.glob("*.gem").first') >> $GITHUB_OUTPUT
37
37
 
38
38
  - name: create github release
39
- id: release
40
- uses: actions/create-release@v1
41
39
  env:
42
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43
- with:
44
- tag_name: ${{ github.ref }}
45
- release_name: ${{ github.ref }}
46
-
47
- - name: upload to github release
48
- uses: actions/upload-release-asset@v1
49
- env:
50
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51
- with:
52
- upload_url: ${{ steps.release.outputs.upload_url }}
53
- asset_path: ./${{ steps.gem.outputs.path }}
54
- asset_name: ${{ steps.gem.outputs.path }}
55
- asset_content_type: application/zip
40
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41
+ run: ruby -I.github/workflows -rutils -e 'release(*ARGV)' ./${{ steps.gem.outputs.path }}
56
42
 
57
43
  - name: upload to rubygems
58
44
  env:
data/ChangeLog.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # reflex ChangeLog
2
2
 
3
3
 
4
+ ## [v0.4.0] - 2026-05-17
5
+
6
+ - [BREAKING] Normalize wheel Y delta to top-left origin convention
7
+
8
+ - Add keyboard event handling on iOS
9
+ - Add mouse event handling on iOS
10
+ - Rewrite README.md
11
+ - CI: Migrate release-gem.yml from actions/create-release to gh release create
12
+ - Refresh hello sample Xcode projects
13
+
14
+ - Skip duplicate KEY_CODE aliases on WASM build
15
+
16
+
4
17
  ## [v0.3.15] - 2026-05-10
5
18
 
6
19
  - Support WebAssembly
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Reflex - A Graphical User Interface Tool Kit for Ruby.
1
+ # Reflex - A GUI toolkit for Ruby
2
2
 
3
3
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/xord/reflex)
4
4
  ![License](https://img.shields.io/github/license/xord/reflex)
@@ -21,19 +21,38 @@ Thanks for your support! 🙌
21
21
 
22
22
  ## 🚀 About
23
23
 
24
- **Reflex** is a graphical user interface (GUI) toolkit for Ruby.
24
+ **Reflex** is a cross-platform GUI toolkit for Ruby. It gives you a `Window` with a tree of `View` objects, an event-driven runtime (`Application` / `on_draw`, `on_update`, `on_pointer`, ...), and bindings to a 2D physics engine, MIDI I/O, and live camera capture — all sitting on top of the [Rays](https://github.com/xord/rays) drawing engine.
25
25
 
26
- It is designed to help developers create intuitive and responsive user interfaces for their Ruby applications.
27
- **Reflex** provides core components such as Window and View, making it easier to build the foundation of your GUI applications.
26
+ It is the application layer underneath [Processing](https://github.com/xord/processing), [RubySketch](https://github.com/xord/rubysketch), and [Reight](https://github.com/xord/reight). Like the rest of the `xord/*` family, Reflex is primarily developed for our own use, but it also works as a standalone GUI / creative-coding toolkit.
27
+
28
+ > **The gem name is `reflexion`** (not `reflex`) — `gem install reflexion`. The Ruby namespace is `Reflex`.
29
+
30
+ ## 📋 Requirements
31
+
32
+ - Ruby **3.0.0** or later
33
+ - A C++ compiler with C++20 support
34
+ - [Xot](https://rubygems.org/gems/xot), [Rucy](https://rubygems.org/gems/rucy), and [Rays](https://rubygems.org/gems/rays) (declared as runtime dependencies)
35
+ - Platform GUI backend:
36
+ - **macOS** — AppKit (bundled with the OS)
37
+ - **iOS** — UIKit (bundled with the OS)
38
+ - **Windows** — native Win32
39
+ - **Linux** — `libsdl2-dev`
40
+
41
+ The following third-party libraries are cloned from GitHub and statically linked while the native extension is being built:
42
+
43
+ | Library | Role |
44
+ | --------------------------------------------- | ----------------------------------- |
45
+ | [Box2D](https://github.com/erincatto/box2d) | 2D physics simulation (`View` bodies, `ContactEvent`, gravity, fixtures) |
46
+ | [RtMidi](https://github.com/thestk/rtmidi) | MIDI I/O — exposes `MidiEvent`, `NoteEvent`, `ControlChangeEvent` to views |
28
47
 
29
48
  ## 📦 Installation
30
49
 
31
50
  Add this line to your Gemfile:
32
51
  ```ruby
33
- $ gem 'reflexion'
52
+ gem 'reflexion'
34
53
  ```
35
54
 
36
- Then, install gem:
55
+ Then install:
37
56
  ```bash
38
57
  $ bundle install
39
58
  ```
@@ -43,7 +62,187 @@ Or install it directly:
43
62
  $ gem install reflexion
44
63
  ```
45
64
 
65
+ `require 'reflex'` automatically calls `Reflex.init!` (and `Rays.init!`) and registers `Reflex.fin!` at exit. Set `$REFLEX_NOAUTOINIT = true` before requiring if you want to manage the lifetime yourself.
66
+
67
+ ## 📚 What's Included
68
+
69
+ ### Application / Window / View
70
+
71
+ | Class | Purpose |
72
+ | ------------------------ | ----------------------------------------------------------------------- |
73
+ | `Reflex::Application` | Run loop; created and started by `Reflex.start { ... }` |
74
+ | `Reflex::Window` | OS-level window with title, frame, flags (closable / resizable / fullscreen / portrait / landscape) |
75
+ | `Reflex::View` | Recursive UI node: position, size, transform, styles, child views, optional clipping / caching |
76
+ | `Reflex::Screen` | Information about a display monitor |
77
+ | `Reflex::Timer` | One-shot or interval timer that delivers `TimerEvent` |
78
+
79
+ ### Shapes (drawing + physics body)
80
+
81
+ A view can carry one or more `Shape` objects that act both as its drawn appearance and as its physics fixture. Built-ins:
82
+
83
+ - `Reflex::RectShape`
84
+ - `Reflex::EllipseShape`
85
+ - `Reflex::LineShape`
86
+ - `Reflex::PolygonShape` — wraps a `Rays::Polygon`
87
+
88
+ ### Events
89
+
90
+ Every event class inherits from `Reflex::Event`. Views receive them via `on_<name>` hooks (or `on(:name)` / `before(:name)` / `after(:name)` from `Xot::Hookable`).
91
+
92
+ | Event class | View hook | When it fires |
93
+ | ---------------------------------------------------- | -------------------- | --------------------------------------------------- |
94
+ | `UpdateEvent` | `on_update` | Every frame, before drawing |
95
+ | `DrawEvent` | `on_draw` | Every frame, to render with `e.painter` |
96
+ | `FrameEvent` | `on_frame_*` | Frame resize / move |
97
+ | `FocusEvent` | `on_focus` | Keyboard focus gained / lost |
98
+ | `KeyEvent` | `on_key` | Key down / up / repeat |
99
+ | `PointerEvent` | `on_pointer` | Mouse / touch down / move / up |
100
+ | `WheelEvent` | `on_wheel` | Scroll wheel / trackpad scroll |
101
+ | `ScrollEvent` | `on_scroll` | The view itself scrolled |
102
+ | `MidiEvent` / `NoteEvent` / `ControlChangeEvent` | `on_midi` / `on_note` / `on_control_change` | Incoming MIDI message |
103
+ | `CaptureEvent` | `on_capture` | New frame from a `Rays::Camera` |
104
+ | `TimerEvent` | `on_timer` | Fired by `start_timer` / `start_interval` |
105
+ | `ContactEvent` | `on_contact_*` | Two physics bodies began / ended overlapping |
106
+ | `DeviceEvent` / `MotionEvent` | various | Device-level signals (accelerometer / gyro / connection) |
107
+
108
+ ### Styling and selectors
109
+
110
+ `Reflex::Style` and `Reflex::Selector` (with `HasSelector`) provide a lightweight CSS-style mechanism for setting background, padding, layout, etc., on views.
111
+
112
+ ### Two ways to use the gem
113
+
114
+ The gem ships **two complementary APIs**:
115
+
116
+ 1. **`require 'reflex'`** — the full OO API. Subclass `Reflex::Window`, override `on_draw` / `on_update` / `on_pointer`, build a view hierarchy, etc.
117
+ 2. **`require 'reflexion/include'`** — a single-file, Processing-style API that exposes top-level `setup`, `draw`, `update`, `key`, `pointer`, `motion` blocks and auto-starts the application on `at_exit`.
118
+
119
+ ## 💡 Usage
120
+
121
+ ### Hello, Reflex (OO style)
122
+
123
+ ```ruby
124
+ require 'reflex'
125
+
126
+ class HelloWindow < Reflex::Window
127
+ def initialize
128
+ super title: 'Hello Reflex!', frame: [100, 100, 320, 240]
129
+ painter.font = Reflex::Font.new('Menlo', 32)
130
+ painter.background = 0
131
+ painter.fill = 1
132
+ end
133
+
134
+ def on_draw(e)
135
+ e.painter.text 'hello world!', 5, 5
136
+ end
137
+
138
+ def on_update(e)
139
+ painter.background = rand, rand, rand
140
+ redraw
141
+ end
142
+ end
143
+
144
+ Reflex.start do
145
+ HelloWindow.new.show
146
+ end
147
+ ```
148
+
149
+ ### Block / DSL style
150
+
151
+ ```ruby
152
+ require 'reflex'
153
+
154
+ Reflex.start do
155
+ Reflex::Window.show title: 'Shapes', frame: [100, 100, 500, 300] do
156
+ def on_draw(e)
157
+ e.painter.push do
158
+ fill :pink
159
+ stroke 1
160
+ stroke_width 2
161
+ rect 10, 10, 80, 80, 10
162
+ ellipse 120, 10, 80, 80
163
+ end
164
+ end
165
+ end
166
+ end
167
+ ```
168
+
169
+ ### Reflexion (Processing-style single-file)
170
+
171
+ ```ruby
172
+ require 'reflexion/include'
173
+
174
+ setup do
175
+ window.title = 'Reflexion!'
176
+ end
177
+
178
+ draw do |p|
179
+ p.background 0
180
+ p.fill 1
181
+ p.text 'hello from reflexion', 10, 30
182
+ end
183
+
184
+ pointer do |e|
185
+ puts "pointer at #{e.pos.to_a.inspect}"
186
+ end
187
+ # Reflexion.start is called automatically at_exit
188
+ ```
189
+
190
+ ### 2D physics with Box2D
191
+
192
+ ```ruby
193
+ require 'reflex'
194
+
195
+ Reflex.start name: 'Physics' do |app|
196
+ Reflex::Window.show title: app.name, frame: [100, 100, 500, 500] do
197
+ gravity 0, 9.8 * meter
198
+
199
+ 50.times do
200
+ add Reflex::View.new {
201
+ pos rand(10..400), rand(10..100)
202
+ size rand(5..50)
203
+ background [:red, :green, :blue, :yellow, :orange].sample
204
+ dynamic true
205
+ shape Reflex::EllipseShape.new(density: 1)
206
+ }
207
+ end
208
+
209
+ add Reflex::View.new { # a static ground
210
+ pos 0, 480
211
+ size 500, 20
212
+ background :darkgray
213
+ static true
214
+ }
215
+
216
+ on :pointer do |e|
217
+ if e.down? || e.drag?
218
+ add Reflex::View.new(pos: e.pos, size: 10, dynamic: true,
219
+ shape: Reflex::EllipseShape.new(density: 1))
220
+ end
221
+ end
222
+ end
223
+ end
224
+ ```
225
+
226
+ See the [`samples/`](./samples) directory for more examples covering shapes, layout, models, MIDI, camera capture, etc.
227
+
228
+ ## 🛠️ Development
229
+
230
+ ```bash
231
+ $ rake vendor # clone Box2D and RtMidi into vendor/
232
+ $ rake lib # build the native C++ library (libreflex)
233
+ $ rake ext # build the Ruby C extension
234
+ $ rake test # run the test suite
235
+ $ rake doc # generate RDoc from C++ sources
236
+ $ rake # default: builds the extension
237
+ ```
238
+
239
+ The test suite requires a windowing system, so CI only runs it on macOS. The `test_reflex_init.rb` test must run in its own process and is listed in `TESTS_ALONE`.
240
+
241
+ In the [`xord/all`](https://github.com/xord/all) monorepo you can scope by module, e.g. `rake reflex test`.
242
+
46
243
  ## 📜 License
47
244
 
48
245
  **Reflex** is licensed under the MIT License.
49
246
  See the [LICENSE](./LICENSE) file for details.
247
+
248
+ The third-party libraries listed above retain their own licenses (Box2D: MIT, RtMidi: MIT-style).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.15
1
+ 0.4.0
@@ -156,13 +156,13 @@ RUCY_DEF0(get_key)
156
156
  CASE(LCONTROL):
157
157
  CASE(RCONTROL): SYMBOL1(control);
158
158
  CASE(ALT):
159
- #if !defined(LINUX)
159
+ #if !defined(IOS) && !defined(LINUX) && !defined(WASM)
160
160
  CASE(LALT):
161
161
  #endif
162
162
  CASE(RALT): SYMBOL1(alt);
163
163
  CASE(LWIN):
164
164
  CASE(RWIN): SYMBOL1(win);
165
- #if !defined(LINUX)
165
+ #if !defined(IOS) && !defined(LINUX) && !defined(WASM)
166
166
  CASE(LCOMMAND):
167
167
  CASE(RCOMMAND): SYMBOL1(command);
168
168
  CASE(LOPTION):
@@ -202,7 +202,7 @@ RUCY_DEF0(get_key)
202
202
  CASE(NUM_EQUAL): SYMBOL1(equal);
203
203
  CASE(NUM_COMMA): SYMBOL1(comma);
204
204
  CASE(NUM_DECIMAL): SYMBOL1(decimal);
205
- #if !defined(LINUX)
205
+ #if !defined(IOS) && !defined(LINUX) && !defined(WASM)
206
206
  CASE(NUM_CLEAR): SYMBOL1(clear);
207
207
  #endif
208
208
  CASE(NUM_ENTER): SYMBOL1(enter);
@@ -77,12 +77,12 @@ namespace Reflex
77
77
 
78
78
  KEY_NONE = -1,
79
79
 
80
- #if defined(WIN32)
81
- #define NATIVE_VK(darwin, win32, sdl) win32
82
- #elif defined(LINUX)
83
- #define NATIVE_VK(darwin, win32, sdl) sdl
80
+ #if defined(OSX)
81
+ #define NATIVE_VK(darwin, win32, hid) darwin
82
+ #elif defined(WIN32)
83
+ #define NATIVE_VK(darwin, win32, hid) win32
84
84
  #else
85
- #define NATIVE_VK(darwin, win32, sdl) darwin
85
+ #define NATIVE_VK(darwin, win32, hid) hid
86
86
  #endif
87
87
 
88
88
  KEY_A = NATIVE_VK(0x00, 0x41, 0x04),
@@ -231,16 +231,16 @@ namespace Reflex
231
231
  KEY_SECTION = NATIVE_VK(0x0A, 0xE2, 0x64),
232
232
  KEY_HELP = NATIVE_VK(0x72, 0x2F, 0x75),
233
233
 
234
- KEY_EISU = NATIVE_VK(0x66, -33, -4),
235
- KEY_KANA = NATIVE_VK(0x68, 0x15, -5),
236
- KEY_KANJI = NATIVE_VK(-18, 0x19, -6),
237
- KEY_IME_ON = NATIVE_VK(-19, 0x16, -7),
238
- KEY_IME_OFF = NATIVE_VK(-20, 0x1A, -8),
239
- KEY_IME_MODECHANGE = NATIVE_VK(-21, 0x1F, -9),
240
- KEY_CONVERT = NATIVE_VK(-22, 0x1C, -10),
241
- KEY_NONCONVERT = NATIVE_VK(-23, 0x1D, -11),
242
- KEY_ACCEPT = NATIVE_VK(-24, 0x1E, -12),
243
- KEY_PROCESS = NATIVE_VK(-25, 0xE5, -13),
234
+ KEY_EISU = NATIVE_VK(0x66, -33, 0x90),
235
+ KEY_KANA = NATIVE_VK(0x68, 0x15, 0x91),
236
+ KEY_KANJI = NATIVE_VK(-18, 0x19, 0x94),
237
+ KEY_IME_ON = NATIVE_VK(-19, 0x16, -4),
238
+ KEY_IME_OFF = NATIVE_VK(-20, 0x1A, -5),
239
+ KEY_IME_MODECHANGE = NATIVE_VK(-21, 0x1F, -6),
240
+ KEY_CONVERT = NATIVE_VK(-22, 0x1C, -7),
241
+ KEY_NONCONVERT = NATIVE_VK(-23, 0x1D, -8),
242
+ KEY_ACCEPT = NATIVE_VK(-24, 0x1E, -9),
243
+ KEY_PROCESS = NATIVE_VK(-25, 0xE5, -10),
244
244
 
245
245
  KEY_VOLUME_UP = NATIVE_VK(0x48, 0xAF, 0x80),
246
246
  KEY_VOLUME_DOWN = NATIVE_VK(0x49, 0xAE, 0x81),
@@ -248,19 +248,19 @@ namespace Reflex
248
248
 
249
249
  KEY_SLEEP = NATIVE_VK(-26, 0x5F, 0x11A),
250
250
  KEY_EXEC = NATIVE_VK(-27, 0x2B, 0x74),
251
- KEY_PRINT = NATIVE_VK(-28, 0x2A, -14),
251
+ KEY_PRINT = NATIVE_VK(-28, 0x2A, -11),
252
252
  KEY_APPS = NATIVE_VK(-29, 0x5D, 0x65),
253
253
  KEY_SELECT = NATIVE_VK(-30, 0x29, 0x77),
254
254
  KEY_CLEAR = NATIVE_VK(-31, 0x0C, 0x9C),
255
255
 
256
- KEY_NAVIGATION_VIEW = NATIVE_VK(-32, 0x88, -15),
257
- KEY_NAVIGATION_MENU = NATIVE_VK(-33, 0x89, -16),
258
- KEY_NAVIGATION_UP = NATIVE_VK(-34, 0x8A, -17),
259
- KEY_NAVIGATION_DOWN = NATIVE_VK(-35, 0x8B, -18),
260
- KEY_NAVIGATION_LEFT = NATIVE_VK(-36, 0x8C, -19),
261
- KEY_NAVIGATION_RIGHT = NATIVE_VK(-37, 0x8D, -20),
262
- KEY_NAVIGATION_ACCEPT = NATIVE_VK(-38, 0x8E, -21),
263
- KEY_NAVIGATION_CANCEL = NATIVE_VK(-39, 0x8F, -22),
256
+ KEY_NAVIGATION_VIEW = NATIVE_VK(-32, 0x88, -12),
257
+ KEY_NAVIGATION_MENU = NATIVE_VK(-33, 0x89, -13),
258
+ KEY_NAVIGATION_UP = NATIVE_VK(-34, 0x8A, -14),
259
+ KEY_NAVIGATION_DOWN = NATIVE_VK(-35, 0x8B, -15),
260
+ KEY_NAVIGATION_LEFT = NATIVE_VK(-36, 0x8C, -16),
261
+ KEY_NAVIGATION_RIGHT = NATIVE_VK(-37, 0x8D, -17),
262
+ KEY_NAVIGATION_ACCEPT = NATIVE_VK(-38, 0x8E, -18),
263
+ KEY_NAVIGATION_CANCEL = NATIVE_VK(-39, 0x8F, -19),
264
264
 
265
265
  KEY_BROWSER_BACK = NATIVE_VK(-40, 0xA6, 0x10E),
266
266
  KEY_BROWSER_FORWARD = NATIVE_VK(-41, 0xA7, 0x10F),
data/reflex.gemspec CHANGED
@@ -25,9 +25,9 @@ Gem::Specification.new do |s|
25
25
  s.platform = Gem::Platform::RUBY
26
26
  s.required_ruby_version = '>= 3.0.0'
27
27
 
28
- s.add_dependency 'xot', '~> 0.3.12'
29
- s.add_dependency 'rucy', '~> 0.3.12'
30
- s.add_dependency 'rays', '~> 0.3.12'
28
+ s.add_dependency 'xot', '~> 0.3.13'
29
+ s.add_dependency 'rucy', '~> 0.3.13'
30
+ s.add_dependency 'rays', '~> 0.3.13'
31
31
 
32
32
  s.files = `git ls-files`.split $/
33
33
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
data/samples/bats.rb CHANGED
@@ -24,7 +24,7 @@ win = Reflex::Window.new do
24
24
  angle = 0
25
25
  speed = (rand * 2 - 1) * 30
26
26
 
27
- on :update do
27
+ on :update do |e|
28
28
  move_by rand(5) - 2, rand(5) - 2
29
29
  angle += speed
30
30
  angle %= 360
@@ -71,7 +71,7 @@ win = Reflex::Window.new do
71
71
  end
72
72
 
73
73
  add Reflex::TextView.new {
74
- set name: :count, pos: [10, 10], model: model
74
+ set name: :count, frame: [10, 10, 100, 30], model: model
75
75
  }
76
76
 
77
77
  root.on :draw do |e|
@@ -21,7 +21,7 @@ class Win : public Window
21
21
 
22
22
  void on_draw (DrawEvent* e)
23
23
  {
24
- e->painter->text(stringf("%f", e->fps), 10, 10);
24
+ e->painter()->text(stringf("%f", e->fps()), 10, 10);
25
25
  }
26
26
 
27
27
  };// Window
@@ -64,8 +64,8 @@ class App : public Application
64
64
 
65
65
  win->root()->add_child(view);
66
66
 
67
- view->body()->set_dynamic(true);
68
- view->body()->set_density(1);
67
+ view->set_dynamic(true);
68
+ view->set_density(1);
69
69
  }
70
70
  }
71
71