redmocha 0.3.8-java → 0.3.9-java
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/lib/redmocha.rb +12 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a99d950a1fc9a86624a133f444633d92a950529
|
4
|
+
data.tar.gz: bb8ce5a42f6de175bc6f8fdffa90ebb9fe1e8cac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99032598bf0742adbf24d5dcddedb513533d87d0a4532d65187e8c57b93f64253e3a76a292bd32ae797ddfddc3a87b961fd12e14ae646a5c2370bbe1e2226ee4
|
7
|
+
data.tar.gz: bbfb7b78352f92c9f37c1d46c87422fb12882aced6f44909157b64e92d3a62c823eaf438c03d4388097ed97e7161227d83eb8da8d8802365cdbe4760b44a9e8f
|
data/lib/redmocha.rb
CHANGED
@@ -29,36 +29,34 @@ end
|
|
29
29
|
class RMGame
|
30
30
|
include com.badlogic.gdx.ApplicationListener
|
31
31
|
attr_reader :batch, :font, :shape, :config
|
32
|
+
attr_writer :shape_type
|
32
33
|
|
33
34
|
# When Application is first created
|
34
35
|
def create
|
35
36
|
@batch = com.badlogic.gdx.graphics.g2d.SpriteBatch.new
|
36
37
|
@font = com.badlogic.gdx.graphics.g2d.BitmapFont.new
|
38
|
+
@shape = com.badlogic.gdx.graphics.glutils.ShapeRenderer.new
|
37
39
|
end
|
38
40
|
|
39
41
|
# Everytime Appication renders itself
|
40
42
|
def render
|
41
43
|
update
|
42
44
|
@batch.begin
|
43
|
-
|
45
|
+
case @shape_type
|
46
|
+
when :filled
|
47
|
+
@shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Filled)
|
48
|
+
when :point
|
49
|
+
@shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Point)
|
50
|
+
when :line
|
51
|
+
@shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Line)
|
52
|
+
else
|
53
|
+
@shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Filled)
|
54
|
+
end
|
44
55
|
display
|
45
56
|
@shape.end unless @shape.nil?
|
46
57
|
@batch.end
|
47
58
|
end
|
48
59
|
|
49
|
-
# Enable ShapeRenderer
|
50
|
-
def enable_shape_drawer
|
51
|
-
@shape = com.badlogic.gdx.graphics.glutils.ShapeRenderer.new if @shape.nil?
|
52
|
-
end
|
53
|
-
|
54
|
-
# Disable ShapeRenderer
|
55
|
-
def disable_shape_drawer
|
56
|
-
unless @shape.nil?
|
57
|
-
@shape.dispose
|
58
|
-
@shape = nil
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
60
|
# Get rid of resources used by Application
|
63
61
|
def dispose
|
64
62
|
@shape.dispose unless @shape.nil?
|