motion-game 1.1.8 → 1.1.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffc88fa4473419e87f074c22ea72535fe8ae7588
4
- data.tar.gz: 85cd4fd811f5e27b7ead9d4792edfb392b4e6e8c
3
+ metadata.gz: 1fe4d6f3e6665673b75852e0fe4491b671de4fe4
4
+ data.tar.gz: bd8ae679a99cf8c179c73e54e93dea71e066ef73
5
5
  SHA512:
6
- metadata.gz: b9415f33a182c8af28d09686276345082c0d636c4c9e441871e0e5e19e2c2f782f37c3ffbee54915071e2d021b3e620259a893e7ad8590f956677cfe4fc111e6
7
- data.tar.gz: cb2b1c471dfa2c2c954c9c85fa16a616fbacd5b37d94eedffd59bc1ced734569831e92f8d4842b5c30dea4500a69fac4d8b742ec061d6c7ccbc79a05d298d228
6
+ metadata.gz: 99f6560551329cf563728e7f840973a08350ca2c8eff5056aea5ac1a831b79bc378c760247ed3edd01205f23104f607cee5f33386eae688bad033e0a07dcaf88
7
+ data.tar.gz: d9de77c4c3e47dd155c2386ae97d34bc85c3ca5f4b7c5f1644f46f970520478273a0bcb80ad2e9830f159cb4884842108e91d992bfb14ab10135d885403a5437
data/.document CHANGED
@@ -1,2 +1 @@
1
- README.md
2
1
  doc/API_reference.rb
Binary file
Binary file
Binary file
Binary file
data/doc/API_reference.rb CHANGED
@@ -20,12 +20,9 @@ class Action < Object
20
20
  # @return [Action] the cloned action.
21
21
  def clone; end
22
22
 
23
-
24
- # @group Properties
25
-
26
23
  # Whether the action is done.
27
24
  # @return [Boolean] whether the action is done.
28
- attr_accessor :done?
25
+ def done?; end
29
26
 
30
27
  end
31
28
 
@@ -376,11 +373,9 @@ class Audio < Object
376
373
  # @param volume [Float] the audio volume that should be used to play this
377
374
  # this sound file, as a +0.0+ to +1.0+ Float range.
378
375
  # @return [Audio] an Audio instance.
376
+ # @endgroup
379
377
  def self.play(path, loop=false, volume=1.0); end
380
378
 
381
-
382
- # @group Instance Method Summary
383
-
384
379
  # @return [Boolean] whether the sound file should loop.
385
380
  def loop?; end
386
381
 
@@ -402,15 +397,9 @@ class Audio < Object
402
397
  # @param value [Float] the position
403
398
  def current_position=(value); end
404
399
 
405
-
406
- # @group Properties
407
-
408
400
  # @return [Float] the duration left in the sound file.
409
401
  attr_reader :duration
410
402
 
411
-
412
- # @group Instance Method Summary
413
-
414
403
  # Resumes playing the sound file.
415
404
  # @return [Audio] the receiver.
416
405
  def resume; end
@@ -481,29 +470,29 @@ class Director < Object
481
470
 
482
471
  # Stops the animation.
483
472
  # @return [Director] the receiver.
473
+ # @endgroup
484
474
  def stop_animation; end
485
475
 
486
-
487
- # @group Properties
488
-
489
476
  # @return [Point] the visible origin of the director view in points.
490
477
  attr_reader :origin
491
478
 
492
479
  # @return [Size] the visible size of the director view in points.
493
480
  attr_reader :size
494
481
 
482
+ # @param value [Boolean] true if display the FPS label.
483
+ # Controls whether the FPS (frame-per-second) statistic label is displayed
484
+ # in the bottom-left corner of the director view. By default it is hidden.
485
+ def show_stats=(value); end
486
+
495
487
  # Controls whether the FPS (frame-per-second) statistic label is displayed
496
488
  # in the bottom-left corner of the director view. By default it is hidden.
497
489
  # @return [Boolean] whether the FPS label is displayed.
498
- attr_accessor :show_stats?
490
+ def show_stats?; end
499
491
 
500
492
  end
501
493
  # This class represents an event received from the accelerometer sensor of
502
494
  # the device, usually from the {Scene#on_accelerate} method.
503
495
  class Events::Acceleration < Object
504
-
505
- # @group Properties
506
-
507
496
  # @return [Float] the x coordinate of the acceleration event.
508
497
  attr_reader :x
509
498
 
@@ -520,9 +509,6 @@ end
520
509
  # This class represents a touch event receive from the device, usually from
521
510
  # the {Scene#on_touch_begin} method.
522
511
  class Events::Touch < Object
523
-
524
- # @group Properties
525
-
526
512
  # @return [Point] the current location of the touch event.
527
513
  attr_reader :location
528
514
 
@@ -623,25 +609,28 @@ class Scene < Node
623
609
  # @yield [Events::PhysicsContact] the given block will be yield when a
624
610
  # contact event is received from the physics engine.
625
611
  # @return [Scene] the receiver.
612
+ # @endgroup
626
613
  def on_contact_begin; end
627
614
 
628
-
629
- # @group Properties
630
-
631
615
  # @return [Point] the gravity of the scene's physics world.
632
616
  attr_accessor :gravity
633
617
 
634
618
  # @return [Boolean] whether the physics engine should draw debug lines.
635
- attr_accessor :debug_physics?
619
+ def debug_physics?; end
620
+
621
+ # Set to draw the debug line.
622
+ # @param value [Boolean] true if draw debug lines.
623
+ def debug_physics=(value); end
624
+
625
+ # Set background color for scene.
626
+ # @param color [Color] background color for scene.
627
+ def background_color=(color); end
636
628
 
637
629
  end
638
630
  # A Menu is a way to navigate through game options.
639
631
  # Menus often contain options like Play, Quit, Settings and About.
640
632
  # This is usually in the form of buttons that are pressed.
641
633
  class Menu < Object
642
-
643
- # @group Miscellaneous
644
-
645
634
  # aligns menu items vertically with padding
646
635
  # (call after adding items via image_item)
647
636
  # @param padding [Float] the amount of padding between the items.
@@ -654,21 +643,25 @@ class Menu < Object
654
643
  # @return [Menu] the receiver.
655
644
  def align_items_horizontally(padding=null); end
656
645
 
657
-
658
- # @group Properties
659
-
660
646
  # Whether the menu is enabled. When enabled, a menu can be
661
647
  # touched or clicked. By default, a menu is enabled.
662
648
  # @return [Boolean] whether the menu is enabled.
663
- attr_accessor :enabled?
649
+ def enabled?; end
650
+
651
+ # Enable or disable a menu item.
652
+ # @param value [Boolean] true if enable an item.
653
+ def enabled=(value); end
654
+
655
+ # Create a menu item with a normal and selected images.
656
+ # @param normal_image [String] normal image name.
657
+ # @param selected_image [String] selected image name.
658
+ # @yield The methods to call when tapped menu.
659
+ def image_item(normal_image, selected_image); end
664
660
 
665
661
  end
666
662
  # Node is the base class of objects in the scene graph. You should not
667
663
  # instantiate this class directly but use a subclass instead.
668
664
  class Node < Object
669
-
670
- # @group Properties
671
-
672
665
  # The anchor point of the node, as a set of percentage coordinates.
673
666
  # The anchor point represents where the node will be attached to its parent,
674
667
  # and is normalized as a percentage. +[0, 0]+ means the bottom-left corner,
@@ -685,9 +678,13 @@ class Node < Object
685
678
  # @return [Size] the content size of the node.
686
679
  attr_accessor :size
687
680
 
681
+ # Set whether the node is visible.
682
+ # @param value [Boolean] true if display the node.
683
+ def visible=(value); end
684
+
688
685
  # @return [Boolean] whether the node should be visible. The default value is
689
686
  # true.
690
- attr_accessor :visible?
687
+ def visible?; end
691
688
 
692
689
  # @return [Float] the opacity (alpha) level of the node, as a Float from the
693
690
  # +0.0+ to +1.0+ range.
@@ -714,11 +711,9 @@ class Node < Object
714
711
  # @return [String] a name to easily identify the node in the graph.
715
712
  attr_accessor :name
716
713
 
717
-
718
- # @group Miscellaneous
719
-
720
714
  # Run the provided action on the receiver node.
721
715
  # @return [Node] the receiver.
716
+ # @yield if passed a block, the block will be called for the action.
722
717
  def run_action(action); end
723
718
 
724
719
  # Stop all actions running on the node
@@ -837,9 +832,6 @@ class Particle < Node
837
832
  # @param file_name [String] the name of the property list particle file.
838
833
  def initialize(file_name=nil); end
839
834
 
840
-
841
- # @group Properties
842
-
843
835
  # @return [String] the path of the texture file.
844
836
  attr_writer :texture
845
837
 
@@ -908,12 +900,14 @@ class Sprite < Node
908
900
  # current location.
909
901
  # @param interval [Float] the animation interval.
910
902
  # @return [Sprite] the receiver.
903
+ # @yield if passed a block, the block will be called for the action.
911
904
  def move_by(delta_location, interval); end
912
905
 
913
906
  # Moves the position of the receiver to a new given location.
914
907
  # @param location [Point] where the receiver should be moved to.
915
908
  # @param interval [Float] the animation interval.
916
909
  # @return [Sprite] the receiver.
910
+ # @yield if passed a block, the block will be called for the action.
917
911
  def move_to(location, interval); end
918
912
 
919
913
  # Rotates the position of the receiver to a new angle determined by the
@@ -921,6 +915,7 @@ class Sprite < Node
921
915
  # @param delta_angle [Float] the angle to add to the current rotation
922
916
  # @param interval [Float] the animation interval.
923
917
  # @return [Sprite] the receiver.
918
+ # @yield if passed a block, the block will be called for the action.
924
919
  def rotate_by(delta_angle, interval); end
925
920
 
926
921
  # Rotates the angle of the receiver to a new angle certain angle
@@ -928,6 +923,7 @@ class Sprite < Node
928
923
  # @param angle [Float] the receiver should be rotated to.
929
924
  # @param interval [Float] the animation interval.
930
925
  # @return [Sprite] the receiver.
926
+ # @yield if passed a block, the block will be called for the action.
931
927
  def rotate_to(angle, interval); end
932
928
 
933
929
  # Blinks the receiver.
@@ -935,6 +931,7 @@ class Sprite < Node
935
931
  # blink.
936
932
  # @param interval [Float] the animation interval.
937
933
  # @return [Sprite] the receiver.
934
+ # @yield if passed a block, the block will be called for the action.
938
935
  def blink(number_of_blinks, interval); end
939
936
 
940
937
  # Starts an animation where the sprite display frame will be changed to
@@ -948,6 +945,7 @@ class Sprite < Node
948
945
  # @param loops [Integer, Symbol] the number of times the animation should
949
946
  # loop. If given the +:forever+ symbol, the animation will loop forever.
950
947
  # @return [Sprite] the receiver.
948
+ # @yield if passed a block, the block will be called for the action.
951
949
  def animate(frame_names, delay, loops=1); end
952
950
 
953
951
  # Sets whether the sprite should be flipped horizontally or not. It only flips
@@ -956,7 +954,7 @@ class Sprite < Node
956
954
  # @param value [Boolean] true if the sprite should be flipped horizontally, false otherwise.
957
955
  def flipped_horizontally=(value); end
958
956
 
959
- # This is alias method of "#flipped_horizontally=".
957
+ # This is alias method of {#flipped_horizontally=}.
960
958
  def flipped_x=(value); end
961
959
 
962
960
  # Sets whether the sprite should be flipped vertically or not. It only flips
@@ -965,7 +963,7 @@ class Sprite < Node
965
963
  # @param value [Boolean] true if the sprite should be flipped vertically, false otherwise.
966
964
  def flipped_vertically=(value); end
967
965
 
968
- # This is alias method of "#flipped_vertically=".
966
+ # This is alias method of {#flipped_vertically=}.
969
967
  def flipped_y=(value); end
970
968
 
971
969
 
@@ -985,22 +983,28 @@ class Sprite < Node
985
983
  # Applies an immediate force to the sprite body.
986
984
  # @param force [Point] the force to apply.
987
985
  # @return [Sprite] the receiver.
986
+ # @endgroup
988
987
  def apply_force(force); end
989
988
 
990
-
991
- # @group Properties
992
-
993
989
  # @return [Float] the body mass of the sprite.
994
990
  attr_accessor :mass
995
991
 
996
992
  # @return [Boolean] whether the sprite should be affected by the scene's
997
993
  # gravitational force. The default is +true+.
998
- attr_accessor :gravitates?
994
+ def gravitates?; end
995
+
996
+ # Set the body is affected by the physics world's gravitational force or not.
997
+ # @param value[Boolean] true if enable gravitational force.
998
+ def gravitates=(value); end
999
999
 
1000
1000
  # @return [Boolean] whether the sprite body should be dynamic or not in the
1001
1001
  # physics world. The default is +true+, and a dynamic body will affect
1002
1002
  # with gravity.
1003
- attr_accessor :dynamic?
1003
+ def dynamic?; end
1004
+
1005
+ # Set dynamic to body.
1006
+ # @param value [Boolean] true if the sprite body should be dynamic.
1007
+ def dynamic=(value); end
1004
1008
 
1005
1009
  # @return [Float] the linear damping / air friction force on the sprite body.
1006
1010
  attr_accessor :friction
@@ -1009,7 +1013,11 @@ class Sprite < Node
1009
1013
  attr_accessor :velocity
1010
1014
 
1011
1015
  # @return [Boolean] whether the body is at rest.
1012
- attr_accessor :resting?
1016
+ def resting?; end
1017
+
1018
+ # Set body to rest
1019
+ # @param value [Boolean] true if rest the body.
1020
+ def resting=(value); end
1013
1021
 
1014
1022
  # @return [Float] the moment of inertia of the body.
1015
1023
  attr_accessor :inertia_moment
@@ -1035,9 +1043,6 @@ end
1035
1043
  # point.y = 20
1036
1044
  # node.location = point
1037
1045
  class Point < Object
1038
-
1039
- # @group Properties
1040
-
1041
1046
  # @return [Float] the x coordinate of the point.
1042
1047
  attr_accessor :x
1043
1048
 
@@ -1070,9 +1075,6 @@ end
1070
1075
  # size.y = 400
1071
1076
  # node.size = size
1072
1077
  class Size < Object
1073
-
1074
- # @group Properties
1075
-
1076
1078
  # @return [Float] the size width.
1077
1079
  attr_accessor :width
1078
1080
 
@@ -1128,9 +1130,6 @@ end
1128
1130
  # +:green+ and +:blue+.
1129
1131
  # The +MG::Color.new+ constructor will return the black color.
1130
1132
  class Color < Object
1131
-
1132
- # @group Properties
1133
-
1134
1133
  # @return [Float] the red portion of the color, from +0.0+ to +1.0+.
1135
1134
  attr_accessor :red
1136
1135
 
@@ -1147,22 +1146,36 @@ end
1147
1146
  # The base class for all UI widgets. You should not instantiate this class
1148
1147
  # directly but use a subclass instead.
1149
1148
  class Widget < Node
1150
-
1151
- # @group Properties
1152
-
1153
1149
  # Whether the widget is enabled. When enabled, a widget can be
1154
1150
  # touched or clicked. By default, a widget is enabled.
1155
1151
  # @return [Boolean] whether the widget is enabled.
1156
- attr_accessor :enabled?
1152
+ def enabled?; end
1153
+
1154
+ # Set whether the widget is enabled.
1155
+ # @param value [Boolean] true if the widget is enabled,
1156
+ # widget may be touched , false if the widget is disabled,
1157
+ # widget cannot be touched.
1158
+ # The default value is true, a widget is default to enabled
1159
+ def enabled=(value); end
1157
1160
 
1158
1161
  # Whether the widget is touch enabled. When touch enabled, a widget supports
1159
1162
  # on_touch. By default, a widget is not touch enabled.
1160
1163
  # @return [Boolean] whether the widget is touch enabled.
1161
- attr_accessor :touch_enabled?
1164
+ def touch_enabled?; end
1165
+
1166
+ # Set whether the widget is touch enabled.
1167
+ # @param value [Boolean] true if the widget is touch enabled,
1168
+ # false if the widget is touch disabled.
1169
+ def touch_enabled=(value); end
1162
1170
 
1163
1171
  # Whether the widget is highlighted. By default, a widget is not highlighted.
1164
1172
  # @return [Boolean] whether the widget is highlighted.
1165
- attr_accessor :highlighted?
1173
+ def highlighted?; end
1174
+
1175
+ # Set whether the widget is hilighted.
1176
+ # @param value [Boolean] true if the widget is hilighted,
1177
+ # false if the widget is not hilighted.
1178
+ def highlighted=(value); end
1166
1179
 
1167
1180
 
1168
1181
  # @group Events
@@ -1185,11 +1198,9 @@ class Text < Widget
1185
1198
  # @param text [String] content for the text widget.
1186
1199
  # @param font [String] name of the font the text widget should use.
1187
1200
  # @param font_size [Integer] size of the font the text widget should use.
1201
+ # @endgroup
1188
1202
  def initialize(text='', font='', font_size=0); end
1189
1203
 
1190
-
1191
- # @group Properties
1192
-
1193
1204
  # @return [String] content of the widget.
1194
1205
  attr_accessor :text
1195
1206
 
@@ -1222,11 +1233,9 @@ class Button < Widget
1222
1233
 
1223
1234
  # Creates a new Button widget with an optional title.
1224
1235
  # @param title [String] title for the button.
1236
+ # @endgroup
1225
1237
  def initialize(title=''); end
1226
1238
 
1227
-
1228
- # @group Properties
1229
-
1230
1239
  # @return [String] title of the button.
1231
1240
  attr_accessor :text
1232
1241
 
@@ -1243,6 +1252,18 @@ class Button < Widget
1243
1252
  # presses it.
1244
1253
  attr_accessor :zoom_scale
1245
1254
 
1255
+ # Load normal state texture for button.
1256
+ # @param name [String] A texture name.
1257
+ def load_texture_normal(name); end
1258
+
1259
+ # Load selected state texture for button.
1260
+ # @param name [String] A texture name.
1261
+ def load_texture_pressed(name); end
1262
+
1263
+ # Load disabled state texture for button.
1264
+ # @param name [String] A texture name.
1265
+ def load_texture_disabled(name); end
1266
+
1246
1267
  end
1247
1268
 
1248
1269
  class Slider < Widget
@@ -1250,11 +1271,9 @@ class Slider < Widget
1250
1271
  # @group Constructors
1251
1272
 
1252
1273
  # Creates a new Slider widget.
1274
+ # @endgroup
1253
1275
  def initialize; end
1254
1276
 
1255
-
1256
- # @group Properties
1257
-
1258
1277
  # @return [Integer] the progress direction of the slider, as a percentage
1259
1278
  # value from +1+ to +100+.
1260
1279
  attr_accessor :progress
@@ -1266,11 +1285,9 @@ class Layout < Widget
1266
1285
  # @group Constructors
1267
1286
 
1268
1287
  # Creates a new List widget.
1288
+ # @endgroup
1269
1289
  def initialize; end
1270
1290
 
1271
-
1272
- # @group Properties
1273
-
1274
1291
  # @return [:absolute, :vertical, :horizontal, :relative] the layout type.
1275
1292
  attr_accessor :type
1276
1293
 
@@ -1279,7 +1296,18 @@ class Layout < Widget
1279
1296
 
1280
1297
  # @return [Boolean] whether the layout can clip its content and children
1281
1298
  # (default is false).
1282
- attr_accessor :clipping?
1299
+ def clipping?; end
1300
+
1301
+ # Change if layout can clip it's content and child.
1302
+ # @param value [Boolean] true if clip the its content and children.
1303
+ def clipping=(value); end
1304
+
1305
+ # Add a child to the container.
1306
+ # @param child [Node] A child node.
1307
+ def add(child); end
1308
+
1309
+ # This is alias method of {#add}.
1310
+ def <<(child); end
1283
1311
 
1284
1312
  end
1285
1313
 
@@ -1288,11 +1316,9 @@ class Scroll < Layout
1288
1316
  # @group Constructors
1289
1317
 
1290
1318
  # Creates a new Scroll widget.
1319
+ # @endgroup
1291
1320
  def initialize; end
1292
1321
 
1293
-
1294
- # @group Properties
1295
-
1296
1322
  # @return [:none, :vertical, :horizontal, :both] the direction of the scroll
1297
1323
  # view.
1298
1324
  attr_accessor :direction
@@ -1351,11 +1377,9 @@ class List < Scroll
1351
1377
  def on_selection; end
1352
1378
 
1353
1379
  # @return [Integer] the index of the currently selected item.
1380
+ # @endgroup
1354
1381
  def selected_item; end
1355
1382
 
1356
-
1357
- # @group Properties
1358
-
1359
1383
  # @return [Float] the margin between items in the list.
1360
1384
  attr_accessor :items_margin
1361
1385
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-game
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HipByte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-11 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: motion-game allows you to write cross-platform native mobile games in
14
14
  Ruby.
@@ -84,7 +84,7 @@ files:
84
84
  - template/motion-game/files/resources/Default-568h@2x.png
85
85
  - template/motion-game/files/resources/Default-667h@2x.png
86
86
  - template/motion-game/files/resources/Default-736h@3x.png
87
- homepage: http://www.rubymotion.com/developers/motion-game
87
+ homepage: https://github.com/HipByte/motion-game
88
88
  licenses:
89
89
  - BSD
90
90
  metadata:
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.5.2
108
+ rubygems_version: 2.6.8
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Cross-platform mobile game engine for RubyMotion