texplay 0.3.3 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ *22/2/11 version 0.3.5
2
+ * added :source, :dest, :source_with_alpha, :dest_with_alpha options to
3
+ :alpha_blend
4
+ * added live.rb (repl image editor)
5
+ * added alone.rb (run texplay image manip independent from gosu)
6
+
1
7
  *1/11/10 version 0.3.0
2
8
  * pushed gems
3
9
  * tested
data/lib/texplay/alone.rb CHANGED
@@ -3,7 +3,7 @@ direc = File.dirname(__FILE__)
3
3
  require "#{direc}/../texplay"
4
4
 
5
5
  module TexPlay
6
- Win = Gosu::Window.new(0, 0, false)
6
+ Win = Gosu::Window.new(100, 100, false)
7
7
 
8
8
  set_options :sync_mode => :no_sync
9
9
 
@@ -0,0 +1,84 @@
1
+ direc = File.dirname(__FILE__)
2
+
3
+ require "#{direc}/../texplay"
4
+ require 'pry'
5
+
6
+ WIDTH = 640
7
+ HEIGHT = 480
8
+
9
+ class Gosu::Image
10
+ attr_accessor :x, :y
11
+
12
+ alias_method :orig_init, :initialize
13
+ def initialize(*args)
14
+ @x = WIDTH / 2
15
+ @y = HEIGHT / 2
16
+ orig_init(*args)
17
+ end
18
+ end
19
+
20
+ class WinClass < Gosu::Window
21
+
22
+ class View
23
+ attr_accessor :zoom, :rotate
24
+
25
+ def initialize
26
+ @zoom = 1
27
+ @rotate = 0
28
+ end
29
+
30
+ def reset
31
+ @zoom = 1
32
+ @rotate = 0
33
+ end
34
+ end
35
+
36
+ attr_reader :images, :view
37
+
38
+ def initialize
39
+ super(WIDTH, HEIGHT, false)
40
+ Gosu.enable_undocumented_retrofication
41
+
42
+ @images = []
43
+ @view = View.new
44
+ @pry_instance = Pry.new :prompt => [Proc.new { "(live)> " }, Proc.new { "(live)* " }]
45
+
46
+ @img = TexPlay.create_image(self, 200, 200)
47
+ @img.rect 0, 0, @img.width - 1, @img.height - 1
48
+
49
+ images << @img
50
+ @binding = binding
51
+ end
52
+
53
+ def create_image(width, height, options={})
54
+ TexPlay.create_image(self, width, height, options)
55
+ end
56
+
57
+ def load_image(file)
58
+ Gosu::Image.new(self, file)
59
+ end
60
+
61
+ def show_image(image)
62
+ images << image
63
+ end
64
+
65
+ def hide_image(image)
66
+ images.delete(image)
67
+ end
68
+
69
+ def draw
70
+ images.uniq!
71
+ images.each do |v|
72
+ v.draw_rot(v.x, v.y, 1, view.rotate, 0.5, 0.5, view.zoom, view.zoom)
73
+ end
74
+ end
75
+
76
+ def update
77
+ @pry_instance.rep(@binding)
78
+ end
79
+ end
80
+
81
+ w = WinClass.new
82
+
83
+ w.show
84
+
@@ -1,3 +1,3 @@
1
1
  module TexPlay
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,69 +1,52 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: texplay
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.5
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 3
9
- - 3
10
- version: 0.3.3
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - John Mair (banisterfiend)
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-02-22 00:00:00 +13:00
12
+ date: 2011-02-22 00:00:00.000000000 +13:00
19
13
  default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: gosu
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &16942704 !ruby/object:Gem::Requirement
25
18
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 49
30
- segments:
31
- - 0
32
- - 7
33
- - 25
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
34
22
  version: 0.7.25
35
23
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: bacon
39
24
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *16942704
26
+ - !ruby/object:Gem::Dependency
27
+ name: bacon
28
+ requirement: &16942356 !ruby/object:Gem::Requirement
41
29
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 19
46
- segments:
47
- - 1
48
- - 1
49
- - 0
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
50
33
  version: 1.1.0
51
34
  type: :development
52
- version_requirements: *id002
35
+ prerelease: false
36
+ version_requirements: *16942356
53
37
  description: TexPlay is a light-weight image manipulation framework for Ruby and Gosu
54
38
  email: jrmair@gmail.com
55
39
  executables: []
56
-
57
- extensions:
40
+ extensions:
58
41
  - ext/texplay/extconf.rb
59
42
  extra_rdoc_files: []
60
-
61
- files:
43
+ files:
62
44
  - Rakefile
63
45
  - README.markdown
64
46
  - CHANGELOG
65
47
  - lib/texplay/alone.rb
66
48
  - lib/texplay/c_function_docs.rb
49
+ - lib/texplay/live.rb
67
50
  - lib/texplay/version.rb
68
51
  - lib/texplay-contrib.rb
69
52
  - lib/texplay.rb
@@ -146,36 +129,26 @@ files:
146
129
  has_rdoc: true
147
130
  homepage: http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/
148
131
  licenses: []
149
-
150
132
  post_install_message:
151
133
  rdoc_options: []
152
-
153
- require_paths:
134
+ require_paths:
154
135
  - lib
155
- required_ruby_version: !ruby/object:Gem::Requirement
136
+ required_ruby_version: !ruby/object:Gem::Requirement
156
137
  none: false
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- hash: 3
161
- segments:
162
- - 0
163
- version: "0"
164
- required_rubygems_version: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ required_rubygems_version: !ruby/object:Gem::Requirement
165
143
  none: false
166
- requirements:
167
- - - ">="
168
- - !ruby/object:Gem::Version
169
- hash: 3
170
- segments:
171
- - 0
172
- version: "0"
144
+ requirements:
145
+ - - ! '>='
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
173
148
  requirements: []
174
-
175
149
  rubyforge_project:
176
150
  rubygems_version: 1.5.2
177
151
  signing_key:
178
152
  specification_version: 3
179
153
  summary: TexPlay is a light-weight image manipulation framework for Ruby and Gosu
180
154
  test_files: []
181
-