Class: LiteRGSS::Shape
- Inherits:
-
Drawable
- Object
- Disposable
- Drawable
- LiteRGSS::Shape
- Defined in:
- LiteRGSS.rb.yard.rb
Overview
Class allowing to draw Shapes in a viewport
Direct Known Subclasses
Constant Summary collapse
- CIRCLE =
Constant telling the shape to draw a circle
:circle
- CONVEX =
Constant telling the shape to draw a convex shape
:convex
- RECTANGLE =
Constant telling the shape to draw a rectangle
:rectangle
Instance Attribute Summary collapse
-
#__index__ ⇒ Integer
readonly
Internal index of the shape in the viewport when it was created.
-
#angle ⇒ Numeric
Angle of the shape.
-
#bitmap ⇒ Bitmap?
Texture used to make a specific drawing inside the shape (bitmap is show inside the border of the shape).
-
#blendmode ⇒ BlendMode?
Blend mode used to draw the shape.
-
#color ⇒ Color
Color of the shape (or multiplied to the bitmap).
-
#height ⇒ Numeric
Height of the shape (updatable only for :rectangle).
-
#outline_color ⇒ Color
Outline color of the shape.
-
#outline_thickness ⇒ Numeric
Size of the outline of the shape.
-
#ox ⇒ Integer
Origin x of the Shape.
-
#oy ⇒ Integer
Origin y of the Shape.
-
#point_count ⇒ Numeric
Number of point to build the shape (can be modified only with circle and convex).
-
#radius ⇒ Numeric
Radius of a circle shape (-1 if not a circle shape).
-
#shader ⇒ Shader?
Shader used to draw the shape.
-
#src_rect ⇒ Rect
Source rect used to tell which part of the bitmap is shown in the shape.
-
#type ⇒ Symbol
readonly
Type of the shape (:circle, :convex or :rectangle).
-
#viewport ⇒ Viewport
readonly
Viewport in which the Shape is shown.
-
#visible ⇒ Boolean
If the shape is visible.
-
#width ⇒ Numeric
Width of the shape (updatable only of :rectangle).
-
#x ⇒ Integer
X coordinate of the shape in the viewport.
-
#y ⇒ Integer
Y coordinate of the shape in the viewport.
-
#z ⇒ Integer
Z order of the Shape in the viewport.
-
#zoom ⇒ Numeric
writeonly
Zoom of the shape (x&y at the same time).
-
#zoom_x ⇒ Numeric
Zoom_x of the shape.
-
#zoom_y ⇒ Numeric
Zoom_y of the shape.
Class Method Summary collapse
-
.new(viewport, type, width, height)
Create a new Rectangle shape.
Instance Method Summary collapse
-
#get_point(index) ⇒ Array(Integer, Integer)
Retrieve the coordinate of a point.
-
#set_origin(ox, oy) ⇒ self
Change the origin of the Shape.
-
#set_point(index, x, y) ⇒ self
Update the coordinate of a point of a Convex shape (does nothing for rectangle Shape and Circle Shape).
-
#set_position(x, y) ⇒ self
Set the new coordinate of the shape in the viewport.
Methods inherited from Disposable
Instance Attribute Details
#__index__ ⇒ Integer (readonly)
Returns internal index of the shape in the viewport when it was created.
675 676 677 |
# File 'LiteRGSS.rb.yard.rb', line 675 def __index__ @__index__ end |
#angle ⇒ Numeric
Returns angle of the shape.
641 642 643 |
# File 'LiteRGSS.rb.yard.rb', line 641 def angle @angle end |
#bitmap ⇒ Bitmap?
Returns texture used to make a specific drawing inside the shape (bitmap is show inside the border of the shape).
613 614 615 |
# File 'LiteRGSS.rb.yard.rb', line 613 def bitmap @bitmap end |
#blendmode ⇒ BlendMode?
Returns blend mode used to draw the shape.
687 688 689 |
# File 'LiteRGSS.rb.yard.rb', line 687 def blendmode @blendmode end |
#color ⇒ Color
Returns color of the shape (or multiplied to the bitmap).
669 670 671 |
# File 'LiteRGSS.rb.yard.rb', line 669 def color @color end |
#height ⇒ Numeric
Returns height of the shape (updatable only for :rectangle).
683 684 685 |
# File 'LiteRGSS.rb.yard.rb', line 683 def height @height end |
#outline_color ⇒ Color
Returns outline color of the shape.
671 672 673 |
# File 'LiteRGSS.rb.yard.rb', line 671 def outline_color @outline_color end |
#outline_thickness ⇒ Numeric
Returns size of the outline of the shape.
673 674 675 |
# File 'LiteRGSS.rb.yard.rb', line 673 def outline_thickness @outline_thickness end |
#ox ⇒ Integer
Returns origin x of the Shape.
630 631 632 |
# File 'LiteRGSS.rb.yard.rb', line 630 def ox @ox end |
#oy ⇒ Integer
Returns origin y of the Shape.
632 633 634 |
# File 'LiteRGSS.rb.yard.rb', line 632 def oy @oy end |
#point_count ⇒ Numeric
Returns number of point to build the shape (can be modified only with circle and convex).
653 654 655 |
# File 'LiteRGSS.rb.yard.rb', line 653 def point_count @point_count end |
#radius ⇒ Numeric
Returns radius of a circle shape (-1 if not a circle shape).
677 678 679 |
# File 'LiteRGSS.rb.yard.rb', line 677 def radius @radius end |
#shader ⇒ Shader?
Returns shader used to draw the shape.
685 686 687 |
# File 'LiteRGSS.rb.yard.rb', line 685 def shader @shader end |
#src_rect ⇒ Rect
Returns source rect used to tell which part of the bitmap is shown in the shape.
615 616 617 |
# File 'LiteRGSS.rb.yard.rb', line 615 def src_rect @src_rect end |
#type ⇒ Symbol (readonly)
Returns type of the shape (:circle, :convex or :rectangle).
679 680 681 |
# File 'LiteRGSS.rb.yard.rb', line 679 def type @type end |
#viewport ⇒ Viewport (readonly)
Returns viewport in which the Shape is shown.
649 650 651 |
# File 'LiteRGSS.rb.yard.rb', line 649 def @viewport end |
#visible ⇒ Boolean
Returns if the shape is visible.
651 652 653 |
# File 'LiteRGSS.rb.yard.rb', line 651 def visible @visible end |
#width ⇒ Numeric
Returns width of the shape (updatable only of :rectangle).
681 682 683 |
# File 'LiteRGSS.rb.yard.rb', line 681 def width @width end |
#x ⇒ Integer
Returns x coordinate of the shape in the viewport.
617 618 619 |
# File 'LiteRGSS.rb.yard.rb', line 617 def x @x end |
#y ⇒ Integer
Returns y coordinate of the shape in the viewport.
619 620 621 |
# File 'LiteRGSS.rb.yard.rb', line 619 def y @y end |
#z ⇒ Integer
Returns z order of the Shape in the viewport.
628 629 630 |
# File 'LiteRGSS.rb.yard.rb', line 628 def z @z end |
#zoom=(value) ⇒ Numeric (writeonly)
Returns zoom of the shape (x&y at the same time).
647 648 649 |
# File 'LiteRGSS.rb.yard.rb', line 647 def zoom=(value) @zoom = value end |
#zoom_x ⇒ Numeric
Returns zoom_x of the shape.
643 644 645 |
# File 'LiteRGSS.rb.yard.rb', line 643 def zoom_x @zoom_x end |
#zoom_y ⇒ Numeric
Returns zoom_y of the shape.
645 646 647 |
# File 'LiteRGSS.rb.yard.rb', line 645 def zoom_y @zoom_y end |
Class Method Details
.new(viewport, type, width, height)
Create a new Rectangle shape
594 595 596 |
# File 'LiteRGSS.rb.yard.rb', line 594 def self.new(, type, radius, num_pts) end |
Instance Method Details
#get_point(index) ⇒ Array(Integer, Integer)
Retrieve the coordinate of a point
657 658 659 |
# File 'LiteRGSS.rb.yard.rb', line 657 def get_point(index) end |
#set_origin(ox, oy) ⇒ self
Change the origin of the Shape
637 638 639 |
# File 'LiteRGSS.rb.yard.rb', line 637 def set_origin(ox, oy) end |
#set_point(index, x, y) ⇒ self
Update the coordinate of a point of a Convex shape (does nothing for rectangle Shape and Circle Shape)
665 666 667 |
# File 'LiteRGSS.rb.yard.rb', line 665 def set_point(index, x, y) end |
#set_position(x, y) ⇒ self
Set the new coordinate of the shape in the viewport
624 625 626 |
# File 'LiteRGSS.rb.yard.rb', line 624 def set_position(x, y) end |