frogmatic-gui 0.0.0
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.
- checksums.yaml +7 -0
- data/lib/frogmatic-gui.rb +3 -0
- data/lib/gui/button.rb +36 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 727078852ca91de53f64082ae7c7eb19da7859282e4c386085839ea43426ced2
|
4
|
+
data.tar.gz: c2b96ccf0ae15a294a066648d7b10aaef23b2d302cfedccf83d8f94cbee4faf3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5d6ef21e965519862494ffb0006f65090db47b2f9e8e43d9904026b619b1032e3ddad18f05354fa78914ce4b86a4f33d25869b2d0cc9bbe54af4b605e2d45d0d
|
7
|
+
data.tar.gz: a4e1692f19606b15b8356b948e6a0a48d88777668baae8006ae49299ec36ec2aded89e6a0990574152976df06a009f83e5b02dcee5305e6fb126f70180d40a65
|
data/lib/gui/button.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
module Frogmatic
|
3
|
+
module Gui
|
4
|
+
|
5
|
+
class Button
|
6
|
+
attr_accessor :x,:y,:height,:width,:background
|
7
|
+
|
8
|
+
def initialize(x:,y:,width:,height:,background:,callback:)
|
9
|
+
@x = x
|
10
|
+
@y = y
|
11
|
+
@width = width
|
12
|
+
@height = height
|
13
|
+
@background = background
|
14
|
+
|
15
|
+
Image.new(
|
16
|
+
@background,
|
17
|
+
x: @x,
|
18
|
+
y: @y,
|
19
|
+
width: @width,
|
20
|
+
height: @height,
|
21
|
+
color: [1.0, 0.5, 0.2, 1.0],
|
22
|
+
rotate: 90,
|
23
|
+
z: 10
|
24
|
+
)
|
25
|
+
|
26
|
+
Window.on :mouse_down do |event|
|
27
|
+
if (event.x > @x && event.x < @x+@width && event.y > @y && event.y < @y+@height)
|
28
|
+
callback.call
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: frogmatic-gui
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bret Kittle
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-04-29 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/frogmatic-gui.rb
|
20
|
+
- lib/gui/button.rb
|
21
|
+
homepage:
|
22
|
+
licenses: []
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.7.6
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: frogmatic-gui is a gui gem for ruby2d
|
44
|
+
test_files: []
|