summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOwen Butler <[email protected]>2021-09-19 22:34:40 +1000
committerAmir Rajan <[email protected]>2021-10-11 18:18:43 -0500
commit146b36b4b132658f7692998f5a72e9a1930a29a9 (patch)
tree9c230daae9da22818f445220a39405829e2d9006
parent15b361f6a93763f96bd3363c23a5dd4db8160cb2 (diff)
downloaddragonruby-game-toolkit-contrib-146b36b4b132658f7692998f5a72e9a1930a29a9.tar.gz
dragonruby-game-toolkit-contrib-146b36b4b132658f7692998f5a72e9a1930a29a9.zip
docs: Update further sprite example
-rw-r--r--dragon/outputs_docs.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/dragon/outputs_docs.rb b/dragon/outputs_docs.rb
index db15989..a2b4fb8 100644
--- a/dragon/outputs_docs.rb
+++ b/dragon/outputs_docs.rb
@@ -208,25 +208,19 @@ be provided in any order.
** Rendering a solid using a Class
-You can also create a class with solid/border properties and render it as a primitive.
-ALL properties must be on the class. *Additionally*, a method called ~primitive_marker~
-must be defined on the class.
+You can also create a class with sprite properties and render it as a primitive.
Here is an example:
#+begin_src
- # Create type with ALL sprite properties AND primitive_marker
+ # Create type with ALL sprite properties
class Sprite
- attr_accessor :x, :y, :w, :h, :path, :angle, :angle_anchor_x, :angle_anchor_y, :tile_x, :tile_y, :tile_w, :tile_h, :source_x, :source_y, :source_w, :source_h, :flip_horizontally, :flip_vertically, :a, :r, :g, :b
-
- def primitive_marker
- :sprite
- end
+ attr_sprite
end
# Inherit from type
class Circle < Sprite
- # constructor
+ # constructor
def initialize x, y, size, path
self.x = x
self.y = y