samples/07_advanced_rendering/03_render_target_viewports/app/main.rb
# Outputs whether a mouse click occurred inside or outside of a box
Outputs whether a mouse click occurred inside or outside of a box
Outputs whether a mouse click occurred inside or outside of a box
def point_to_rect_tech_demo
    x = 460
    outputs.labels << small_label(x, 15, "Click inside the blue box maybe ---->")
    box = [765, 370, 50, 50, 0, 0, 170] 
    outputs.borders << box
    if state.last_mouse_click 
      if state.last_mouse_click.point.inside_rect? box 
        outputs.labels << small_label(x, 16, "Mouse click happened inside the box.")
      else 
        outputs.labels << small_label(x, 16, "Mouse click happened outside the box.")
      end
    else 
      outputs.labels << small_label(x, 16, "Mouse click has not occurred yet.") 
    end
    outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)]
  end
def point_to_rect_tech_demo x = 460 outputs . labels << small_label ( x , 15 , "Click inside the blue box maybe ---->" ) box = [ 765 , 370 , 50 , 50 , 0 , 0 , 170 ] outputs . borders << box if state . last_mouse_click if state . last_mouse_click . point . inside_rect? box outputs . labels << small_label ( x , 16 , "Mouse click happened inside the box." ) else outputs . labels << small_label ( x , 16 , "Mouse click happened outside the box." ) end else outputs . labels << small_label ( x , 16 , "Mouse click has not occurred yet." ) end outputs . borders << [ 455 , row_to_px ( 14 ) , 360 , row_to_px ( 11 ) . shift_up ( 5 ) - row_to_px ( 14 ) ] end
Outputs whether a mouse click occurred inside or outside of a box
Outputs whether a mouse click occurred inside or outside of a box
# blue box # if the mouse was clicked # if mouse clicked inside box # otherwise, if mouse was clicked outside the box # otherwise, if was not clicked at all # output if the mouse was not clicked # border around mouse input demo section