diff options
| author | realtradam <[email protected]> | 2021-08-08 02:14:53 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2021-08-08 02:14:53 -0400 |
| commit | cad7a2876013ae52f248d7d3fd35bb6d7a2d36cb (patch) | |
| tree | 7888eb2df8401feaa1426d9ca411a7e7b76cb792 /lib/ruby2d/camera/circle.rb | |
| parent | e9a05cecd41b244977c794931b4706015097774f (diff) | |
| download | ruby2d-camera-cad7a2876013ae52f248d7d3fd35bb6d7a2d36cb.tar.gz ruby2d-camera-cad7a2876013ae52f248d7d3fd35bb6d7a2d36cb.zip | |
fixed formatting and file structure
Diffstat (limited to 'lib/ruby2d/camera/circle.rb')
| -rw-r--r-- | lib/ruby2d/camera/circle.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ruby2d/camera/circle.rb b/lib/ruby2d/camera/circle.rb index c6e1eb0..60629df 100644 --- a/lib/ruby2d/camera/circle.rb +++ b/lib/ruby2d/camera/circle.rb @@ -9,6 +9,7 @@ module Ruby2D # Use after changing variables def _draw return if @hide + angle = Camera.angle * (Math::PI / 180) half_width = Window.width * 0.5 half_height = Window.height * 0.5 @@ -17,15 +18,16 @@ module Ruby2D temp_y = (((@x - Ruby2D::Camera.x + radius) * Math.sin(angle)) + ((@y - Ruby2D::Camera.y + radius) * Math.cos(angle))) * Ruby2D::Camera.zoom + half_height Ruby2D::Circle.draw(x: temp_x, y: temp_y, radius: temp_radius, - sectors: self.sectors, - color: [self.color.r, self.color.g, self.color.b, self.color.a]) + sectors: sectors, + color: [color.r, color.g, color.b, color.a]) end - def initialize(opts= {}) + def initialize(opts = {}) super(opts) Ruby2D::Camera << self Window.remove(self) end + def remove @hide = true end |
