fidgit 0.0.3alpha → 0.0.4alpha
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/config/default_schema.yml +1 -1
- data/examples/readme_example.rb +31 -31
- data/fidgit.gemspec +4 -4
- data/lib/fidgit/elements/element.rb +7 -2
- data/lib/fidgit/version.rb +1 -1
- metadata +11 -11
data/config/default_schema.yml
CHANGED
data/examples/readme_example.rb
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
require_relative "../lib/fidgit"
|
2
|
-
|
3
|
-
# Normally, you'd load this from the gem using:
|
4
|
-
# require 'fidgit'
|
5
|
-
|
6
|
-
class MyGame < Chingu::Window
|
7
|
-
def initialize
|
8
|
-
super(640, 480, false)
|
9
|
-
|
10
|
-
# To use the Fidgit features, a Fidgit::GuiState must be active.
|
11
|
-
push_game_state MyGuiState
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class MyGuiState < Fidgit::GuiState
|
16
|
-
def initialize
|
17
|
-
super
|
18
|
-
|
19
|
-
# Create a vertically packed section, centred on the window.
|
20
|
-
pack :vertical, align: :center do
|
21
|
-
# Create a label with a dark green background.
|
22
|
-
my_label = label "Hello world!", background_color: Gosu::Color.rgb(0, 100, 0)
|
23
|
-
|
24
|
-
# Create a button that, when clicked, changes the label text.
|
25
|
-
button("Goodbye", align_h: :center, tip: "Press me and be done with it!") do
|
26
|
-
my_label.text = "Goodbye cruel world!"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
1
|
+
require_relative "../lib/fidgit"
|
2
|
+
|
3
|
+
# Normally, you'd load this from the gem using:
|
4
|
+
# require 'fidgit'
|
5
|
+
|
6
|
+
class MyGame < Chingu::Window
|
7
|
+
def initialize
|
8
|
+
super(640, 480, false)
|
9
|
+
|
10
|
+
# To use the Fidgit features, a Fidgit::GuiState must be active.
|
11
|
+
push_game_state MyGuiState
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class MyGuiState < Fidgit::GuiState
|
16
|
+
def initialize
|
17
|
+
super
|
18
|
+
|
19
|
+
# Create a vertically packed section, centred on the window.
|
20
|
+
pack :vertical, align: :center do
|
21
|
+
# Create a label with a dark green background.
|
22
|
+
my_label = label "Hello world!", background_color: Gosu::Color.rgb(0, 100, 0)
|
23
|
+
|
24
|
+
# Create a button that, when clicked, changes the label text.
|
25
|
+
button("Goodbye", align_h: :center, tip: "Press me and be done with it!") do
|
26
|
+
my_label.text = "Goodbye cruel world!"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
32
|
MyGame.new.show
|
data/fidgit.gemspec
CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
22
|
s.require_paths = ["lib"]
|
23
23
|
|
24
|
-
s.add_dependency('gosu', '~>0.7.
|
25
|
-
s.add_dependency('chingu', '~>0.9rc4')
|
26
|
-
s.add_development_dependency('rspec', '~>2.1.0')
|
27
|
-
s.add_development_dependency('texplay', '~>0.3.5')
|
24
|
+
s.add_dependency('gosu', '~> 0.7.28')
|
25
|
+
s.add_dependency('chingu', '~> 0.9rc4')
|
26
|
+
s.add_development_dependency('rspec', '~> 2.1.0')
|
27
|
+
s.add_development_dependency('texplay', '~> 0.3.5')
|
28
28
|
end
|
@@ -108,7 +108,7 @@ module Fidgit
|
|
108
108
|
# @option options [Number] :max_height (value of :height option)
|
109
109
|
#
|
110
110
|
# @option options [String] :tip ('') Tool-tip text
|
111
|
-
# @option options [String] :font_name (
|
111
|
+
# @option options [String, :default] :font_name (:default, which resolves as the default Gosu font)
|
112
112
|
# @option options [String] :font_size (30)
|
113
113
|
#
|
114
114
|
# @option options [Gosu::Color] :background_color (transparent)
|
@@ -172,7 +172,12 @@ module Fidgit
|
|
172
172
|
|
173
173
|
@z = options[:z]
|
174
174
|
@tip = options[:tip].dup
|
175
|
-
@font_name = options[:font_name].
|
175
|
+
@font_name = if options[:font_name].nil? or options[:font_name] == :default
|
176
|
+
Gosu::default_font_name
|
177
|
+
else
|
178
|
+
options[:font_name].dup
|
179
|
+
end
|
180
|
+
|
176
181
|
@font_size = options[:font_size]
|
177
182
|
|
178
183
|
@rect = Chingu::Rect.new(options[:x], options[:y], options[:width] || 0, options[:height] || 0)
|
data/lib/fidgit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fidgit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4alpha
|
5
5
|
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,23 +9,23 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-03-
|
12
|
+
date: 2011-03-23 00:00:00.000000000 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: gosu
|
17
|
-
requirement: &
|
17
|
+
requirement: &26488260 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.7.
|
22
|
+
version: 0.7.28
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *26488260
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: chingu
|
28
|
-
requirement: &
|
28
|
+
requirement: &26479692 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 0.9rc4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *26479692
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rspec
|
39
|
-
requirement: &
|
39
|
+
requirement: &26479404 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 2.1.0
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *26479404
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: texplay
|
50
|
-
requirement: &
|
50
|
+
requirement: &26479128 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: 0.3.5
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *26479128
|
59
59
|
description: Fidgit is a GUI library built on Gosu/Chingu
|
60
60
|
email:
|
61
61
|
- bil.bagpuss@gmail.com
|