sabrina 0.5.5.5 → 0.5.5.6
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.
- data/README.rdoc +55 -24
- data/lib/sabrina/meta.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -12,30 +12,61 @@ Documentation:: http://rubydoc.info/gems/sabrina/frames
|
|
12
12
|
|
13
13
|
== Example use
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
15
|
+
=== Basic usage
|
16
|
+
|
17
|
+
require 'sabrina'
|
18
|
+
|
19
|
+
include Sabrina
|
20
|
+
|
21
|
+
r = Rom.new "Decap and Attack Rombase 1.5.gba"
|
22
|
+
# => MrDollSteak's Decap and Attack Rombase [MrDS]
|
23
|
+
|
24
|
+
m = Monster.new r, 36 # => 36. Clef/name redacted/
|
25
|
+
|
26
|
+
m.stats.to_json
|
27
|
+
# =>
|
28
|
+
# {
|
29
|
+
# "36": {
|
30
|
+
# "stats": {
|
31
|
+
# "hp": 95,
|
32
|
+
# "attack": 70,
|
33
|
+
# "defense": 73,
|
34
|
+
# "speed": 60,
|
35
|
+
# "sp_atk": 85,
|
36
|
+
# "sp_def": 90,
|
37
|
+
# "type_1": "23 (Fairy)",
|
38
|
+
# /output truncated/
|
39
|
+
|
40
|
+
m.save_spritesheet
|
41
|
+
# => #<File:Decap and Attack Rombase 1.5_files/036.png (closed)>
|
42
|
+
|
43
|
+
r.close # => 0
|
44
|
+
|
45
|
+
=== Copy sprites between ROMs
|
46
|
+
|
47
|
+
require 'benchmark'
|
48
|
+
require 'sabrina'
|
49
|
+
|
50
|
+
include Sabrina
|
51
|
+
|
52
|
+
r1 = Rom.new 'Moemon FireRed (1.5).gba'
|
53
|
+
r2 = Rom.new 'Ruby (E).gba'
|
54
|
+
|
55
|
+
puts "Copying sprites from #{r1} to #{r2}."
|
56
|
+
|
57
|
+
b = Benchmark.measure do
|
58
|
+
(1..414).each do |i|
|
59
|
+
m = Monster.new r1, i
|
60
|
+
print "#{ m.to_s.ljust(20, ' ') }\r"
|
61
|
+
m.rom = r2
|
62
|
+
m.write_spritesheet
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
r1.close
|
67
|
+
r2.close
|
68
|
+
|
69
|
+
puts "\nTook #{b.real} seconds."
|
39
70
|
|
40
71
|
== Sabrina is...
|
41
72
|
|
data/lib/sabrina/meta.rb
CHANGED