Class: LiteRGSS::Shape

Inherits:
Drawable show all
Defined in:
LiteRGSS.rb.yard.rb

Overview

Class allowing to draw Shapes in a viewport

Direct Known Subclasses

Shape

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Disposable

#dispose, #disposed?

Instance Attribute Details

#__index__Integer (readonly)

Returns internal index of the shape in the viewport when it was created.

Returns:

  • (Integer)

    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

#angleNumeric

Returns angle of the shape.

Returns:

  • (Numeric)

    angle of the shape



641
642
643
# File 'LiteRGSS.rb.yard.rb', line 641

def angle
  @angle
end

#bitmapBitmap?

Returns texture used to make a specific drawing inside the shape (bitmap is show inside the border of the shape).

Returns:

  • (Bitmap, nil)

    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

#blendmodeBlendMode?

Returns blend mode used to draw the shape.

Returns:

  • (BlendMode, nil)

    blend mode used to draw the shape



687
688
689
# File 'LiteRGSS.rb.yard.rb', line 687

def blendmode
  @blendmode
end

#colorColor

Returns color of the shape (or multiplied to the bitmap).

Returns:

  • (Color)

    color of the shape (or multiplied to the bitmap)



669
670
671
# File 'LiteRGSS.rb.yard.rb', line 669

def color
  @color
end

#heightNumeric

Returns height of the shape (updatable only for :rectangle).

Returns:

  • (Numeric)

    height of the shape (updatable only for :rectangle)



683
684
685
# File 'LiteRGSS.rb.yard.rb', line 683

def height
  @height
end

#outline_colorColor

Returns outline color of the shape.

Returns:

  • (Color)

    outline color of the shape



671
672
673
# File 'LiteRGSS.rb.yard.rb', line 671

def outline_color
  @outline_color
end

#outline_thicknessNumeric

Returns size of the outline of the shape.

Returns:

  • (Numeric)

    size of the outline of the shape



673
674
675
# File 'LiteRGSS.rb.yard.rb', line 673

def outline_thickness
  @outline_thickness
end

#oxInteger

Returns origin x of the Shape.

Returns:

  • (Integer)

    origin x of the Shape



630
631
632
# File 'LiteRGSS.rb.yard.rb', line 630

def ox
  @ox
end

#oyInteger

Returns origin y of the Shape.

Returns:

  • (Integer)

    origin y of the Shape



632
633
634
# File 'LiteRGSS.rb.yard.rb', line 632

def oy
  @oy
end

#point_countNumeric

Returns number of point to build the shape (can be modified only with circle and convex).

Returns:

  • (Numeric)

    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

#radiusNumeric

Returns radius of a circle shape (-1 if not a circle shape).

Returns:

  • (Numeric)

    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

#shaderShader?

Returns shader used to draw the shape.

Returns:

  • (Shader, nil)

    shader used to draw the shape



685
686
687
# File 'LiteRGSS.rb.yard.rb', line 685

def shader
  @shader
end

#src_rectRect

Returns source rect used to tell which part of the bitmap is shown in the shape.

Returns:

  • (Rect)

    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

#typeSymbol (readonly)

Returns type of the shape (:circle, :convex or :rectangle).

Returns:

  • (Symbol)

    type of the shape (:circle, :convex or :rectangle)



679
680
681
# File 'LiteRGSS.rb.yard.rb', line 679

def type
  @type
end

#viewportViewport (readonly)

Returns viewport in which the Shape is shown.

Returns:

  • (Viewport)

    viewport in which the Shape is shown



649
650
651
# File 'LiteRGSS.rb.yard.rb', line 649

def viewport
  @viewport
end

#visibleBoolean

Returns if the shape is visible.

Returns:

  • (Boolean)

    if the shape is visible



651
652
653
# File 'LiteRGSS.rb.yard.rb', line 651

def visible
  @visible
end

#widthNumeric

Returns width of the shape (updatable only of :rectangle).

Returns:

  • (Numeric)

    width of the shape (updatable only of :rectangle)



681
682
683
# File 'LiteRGSS.rb.yard.rb', line 681

def width
  @width
end

#xInteger

Returns x coordinate of the shape in the viewport.

Returns:

  • (Integer)

    x coordinate of the shape in the viewport



617
618
619
# File 'LiteRGSS.rb.yard.rb', line 617

def x
  @x
end

#yInteger

Returns y coordinate of the shape in the viewport.

Returns:

  • (Integer)

    y coordinate of the shape in the viewport



619
620
621
# File 'LiteRGSS.rb.yard.rb', line 619

def y
  @y
end

#zInteger

Returns z order of the Shape in the viewport.

Returns:

  • (Integer)

    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).

Returns:

  • (Numeric)

    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_xNumeric

Returns zoom_x of the shape.

Returns:

  • (Numeric)

    zoom_x of the shape



643
644
645
# File 'LiteRGSS.rb.yard.rb', line 643

def zoom_x
  @zoom_x
end

#zoom_yNumeric

Returns zoom_y of the shape.

Returns:

  • (Numeric)

    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

Parameters:

  • viewport (Viewport)

    viewport in which the shape is shown

  • type (Symbol)

    must be :rectangle

  • width (Integer)

    width of the rectangle

  • height (Integer)

    height of the rectangle



594
595
596
# File 'LiteRGSS.rb.yard.rb', line 594

def self.new(viewport, type, radius, num_pts)

end

Instance Method Details

#get_point(index) ⇒ Array(Integer, Integer)

Retrieve the coordinate of a point

Parameters:

  • index (Integer)

    index of the point in the point list

Returns:



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

Parameters:

Returns:

  • (self)


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)

Parameters:

  • index (Integer)

    index of the point in the point list

  • x (Numeric)

    x coordinate of the point

  • y (Numeric)

    y coordinate of the point

Returns:

  • (self)


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

Parameters:

Returns:

  • (self)


624
625
626
# File 'LiteRGSS.rb.yard.rb', line 624

def set_position(x, y)

end