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, #z_index

Draw Operations collapse

Methods inherited from Node

#add, #children, #delete, #delete_from_parent, #intersects?, #number_of_running_actions, #parent, #run_action, #schedule, #schedule_once, #stop_action, #stop_all_actions, #unschedule, #visible=, #visible?

Instance Method Details

#clearself

Clears drew shapes.

Returns:

  • (self)

    the receiver.



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

def clear; end

#dot(pos, radius, color) ⇒ self

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:

  • (self)

    the receiver.



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

def dot(pos, radius, color); end

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

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:

  • (self)

    the receiver.



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

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

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

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:

  • (self)

    the receiver.



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

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

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

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:

  • (self)

    the receiver.



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

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