summaryrefslogtreecommitdiffhomepage
path: root/deprecated/components/01_sprite.rb
blob: 4ae6713f2bebe6cc8db4ed224788fb563a3bb6c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# frozen_string_literal: true

FelFlame::Components.new('Sprite', :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b,
                         :source_x, :source_y, :source_w, :source_h,
                         :tile_x, :tile_y, :tile_w, :tile_h,
                         :flip_horizontally, :flip_vertically,
                         :angle_anchor_x, :angle_anchor_y, primative_marker: :sprite)

# Components::Sprite.define_method('primative_marker') do
#  :sprite
# end

# class Components
#   # If an entity can be rendered on screen
#   class Sprite < Helper::BaseComponent
#
#     attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b,
#       :source_x, :source_y, :source_w, :source_h,
#       :tile_x, :tile_y, :tile_w, :tile_h,
#       :flip_horizontally, :flip_vertically,
#       :angle_anchor_x, :angle_anchor_y
#
#     def set(x: @x, y: @y, w: @w, h: @h, path: @path, angle: @angle, a: @a, r: @r, g: @g, b: @b,
#             source_x: @source_x, source_y: @source_y, source_w: @source_w, source_h: @source_h,
#             tile_x: @tile_x, tile_y: @tile_y, tile_w: @tile_w, tile_h: @tile_h,
#             flip_horizontally: @flip_horizontally, flip_vertically: @flip_vertically,
#             angle_anchor_x: @angle_anchor_x, angle_anchor_y: @angle_anchor_y)
#       {x: @x = x,
#        y: @y = y,
#        w: @w = w,
#        h: @h = h,
#        path: @path = path,
#        angle: @angle = angle,
#        a: @a = a,
#        r: @r = r,
#        g: @g = g,
#        b: @b = b,
#        source_x: @source_x = source_x,
#        source_y: @source_y = source_y,
#        source_w: @source_w = source_w,
#        source_h: @source_h = source_h,
#        tile_x: @tile_x = tile_x,
#        tile_y: @tile_y = tile_y,
#        tile_w: @tile_w = tile_w,
#        tile_h: @tile_h = tile_h,
#        flip_horizontally: @flip_horizontally = flip_horizontally,
#        flip_vertically: @flip_vertically = flip_vertically,
#        angle_anchor_x: @angle_anchor_x = angle_anchor_x,
#        angle_anchor_y: @angle_anchor_y = angle_anchor_y}
#     end
#
#     def primative_marker
#       :sprite
#     end
#   end
# end