Gui Elements added to Simphy

SimPHY now supports its own gui elements which respond to their associated events through scripts.
Ex.
Button: allows user to write script on its onClick() event. for example

function button_onclick(){
    var disc = world.addDisc(0.3)
}

adds disc of radius 0.3 at origin whenever button is pressed.

Slider: allows user to write script on its onChange() event. for example

function slider_onchange(){
    disc.setFriction(value)
}

changes friction on disc equal to value of slider

CheckBox: allows user to write script on its onChange() event. for example

function checkbox_onclick(){
   disc.setVisible(value)
}

toggles visibility of disc when check box is checked/unchecked

TextBox: allows to display text with minimal html support

Panel: acts as container of widget, when a widget is placed over it, the widget sticks to the panel and moves whenever panel is moved

Overall the latest features of simPHY makes is more flexible to create simulations and make few boring games.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply