Class: MG::Draw

Inherits:
Node
  • Object
show all
Defined in:
motion-game

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, #clear, #delete, #delete_from_parent, #intersects?, #parent

Instance Method Details

- (Draw) dot(pos, radius, color)

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.



371
# File 'motion-game', line 371

def dot(pos, radius, color); end

- (Draw) rect(origin, destination, color, fill = false)

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.



379
# File 'motion-game', line 379

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