diff options
| author | Amir Rajan <[email protected]> | 2021-12-10 00:09:48 -0600 |
|---|---|---|
| committer | Amir Rajan <[email protected]> | 2021-12-10 00:09:48 -0600 |
| commit | eaa29e72939f5edf61735ccbb73c36ee89369f65 (patch) | |
| tree | c310fac2e39bd799bf7fc1f73d35c12bcc5187b7 /dragon/outputs_docs.rb | |
| parent | 33dfdde9ae03e3218b4796f3595d3b727f626587 (diff) | |
| download | dragonruby-game-toolkit-contrib-eaa29e72939f5edf61735ccbb73c36ee89369f65.tar.gz dragonruby-game-toolkit-contrib-eaa29e72939f5edf61735ccbb73c36ee89369f65.zip | |
Synced with DragonRuby Game Toolkit v3.2.
Diffstat (limited to 'dragon/outputs_docs.rb')
| -rw-r--r-- | dragon/outputs_docs.rb | 16 |
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 |
