minigl 2.1.1 → 2.1.2
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 +4 -4
- data/README.md +2 -2
- data/lib/minigl/game_object.rb +1 -1
- data/test/game.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 747a0bd4b9dd2c916653d3db1e2b317221f872a5e349815dbeeda361ca5ab5c7
|
4
|
+
data.tar.gz: 6bbf77ea8795d6c22643b4c768b5f2c566ab736205088c5eee59e25637dfc845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7c10ddb0bf26f542da3924b5fef29e6843e64fe5f4702ef41d12f83fbca4ba5fd2eafa6a327480afb175fb78c75aaba62219c7527a18334f18dc85a8cfe3af3
|
7
|
+
data.tar.gz: 494c31d51030cea111e48f81bca2538dd094d5ad8d08b776c6ce85353bde32cfbfd83087b13fea857a32ea18fea611e52933be8f5c5d610889bf938d322d59fa
|
data/README.md
CHANGED
@@ -29,6 +29,6 @@ After installing the Gosu dependencies, you can just `gem install minigl`.
|
|
29
29
|
* The [wiki](https://github.com/victords/minigl/wiki) is a work in progress with tutorials and examples.
|
30
30
|
* Test package and examples aren't complete!
|
31
31
|
|
32
|
-
## Version 2.1.
|
32
|
+
## Version 2.1.2
|
33
33
|
|
34
|
-
* Fixed
|
34
|
+
* Fixed `GameObject#draw` when rotated and scaled.
|
data/lib/minigl/game_object.rb
CHANGED
@@ -271,7 +271,7 @@ module MiniGL
|
|
271
271
|
o_y = center_y - @y - @img_gap.y
|
272
272
|
@img[@img_index].draw_rot @x + (flip == :horiz ? -1 : 1) * (@img_gap.x + o_x) - (map ? map.cam.x : 0),
|
273
273
|
@y + (flip == :vert ? -1 : 1) * (@img_gap.y + o_y) - (map ? map.cam.y : 0),
|
274
|
-
z_index, angle, o_x.to_f / @img[0].width, o_y.to_f / @img[0].height,
|
274
|
+
z_index, angle, o_x.to_f / (@img[0].width * scale_x), o_y.to_f / (@img[0].height * scale_y),
|
275
275
|
(flip == :horiz ? -scale_x : scale_x), (flip == :vert ? -scale_y : scale_y), color
|
276
276
|
else
|
277
277
|
x = @x + (flip == :horiz ? -1 : 1) * @img_gap.x - (map ? map.cam.x : 0) + (flip == :horiz ? @w : 0)
|
data/test/game.rb
CHANGED
@@ -6,7 +6,7 @@ class MyGame < GameWindow
|
|
6
6
|
super 800, 600, false
|
7
7
|
|
8
8
|
# @img = Res.img :img1
|
9
|
-
@obj1 = GameObject.new
|
9
|
+
@obj1 = GameObject.new 75, 75, 60, 60, :square3, Vector.new(-75, -75)
|
10
10
|
@obj2 = Sprite.new 400, 0, :img1
|
11
11
|
@obj3 = GameObject.new 4, 50, 24, 24, :check, Vector.new(-4, -4), 2, 4
|
12
12
|
@obj3.set_animation 1
|
@@ -100,7 +100,7 @@ class MyGame < GameWindow
|
|
100
100
|
clear 0xabcdef
|
101
101
|
|
102
102
|
# @img.draw_rot 400, 100, 0, @angle, 1, 1
|
103
|
-
@obj1.draw color: 0x33ff33, angle: (@angle == 0 ? nil : @angle)
|
103
|
+
@obj1.draw color: 0x33ff33, angle: (@angle == 0 ? nil : @angle), scale_x: 1.5, scale_y: 1.5
|
104
104
|
@obj2.draw angle: (@angle == 0 ? nil : @angle), scale_x: 0.5, scale_y: 1.4
|
105
105
|
@obj3.draw flip: @flip
|
106
106
|
@obj4.draw round: true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minigl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor David Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gosu
|