Class: MG::Size

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

Overview

node.size = MG::Size.new(200, 400)

Instance Attribute Summary collapse

Constructors collapse

Helpers collapse

Constructor Details

#initializeSize #initialize(ary) ⇒ Size #initialize(width, height) ⇒ Size

Returns a new instance of Size.

Overloads:

  • #initializeSize

    Creates a new object.

  • #initialize(ary) ⇒ Size

    Creates a new object with 2-element Array.

    Parameters:

    • ary (Array)

      2-element Array.

  • #initialize(width, height) ⇒ Size

    Creates a new object.

    Parameters:

    • width (Float)

      a size width.

    • height (Float)

      a size height.



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

def initialize(*args); end

Instance Attribute Details

#heightFloat

Returns the size height.

Returns:

  • (Float)

    the size height.



1202
1203
1204
# File 'doc/API_reference.rb', line 1202

def height
  @height
end

#widthFloat

Returns the size width.

Returns:

  • (Float)

    the size width.



1199
1200
1201
# File 'doc/API_reference.rb', line 1199

def width
  @width
end

Instance Method Details

#*(delta) ⇒ Size

Multiplies the dimensions of the receiver with the given number.

Parameters:

  • delta (Float)

    the number to multiply the receiver with.

Returns:

  • (Size)

    a new Size object.



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

def *(delta); end

#+(size) ⇒ Size

Adds the dimensions of the receiver with the dimensions of the given size object.

Parameters:

  • size (Size)

    A dimension.

Returns:

  • (Size)

    a new Size object.



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

def +(size); end

#-(size) ⇒ Size

Substracts the dimensions of the receiver with the dimensions of the given size object.

Parameters:

  • size (Size)

    A dimension.

Returns:

  • (Size)

    a new Size object.



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

def -(size); end

#/(delta) ⇒ Size

Divides the dimensions of the receiver with the given number.

Parameters:

  • delta (Float)

    the number to divide the receiver with.

Returns:

  • (Size)

    a new Size object.



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

def /(delta); end