Difference between revisions of "API Panel.Position.SetCoords"

From Flowcode Help
Jump to navigationJump to search
(XML import of updated API docs)
Line 1: Line 1:
 +
 +
 
<sidebar>API contents</sidebar>
 
<sidebar>API contents</sidebar>
 
Sets an objects coordinates based on a position
 
Sets an objects coordinates based on a position
Line 19: Line 21:
  
 
==Return value==
 
==Return value==
''This call does not return a value''
+
[[Variable Types|BOOL]]
 +
 
 +
Returns true if the operation is a success, else false
  
  
Line 31: Line 35:
 
==Examples==
 
==Examples==
 
===Calling in a calculation===
 
===Calling in a calculation===
* Add to a calculation icon: <pre class="brush:[cpp]">::Panel.Position.SetCoords(dest, source)</pre>
+
* Declare a variable 'result' of type BOOL
 
+
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Panel.Position.SetCoords(dest, source)</pre>
===Flowcode example file===
 
Download [[File:SIMAPI_Panel_Position_SetCoords.fcf]] and open it in Flowcode v6. In this example there are two spheres (sourceball & destinationball) and a LCD showing the coordinates of each sphere. Every two seconds the program will move the red sphere to the coordinates of the yellow sphere, and then return the red sphere to its original position. The red sphere is slightly larger than the yellow sphere. This is purely to illustrate the red sphere moves to its correct destination (if the spheres are the exact same size then you may or may not see the red sphere properly as the program is rendering two spheres of exact dimensions in exactly the same coordinates)
 
 
 
The screenshots below show the effect and also highlight the code used by the example.
 
  
[[File:SIMAPI_Panel_Position_SetCoords_Pic1.png]][[File:SIMAPI_Panel_Position_SetCoords_Pic2.png]]
+
''<span style="color:red;">No additional examples</span>''
[[File:SIMAPI_Panel_Position_SetCoords_Pic0.png|800px]]
 

Revision as of 09:58, 17 June 2013


<sidebar>API contents</sidebar> Sets an objects coordinates based on a position

Class hierarchy

Panel

Position
SetCoords

Parameters

HANDLE Dest

The position or component to update

HANDLE Source

The position or component to read from


Return value

BOOL

Returns true if the operation is a success, else false


Detailed description

This is equivalent to the call to Set, except that the scale and rotation of the position are omitted. These may be set with SetScale and SetRotation.


This call is useful for building up a position from multiple sources.


Examples

Calling in a calculation

  • Declare a variable 'result' of type BOOL
  • Add to a calculation icon:
    result = ::Panel.Position.SetCoords(dest, source)

No additional examples