summaryrefslogtreecommitdiffhomepage
path: root/docs/todo/05-sprites.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/todo/05-sprites.md')
-rw-r--r--docs/todo/05-sprites.md20
1 files changed, 4 insertions, 16 deletions
diff --git a/docs/todo/05-sprites.md b/docs/todo/05-sprites.md
index e8030ab..e2be250 100644
--- a/docs/todo/05-sprites.md
+++ b/docs/todo/05-sprites.md
@@ -179,26 +179,14 @@ args.outputs.sprites << {
## Duck Typing (Advanced)
-You can also create a class with sprite properties and render it as a primitive.
-ALL properties must 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,
+using the `attr_sprite` helper.
Here is an example:
```ruby
-# Create type with ALL sprite properties AND primitive_marker
-class Sprite
- attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :source_x,
- :source_y, :source_w, :source_h, :flip_horizontally,
- :flip_vertically, :angle_anchor_x, :angle_anchor_y
-
- def primitive_marker
- :sprite
- end
-end
-
-# Inherit from type
-class PlayerSprite < Sprite
+class PlayerSprite
+ attr_sprite
# constructor
def initialize x, y, w, h