Class: MG::Draw

Inherits:
Node
  • Object
show all
Defined in:
doc/API_reference.rb

Instance Attribute Summary

Attributes inherited from Node

#alpha, #anchor_point, #color, #name, #position, #rotation, #scale, #size, #visible?, #z_index

Draw Operations collapse

Methods inherited from Node

#add, #children, #delete, #delete_from_parent, #intersects?, #parent, #run_action, #stop_action, #stop_all_actions

Instance Method Details

#clearDraw

Clears drew shapes.

Returns:

  • (Draw)

    the receiver.



794
# File 'doc/API_reference.rb', line 794

def clear; end

#dot(pos, radius, color) ⇒ Draw

Draws a filled circle at the given position with the given radius and color.

Parameters:

  • pos (Point)

    the position where to draw.

  • radius (Float)

    the radius of the circle to draw.

  • color (Color)

    the color to use to fill the circle.

Returns:

  • (Draw)

    the receiver.



801
# File 'doc/API_reference.rb', line 801

def dot(pos, radius, color); end

#line(origin, destination, thickness, color) ⇒ Draw

Draws a line at the given position with the given color.

Parameters:

  • origin (Point)

    the position where to start drawing (lower-left).

  • destination (Point)

    the position where to end drawing (higher-right).

  • thickness (Float)

    the line thickness.

  • color (Color)

    the color to use to draw.

Returns:

  • (Draw)

    the receiver.



817
# File 'doc/API_reference.rb', line 817

def line(origin, destination, thickness, color); end

#rect(origin, destination, color, fill = false) ⇒ Draw

Draws a rectangle at the given position with the given color.

Parameters:

  • origin (Point)

    the position where to start drawing (lower-left).

  • destination (Point)

    the position where to end drawing (higher-right).

  • color (Color)

    the color to use to draw.

  • fill (Boolean) (defaults to: false)

    whether the rectangle should be filled up.

Returns:

  • (Draw)

    the receiver.



809
# File 'doc/API_reference.rb', line 809

def rect(origin, destination, color, fill=false); end

#triangle(position1, position2, position3, color) ⇒ Draw

Draws a triangle at the given positions with the given color.

Parameters:

  • position1 (Point)

    The triangle vertex point.

  • position2 (Point)

    The triangle vertex point.

  • position3 (Point)

    The triangle vertex point.

  • color (Color)

    the color to use to draw.

Returns:

  • (Draw)

    the receiver.



825
# File 'doc/API_reference.rb', line 825

def triangle(position1, position2, position3, color); end