NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 23, 2017, 02:03:28 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
"Life is the beaty of art, heart, and humanity."...Wisdom
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: how to make object to be drawn when conditions are meet?  (Read 5284 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
on: September 18, 2008, 02:50:57 pm » posted from:Singapore,,Singapore

ElementsParticle
Particle: An interactive particle.

http://www.um.es/fem/EjsWiki/index.php/Main/ElementsParticle

i was reading this but i can't get a feel of how to solve this problem i have.

when
mode.equals("edit_v-t_graph")

i want to draw ParticleSet_movable

else

don't draw this object.

how do i program it ?


currently i can achieve visibility state  "False"but because i also have codes in On Drag property
dsnap();
dragvt()

so the objects interact with user despite being not visible. Sad
« Last Edit: September 18, 2008, 02:52:43 pm by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: September 18, 2008, 03:46:01 pm » posted from:Taipei,T'ai-pei,Taiwan

You can set Visible property to mode.equals("edit_v-t_graph") if you want it to be drawn on the condition that mode.equals("edit_v-t_graph") is true.

You can only drag an object when it is visible. (Unless you draw the object the same color as the background-- the object was draw but user might not be able to see it. this is different case)

Is this what you want?
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #2 on: September 18, 2008, 04:35:01 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

only after posting n reading ur post then i understand in the xml there are 2 set of objects drawing in the v-t graph.
this is important quote"You can only drag an object when it is visible. "

one is the set of ParticleSet_movable2 | visible mode.equals("edit_v-t_graph") | OnDrag dragvt();
dsnap(); |
other one  is the Polygon_line_during_edit_options | visible mode.equals("edit_v-t_graph") | OnDrag dragvt();

what i did that i think achieve what i want is to create another object called Polygon_line_for_non_edit_options | mode.equals("simple_acceleration")||mode.equals("uniform_motion")||mode.equals("simple_deceleration")||mode.equals("rise_and_fall")||mode.equals("fall_and_rebounce") |  DragOn  "BLANK" !!!!

done!!!

yes you r right, i will try to rearrange the simulation vertical from current horizontal ASAP Smiley

Thanks!
« Last Edit: September 18, 2008, 04:38:21 pm by lookang » Logged
Pages: [1]   Go Up
  Print  
"Life is the beaty of art, heart, and humanity."...Wisdom
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
A ball climb up another object on a frictionless surface
Dynamics
Fu-Kwun Hwang 2 12171 Last post July 23, 2007, 05:57:51 pm
by Fu-Kwun Hwang
Weight of an immersed object in liquid
Wave and Fluid
Fu-Kwun Hwang 5 24810 Last post November 25, 2007, 04:49:21 pm
by desert knight
Stability of object immersed in liquid
Wave and Fluid
Fu-Kwun Hwang 0 12346 Last post March 10, 2007, 01:55:56 pm
by Fu-Kwun Hwang
Simulation of blowing object with debris falling down
Request for physics Simulations
tppramod 7 11407 Last post May 07, 2009, 02:49:36 pm
by jeff_forssell
is it possible to make applet make a sound when i condition is met?
Questions related to EJS
lookang 8 10198 Last post December 22, 2008, 12:10:01 pm
by lookang
Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.06 seconds with 22 queries.since 2011/06/15