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

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
(7 intermediate revisions by 2 users not shown)
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 11: Line 11:
  
 
==Parameters==
 
==Parameters==
[[Variable types|HANDLE]] ''Dest''
+
[[Variable Types|HANDLE]] ''Dest''
 
:The position or component to update
 
:The position or component to update
  
[[Variable types|HANDLE]] ''Source''
+
[[Variable Types|HANDLE]] ''Source''
 
:The position or component to read from
 
:The position or component to read from
  
  
 
==Return value==
 
==Return value==
''This call does not return a value''
+
[[Variable Types|BOOL]]
 +
 
 +
Returns true if the operation is a success, else false
  
  
 
==Detailed description==
 
==Detailed description==
''<span style="color:red;">No additional information</span>''
+
This is equivalent to the call to [[API Panel.Position.Set|Set]], except that the ''scale'' and ''rotation'' of the position are omitted. These may be set with [[API Panel.Position.SetScale|SetScale]] and [[API Panel.Position.SetRotation|SetRotation]].
 +
 
 +
 
 +
This call is useful for building up a position from multiple sources.
  
  
 
==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===
 
From the '''SimulationAPIExamples''' folder load '''SIMAPI_Panel_Position_SetCoords.fcf''' file into Flowcode. 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]]
 

Latest revision as of 15:57, 16 January 2014

<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