diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ruby2d/sprite.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ruby2d/sprite.rb b/lib/ruby2d/sprite.rb index e6a6efa..7c66f97 100644 --- a/lib/ruby2d/sprite.rb +++ b/lib/ruby2d/sprite.rb @@ -8,9 +8,11 @@ module Ruby2D def initialize(x, y, path, z=0) - # unless File.exists? path - # raise Error, "Cannot find image file `#{path}`" - # end + unless RUBY_ENGINE == 'opal' + unless File.exists? path + raise Error, "Cannot find sprite image file `#{path}`" + end + end @x, @y, @path = x, y, path @clip_x, @clip_y, @clip_w, @clip_h = 0, 0, 0, 0 |
