SketchyPhysicsWiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 52: Line 52:
 
In SP3.2 many advanced scripted models relied on modifying SP content to achieve something that wasn't achievable via the standard SP API. For instance, many would modify ''onMouseMove(x, y, view, flags)'' function to get cursor position, and some would modify the ''draw(view)'' for a better drawing features.
 
In SP3.2 many advanced scripted models relied on modifying SP content to achieve something that wasn't achievable via the standard SP API. For instance, many would modify ''onMouseMove(x, y, view, flags)'' function to get cursor position, and some would modify the ''draw(view)'' for a better drawing features.
   
βˆ’
Modifying SP content is a bad practice because it may break compatibility with future SP versions. SP 3.5 has functions and events that should give a developer what he/she wants. For instance, to get cursor position use, ''$sketchyPhysicsToolInstance.cursorPos''. If you want to improve the draw tool, simply use the ''onDraw { |view, bb| }'' event rather than modifying the ''draw(view)'' function. If you want something to be done in the nextFrame, don't modify the nextFrame function, use ''onPreFrame'', ''onTick'', or ''onPostFrame'' events. Same goes to start and reset physics; use ''onStart'', and ''onEnd'' events. Modifying SP content in SP3.3+ is no longer required because there are events and functions that should give you what you want.
+
Modifying SP content is a bad practice because it may break compatibility with future SP versions. SP 3.5 has functions and events that should give a developer what he/she wants. For instance, to get cursor position use, ''$sketcyPhysucsToolInstance.cursorPos''. If you want to improve the draw tool, simply use the ''onDraw { |view, bb| }'' event rather than modifying the ''draw(view)'' function. If you want something to be done in the nextFrame, don't modify the nextFrame function, use ''onPreFrame'', ''onTick'', or ''onPostFrame'' events. Same goes to start and reset physics; use ''onStart'', and ''onEnd'' events. Modifying SP content in SP3.3+ is no longer required because there are events and functions that should give you what you want.
   
 
That's about it ;)
 
That's about it ;)

Please note that all contributions to the SketchyPhysicsWiki are considered to be released under the CC-BY-SA

Cancel Editing help (opens in new window)