Class: GTK::MousePoint

Inherits:
Object show all
Includes:
Geometry
Defined in:
dragon/inputs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Geometry

#anchor_rect, angle_between_lines, angle_from, #angle_from, #angle_given_point, angle_to, #angle_to, center_inside_rect, #center_inside_rect, center_inside_rect_x, #center_inside_rect_x, center_inside_rect_y, #center_inside_rect_y, contract_intersect_rect?, cubic_bezier, distance, #inside_rect?, inside_rect?, #intersect_rect?, intersect_rect?, #intersects_rect?, intersects_rect?, line_intersect, line_rect, line_rise_run, line_slope, line_y_intercept, #point_inside_circle?, point_inside_circle?, ray_test, #scale_rect, scale_rect, scale_rect_extended, #scale_rect_extended, shift_line, to_square

Constructor Details

#initialize(x, y) ⇒ MousePoint

Returns a new instance of MousePoint.


442
443
444
445
446
447
448
# File 'dragon/inputs.rb', line 442

def initialize x, y
  @x = x
  @y = y
  @point = [x, y]
  @created_at = Kernel.tick_count
  @global_created_at = Kernel.global_tick_count
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at


440
441
442
# File 'dragon/inputs.rb', line 440

def created_at
  @created_at
end

#global_created_atObject

Returns the value of attribute global_created_at


440
441
442
# File 'dragon/inputs.rb', line 440

def global_created_at
  @global_created_at
end

#pointObject

Returns the value of attribute point


440
441
442
# File 'dragon/inputs.rb', line 440

def point
  @point
end

#xObject

Returns the value of attribute x


440
441
442
# File 'dragon/inputs.rb', line 440

def x
  @x
end

#yObject

Returns the value of attribute y


440
441
442
# File 'dragon/inputs.rb', line 440

def y
  @y
end

Instance Method Details

#bottomObject


455
# File 'dragon/inputs.rb', line 455

def bottom; y; end

#created_at_elapsedObject


457
458
459
# File 'dragon/inputs.rb', line 457

def created_at_elapsed
  @created_at.elapsed_time
end

#hObject


451
# File 'dragon/inputs.rb', line 451

def h; 0; end

#inspectObject


474
475
476
# File 'dragon/inputs.rb', line 474

def inspect
  serialize.to_s
end

#leftObject


452
# File 'dragon/inputs.rb', line 452

def left; x; end

#rightObject


453
# File 'dragon/inputs.rb', line 453

def right; x; end

#serializeObject


465
466
467
468
469
470
471
472
# File 'dragon/inputs.rb', line 465

def serialize
  {
    x: @x,
    y: @y,
    created_at: @created_at,
    global_created_at: @global_created_at
  }
end

#to_hashObject


461
462
463
# File 'dragon/inputs.rb', line 461

def to_hash
  serialize
end

#to_sObject


478
479
480
# File 'dragon/inputs.rb', line 478

def to_s
  serialize.to_s
end

#topObject


454
# File 'dragon/inputs.rb', line 454

def top; y; end

#wObject


450
# File 'dragon/inputs.rb', line 450

def w; 0; end