Class: MSPhysics::BodyContext
- Inherits:
-
CommonContext
- Object
- Entity
- CommonContext
- MSPhysics::BodyContext
- Defined in:
- RubyExtension/MSPhysics/body_context.rb
Overview
BodyContext contains Body events and event-related functions.
Simulation Events collapse
-
#onClick {|point| ... } ⇒ Object
Assign a block of code to the onClick event.
-
#onDrag { ... } ⇒ Object
Assign a block of code to the onDrag event.
-
#onDraw {|view, bb| ... } ⇒ Object
Assign a block of code to the onDraw event.
-
#onEnd { ... } ⇒ Object
Assign a block of code to the onEnd event.
-
#onPause { ... } ⇒ Object
Assign a block of code to the onPause event.
-
#onPlay { ... } ⇒ Object
Assign a block of code to the onPlay event.
-
#onPostFrame { ... } ⇒ Object
Assign a block of code to the onPostFrame event.
-
#onPostUpdate { ... } ⇒ Object
Assign a block of code to the onUpdate event.
-
#onPreFrame { ... } ⇒ Object
Assign a block of code to the onPreFrame event.
-
#onPreUpdate { ... } ⇒ Object
Assign a block of code to the onPreUpdate event.
-
#onStart { ... } ⇒ Object
Assign a block of code to the onStart event.
-
#onTick { ... } ⇒ Object
Assign a block of code to the onTick event.
-
#onTouch {|toucher, point, normal, force, speed| ... } ⇒ Object
Assign a block of code to the onTouch event.
-
#onTouching {|toucher| ... } ⇒ Object
Assign a block of code to the onTouching event.
-
#onUnclick { ... } ⇒ Object
Assign a block of code to the onUnclick event.
-
#onUntouch {|toucher| ... } ⇒ Object
Assign a block of code to the onUntouch event.
-
#onUpdate { ... } ⇒ Object
Assign a block of code to the onUpdate event.
User Input Events collapse
-
#onKeyDown {|key, val, char| ... } ⇒ Object
Assign a block of code to the onKeyDown event.
-
#onKeyExtended {|key, val, char| ... } ⇒ Object
Assign a block of code to the onKeyExtended event.
-
#onKeyUp {|key, val, char| ... } ⇒ Object
Assign a block of code to the onKeyUp event.
-
#onLButtonDoubleClick {|x, y| ... } ⇒ Object
Assign a block of code to the onLButtonDoubleClick event.
-
#onLButtonDown {|x, y| ... } ⇒ Object
Assign a block of code to the onLButtonDown event.
-
#onLButtonUp {|x, y| ... } ⇒ Object
Assign a block of code to the onLButtonUp event.
-
#onMButtonDoubleClick {|x, y| ... } ⇒ Object
Assign a block of code to the onMButtonDoubleClick event.
-
#onMButtonDown {|x, y| ... } ⇒ Object
Assign a block of code to the onMButtonDown event.
-
#onMButtonUp {|x, y| ... } ⇒ Object
Assign a block of code to the onMButtonUp event.
-
#onMouseMove {|x, y, view| ... } ⇒ Object
Assign a block of code to the onMouseMove event.
-
#onMouseWheelRotate {|x, y, dir| ... } ⇒ Object
Assign a block of code to the onMouseWheelRotate event.
-
#onMouseWheelTilt {|x, y, dir| ... } ⇒ Object
Assign a block of code to the onMouseWheelTilt event.
-
#onRButtonDoubleClick {|x, y| ... } ⇒ Object
Assign a block of code to the onRButtonDoubleClick event.
-
#onRButtonDown {|x, y| ... } ⇒ Object
Assign a block of code to the onRButtonDown event.
-
#onRButtonUp {|x, y| ... } ⇒ Object
Assign a block of code to the onRButtonUp event.
-
#onXButton1DoubleClick {|x, y| ... } ⇒ Object
Assign a block of code to the onXButton1DoubleClick event.
-
#onXButton1Down {|x, y| ... } ⇒ Object
Assign a block of code to the onXButton1Down event.
-
#onXButton1Up {|x, y| ... } ⇒ Object
Assign a block of code to the onXButton1Up event.
-
#onXButton2DoubleClick {|x, y| ... } ⇒ Object
Assign a block of code to the onXButton2DoubleClick event.
-
#onXButton2Down {|x, y| ... } ⇒ Object
Assign a block of code to the onXButton2Down event.
-
#onXButton2Up {|x, y| ... } ⇒ Object
Assign a block of code to the onXButton2Up event.
Instance Method Summary collapse
-
#call_event(event, *args) ⇒ Boolean
private
Trigger an event.
- #eval_script(script, script_name, line) ⇒ Object private
-
#event_proc_assigned?(event) ⇒ Boolean
Determine whether particular event has a Proc object.
-
#get_event_proc(event) ⇒ Proc?
Get a Proc object assigned to an event.
-
#initialize(body) ⇒ BodyContext
constructor
A new instance of BodyContext.
-
#on(*events) { ... } ⇒ Fixnum
Assign a block of code to an event or a list of events.
-
#set_event_proc(event, proc) ⇒ Boolean
Assign a Proc object to an event.
-
#this ⇒ Body
Get the associated body.
Methods inherited from CommonContext
#accumulator, #delete_global_var, #delete_var, #frame, #get_global_var, #get_set_global_var, #get_set_var, #get_var, #joybutton, #joypad, #joystick, #key, #key_slider, #leftx, #lefty, #leftz, #numx, #numy, #oscillator, #oscillator2, #oscillator2_slope, #oscillator_slope, #repeater, #rightx, #righty, #rightz, #set_global_var, #set_var, #simulation, #singular_repeater, #slider, #toggle_key, #world
Methods inherited from Entity
Constructor Details
#initialize(body) ⇒ BodyContext
Returns a new instance of BodyContext
Instance Method Details
#call_event(event, *args) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Trigger an event.
#eval_script(script, script_name, line) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
#event_proc_assigned?(event) ⇒ Boolean
Determine whether particular event has a Proc object.
#get_event_proc(event) ⇒ Proc?
Get a Proc object assigned to an event.
#on(*events) { ... } ⇒ Fixnum
Assign a block of code to an event or a list of events.
#onClick {|point| ... } ⇒ Object
Assign a block of code to the onClick event.
#onDrag { ... } ⇒ Object
Assign a block of code to the onDrag event.
#onDraw {|view, bb| ... } ⇒ Object
Assign a block of code to the onDraw event.
#onEnd { ... } ⇒ Object
Assign a block of code to the onEnd event.
#onKeyDown {|key, val, char| ... } ⇒ Object
Windows only!
Assign a block of code to the onKeyDown event.
#onKeyExtended {|key, val, char| ... } ⇒ Object
Windows only!
Assign a block of code to the onKeyExtended event.
#onKeyUp {|key, val, char| ... } ⇒ Object
Windows only!
Assign a block of code to the onKeyUp event.
#onLButtonDoubleClick {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onLButtonDoubleClick event.
#onLButtonDown {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onLButtonDown event.
#onLButtonUp {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onLButtonUp event.
#onMButtonDoubleClick {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onMButtonDoubleClick event.
#onMButtonDown {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onMButtonDown event.
#onMButtonUp {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onMButtonUp event.
#onMouseMove {|x, y, view| ... } ⇒ Object
Assign a block of code to the onMouseMove event.
#onMouseWheelRotate {|x, y, dir| ... } ⇒ Object
Windows only!
Assign a block of code to the onMouseWheelRotate event.
#onMouseWheelTilt {|x, y, dir| ... } ⇒ Object
Windows only!
Assign a block of code to the onMouseWheelTilt event.
#onPause { ... } ⇒ Object
Assign a block of code to the onPause event.
#onPlay { ... } ⇒ Object
Assign a block of code to the onPlay event.
#onPostFrame { ... } ⇒ Object
Assign a block of code to the onPostFrame event.
#onPostUpdate { ... } ⇒ Object
Assign a block of code to the onUpdate event.
#onPreFrame { ... } ⇒ Object
Assign a block of code to the onPreFrame event.
#onPreUpdate { ... } ⇒ Object
Assign a block of code to the onPreUpdate event.
#onRButtonDoubleClick {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onRButtonDoubleClick event.
#onRButtonDown {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onRButtonDown event.
#onRButtonUp {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onRButtonUp event.
#onStart { ... } ⇒ Object
Assign a block of code to the onStart event.
#onTick { ... } ⇒ Object
Assign a block of code to the onTick event.
#onTouch {|toucher, point, normal, force, speed| ... } ⇒ Object
Assign a block of code to the onTouch event.
#onTouching {|toucher| ... } ⇒ Object
Assign a block of code to the onTouching event.
#onUnclick { ... } ⇒ Object
Assign a block of code to the onUnclick event.
#onUntouch {|toucher| ... } ⇒ Object
Sometimes you may want to know whether particular body is in contact with
another body. Relying on events is not always the best technique. To
determine whether this body is in contact with another body, use
this.touching_with?(some_other_body) or
this.touching_bodies.
Assign a block of code to the onUntouch event.
#onUpdate { ... } ⇒ Object
Assign a block of code to the onUpdate event.
#onXButton1DoubleClick {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onXButton1DoubleClick event.
#onXButton1Down {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onXButton1Down event.
#onXButton1Up {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onXButton1Up event.
#onXButton2DoubleClick {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onXButton2DoubleClick event.
#onXButton2Down {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onXButton2Down event.
#onXButton2Up {|x, y| ... } ⇒ Object
Windows only!
Assign a block of code to the onXButton2Up event.
#set_event_proc(event, proc) ⇒ Boolean
Assign a Proc object to an event.
#this ⇒ Body
Get the associated body.