summaryrefslogtreecommitdiffhomepage
path: root/dragon/outputs_docs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'dragon/outputs_docs.rb')
-rw-r--r--dragon/outputs_docs.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/dragon/outputs_docs.rb b/dragon/outputs_docs.rb
index 776d850..db15989 100644
--- a/dragon/outputs_docs.rb
+++ b/dragon/outputs_docs.rb
@@ -206,21 +206,27 @@ be provided in any order.
end
#+end_src
-** Rendering a sprite using a Class
+** Rendering a solid using a Class
-You can also create a class with sprite properties and render it as a primitive.
+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.
Here is an example:
#+begin_src
- # Create type with ALL sprite properties
+ # Create type with ALL sprite properties AND primitive_marker
class Sprite
- attr_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
end
# Inherit from type
class Circle < Sprite
- # constructor
+ # constructor
def initialize x, y, size, path
self.x = x
self.y = y