Page 1 of 1

Problems with box text

PostPosted: Wed Dec 30, 2009 4:23 pm
by PlanckBanck
Can I define for example the Y-Coordinate of an existing object as variable for further usage? (for example for an altimeter or something)
Something Like
Code: Select all
e.this.pos = [pos1 = pos1, pos2 = scene.myheight]


Thanks for help

Re: defining property as variable

PostPosted: Wed Dec 30, 2009 5:18 pm
by Versieon
yes you can, the format would be this

Code: Select all
scene.my.myheight = e.pos(1)


if you want the x coordinate, it woulf be

Code: Select all
scene.my.myheight = e.pos(0)


e.pos is the coordinates of the object in a matrix , and the 0 and 1 at the end tell which value you want to use in that matrix.

Re: defining property as variable

PostPosted: Wed Dec 30, 2009 5:46 pm
by PlanckBanck
Thanks a lot but here`s another question^^:
I want a box to have scene.my.height as text, but when I put {scene.my.height} into the text field in the script menu without the "", it displays it as correct, but then erases it.

Re: Problems with box text

PostPosted: Wed Dec 30, 2009 5:48 pm
by Versieon
it would be like this

Code: Select all
{"" + scene.my.myheight}

Re: Problems with box text

PostPosted: Wed Dec 30, 2009 5:57 pm
by PlanckBanck
wow thanks

Re: Problems with box text

PostPosted: Wed Dec 30, 2009 6:26 pm
by KarateBrot
I also made a little "How To" in the Calculate distance using laser topic:
viewtopic.php?f=13&t=1048#p10474

With it you can display the real height above the ground. If you do it just with one laser you only get the height above the absolute null level (the x-axis of algodoo's coordinate system).