banister-texplay 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,13 @@
1
+ 8/9/09
2
+ version 0.2.2
3
+ * fixed color_control bug, action_struct->color was being overwritten (now using a temp).
4
+ * fixed faulty error msg where max tex size was being displayed as 1024 but is actually 1022
5
+ * added :start_angle parameter to ngon action
6
+ * fixed example screen height from 769 to 768
7
+ * arity of -1 and 0 now supported for color_control procs
8
+ * fixed parameter checks for circle and ngon
9
+ * updated documentation to reflect changes, and added details on caching
10
+
1
11
  2/9/09
2
12
  version 0.2.1
3
13
  * releasing a gem for TexPlay
@@ -0,0 +1,35 @@
1
+ ![Alt text](https://dl.getdropbox.com/u/239375/texplay.png)
2
+
3
+ *an image manipulation tool for ruby and gosu*
4
+
5
+ INSTRUCTIONS
6
+ ============
7
+
8
+ **TexPlay version 0.2.2**
9
+
10
+ Gem installation:
11
+
12
+ + sudo gem install texplay
13
+
14
+ To compile TexPlay from source, ensure you are in the directory with the Rakefile and type:
15
+
16
+ + rake
17
+
18
+ OR
19
+
20
+ + rake19 (assuming this is the name of your 1.9.1 version of rake)
21
+
22
+ **NB:** be sure to run the version of rake that corresponds to the ruby version you wish to use! on my system I use rake19 for ruby 1.9.1!
23
+
24
+ If all goes well, run the example programs:
25
+
26
+ + cd examples
27
+ + ruby example_melt.rb
28
+ + ruby example_simple.rb
29
+ + ..etc
30
+
31
+ + like any gosu application, gosu.so must be in the current directory (or the gosu gem installed) when running the examples.
32
+
33
+
34
+ ---
35
+ Enjoy!
data/README1st CHANGED
@@ -1,6 +1,6 @@
1
1
  INSTRUCTIONS
2
2
 
3
- TexPlay version 0.2.1
3
+ TexPlay version 0.2.2
4
4
 
5
5
  *Ensure that ctexplay.so and gosu.so, and texplay.rb and texplay-contrib.rb are in the working directory for your project
6
6
  *require 'texplay' in your ruby program to access the TexPlay module
data/Rakefile CHANGED
@@ -26,9 +26,9 @@ task :build => :clean do
26
26
 
27
27
  if RUBY_PLATFORM =~ /mswin/
28
28
  if RUBY_VERSION =~ /1.9/
29
- File.rename("../lib/ctexplay.#{dlext}", "../lib/ctexplay19.#{$dlext}")
29
+ File.rename("../lib/ctexplay.#{$dlext}", "../lib/ctexplay.19.#{$dlext}")
30
30
  else
31
- File.rename("../lib/ctexplay.#{dlext}", "../lib/ctexplay18.#{$dlext}")
31
+ File.rename("../lib/ctexplay.#{$dlext}", "../lib/ctexplay.18.#{$dlext}")
32
32
  end
33
33
  end
34
34
  puts "(5) ...done!"
@@ -38,8 +38,8 @@ end
38
38
  specification = Gem::Specification.new do |s|
39
39
  s.name = "texplay"
40
40
  s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu"
41
- s.version = "0.2.1"
42
- s.date = "2009-09-02"
41
+ s.version = "0.2.2"
42
+ s.date = "2009-09-09"
43
43
  s.author = "John Mair (banisterfiend)"
44
44
  s.email = 'jrmair@gmail.com'
45
45
  s.description = s.summary
@@ -47,13 +47,13 @@ specification = Gem::Specification.new do |s|
47
47
  s.add_dependency("gosu",">=0.7.14")
48
48
  s.homepage = "http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/"
49
49
  s.has_rdoc = false
50
- s.files = ["Rakefile", "README", "CHANGELOG", "README1st",
50
+ s.files = ["Rakefile", "README.markdown", "CHANGELOG", "README1st",
51
51
  "lib/texplay.rb", "lib/texplay-contrib.rb"] +
52
52
  FileList["src/*", "examples/*.rb", "examples/media/*"].to_a
53
53
 
54
54
  if RUBY_PLATFORM =~ /mswin/
55
55
  s.platform = Gem::Platform::CURRENT
56
- s.files += ["lib/ctexplay18.so", "lib/ctexplay19.so"]
56
+ s.files += ["lib/ctexplay.18.so", "lib/ctexplay.19.so"]
57
57
 
58
58
  else
59
59
  s.platform = Gem::Platform::RUBY
@@ -6,26 +6,26 @@ end
6
6
  require 'texplay'
7
7
 
8
8
  # setup will be executed straight after Gosu::Image instantiation
9
- TexPlay.on_setup do
9
+ TexPlay::on_setup do
10
10
  @turtle_pos = TexPlay::TPPoint.new(width / 2, height / 2 )
11
11
  @turtle_angle = 0
12
12
  end
13
13
 
14
- TexPlay.create_macro(:move_to) do |x, y|
14
+ TexPlay::create_macro(:move_to) do |x, y|
15
15
  capture {
16
16
  @turtle_pos.x = x
17
17
  @turtle_pos.y = y
18
18
  }
19
19
  end
20
20
 
21
- TexPlay.create_macro(:move_rel) do |dx, dy|
21
+ TexPlay::create_macro(:move_rel) do |dx, dy|
22
22
  capture {
23
23
  @turtle_pos.x += dx
24
24
  @turtle_pos.y += dy
25
25
  }
26
26
  end
27
27
 
28
- TexPlay.create_macro(:line_to) do |x, y, *other|
28
+ TexPlay::create_macro(:line_to) do |x, y, *other|
29
29
  capture {
30
30
  line(@turtle_pos.x, @turtle_pos.y, x, y, *other)
31
31
 
@@ -33,7 +33,7 @@ TexPlay.create_macro(:line_to) do |x, y, *other|
33
33
  }
34
34
  end
35
35
 
36
- TexPlay.create_macro(:line_rel) do |dx, dy, *other|
36
+ TexPlay::create_macro(:line_rel) do |dx, dy, *other|
37
37
  capture {
38
38
  x = @turtle_pos.x + dx
39
39
  y = @turtle_pos.y + dy
@@ -44,19 +44,19 @@ TexPlay.create_macro(:line_rel) do |dx, dy, *other|
44
44
  }
45
45
  end
46
46
 
47
- TexPlay.create_macro(:turn_to) do |a|
47
+ TexPlay::create_macro(:turn_to) do |a|
48
48
  capture {
49
49
  @turtle_angle = a
50
50
  }
51
51
  end
52
52
 
53
- TexPlay.create_macro(:turn) do |da|
53
+ TexPlay::create_macro(:turn) do |da|
54
54
  capture {
55
55
  @turtle_angle += da
56
56
  }
57
57
  end
58
58
 
59
- TexPlay.create_macro(:forward) do |dist, *other|
59
+ TexPlay::create_macro(:forward) do |dist, *other|
60
60
  capture {
61
61
  visible = other.shift
62
62
 
@@ -10,16 +10,16 @@ require 'rbconfig'
10
10
  require 'gosu'
11
11
 
12
12
  module TexPlay
13
- TEXPLAY_VERSION = "0.2.1"
13
+ TEXPLAY_VERSION = "0.2.2"
14
14
 
15
- def self.on_setup(&block)
15
+ def self::on_setup(&block)
16
16
  raise "need a block" if !block
17
17
 
18
18
  @__init_procs__ ||= []
19
19
  @__init_procs__.push(block)
20
20
  end
21
21
 
22
- def self.setup(receiver)
22
+ def self::setup(receiver)
23
23
  if @__init_procs__ then
24
24
  @__init_procs__.each do |init_proc|
25
25
  receiver.instance_eval(&init_proc)
@@ -27,7 +27,7 @@ module TexPlay
27
27
  end
28
28
  end
29
29
 
30
- def self.create_blank_image(window, width, height)
30
+ def self::create_blank_image(window, width, height)
31
31
  Gosu::Image.new(window, EmptyImageStub.new(width, height))
32
32
  end
33
33
 
@@ -37,7 +37,7 @@ module TexPlay
37
37
  Blue = [0, 0, 1, 1]
38
38
  Black = [0, 0, 0, 1]
39
39
  White = [1, 1, 1, 1]
40
- Grey = [0.5, 0.5, 0.5, 0.5]
40
+ Grey = [0.5, 0.5, 0.5, 1]
41
41
  Alpha = [0, 0, 0, 0]
42
42
  Purple = [1, 0, 1, 1]
43
43
  Yellow = [1, 1, 0, 1]
@@ -52,8 +52,8 @@ end
52
52
 
53
53
  # credit to philomory for this class
54
54
  class EmptyImageStub
55
- def initialize(w,h)
56
- @w, @h = w, h;
55
+ def initialize(w, h)
56
+ @w, @h = w, h
57
57
  end
58
58
 
59
59
  def to_blob
@@ -74,9 +74,9 @@ direc = File.dirname(__FILE__)
74
74
  dlext = Config::CONFIG['DLEXT']
75
75
  begin
76
76
  if RUBY_VERSION && RUBY_VERSION =~ /1.9/
77
- require "#{direc}/ctexplay19.#{dlext}"
77
+ require "#{direc}/ctexplay.19.#{dlext}"
78
78
  else
79
- require "#{direc}/ctexplay18.#{dlext}"
79
+ require "#{direc}/ctexplay.18.#{dlext}"
80
80
  end
81
81
  rescue LoadError => e
82
82
  require "#{direc}/ctexplay.#{dlext}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: banister-texplay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mair (banisterfiend)
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-02 00:00:00 -07:00
12
+ date: 2009-09-09 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ extra_rdoc_files: []
32
32
 
33
33
  files:
34
34
  - Rakefile
35
- - README
35
+ - README.markdown
36
36
  - CHANGELOG
37
37
  - README1st
38
38
  - lib/texplay.rb
data/README DELETED
@@ -1,21 +0,0 @@
1
- INSTRUCTIONS
2
-
3
- TexPlay version 0.2.1
4
-
5
- To compile TexPlay, ensure you are in the directory with the Rakefile and type:
6
- => rake
7
- OR
8
- => rake19 (assuming this is the name of your 1.9.1 version of rake)
9
-
10
- !!NB!! be sure to run the version of rake that corresponds to the ruby version you wish to use! on my system I use rake19 for ruby 1.9.1!!
11
-
12
- If all goes well, run the example programs:
13
- => cd examples
14
- => ruby example_melt.rb
15
- => ruby example_simple.rb
16
- => ..etc
17
-
18
- *like any gosu application, gosu.so must be in the current directory (or the gosu gem installed) when running the examples.
19
-
20
- Enjoy!
21
- (note that TexPlay has only been tested on 32 bit linux systems and WindowsXP using VS 6.0)