Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Flipper 6.0 Help File - <b>obj_add()</b> c_demo http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
OBJ_ADD()                                                           C_DEMO
   Adds an object to a drawing under program control.

   Syntax
         nCount = OBJ_ADD(nObjectType,nFgColor,nBgFill,nPattern,InfoArray
                          [,cDesc,nAppend])

   Arguments
         nObjectType      Sets the type of object to add:
        +------------------------------------------------------------+
        |Object Types                                                |
        -------------------------------------------------------------|
        |LINE      |ROUND OBJECTS                        |TEXT OBJECT|
        |OBJECTS   |-------------------------------------|           |
        |          |Center-drag|3-point|Object Type      |           |
        |----------+-----------+-------+-----------------+-----------|
        |1|Box     |     10    |  -10  |Circle           |20 |Text   |
        |2|Polygon |     11    |  -11  |Oval             |   |       |
        |3|Line    |     12    |  -12  |Circle Arc       |   |       |
        |4|Polyline|     13    |  -13  |Oval Arc         |   |       |
        | |        |     14    |  -14  |Pie Slice        |   |       |
        | |        |     15    |  -15  |Pie Oval         |   |       |
        | |        |     16    |  -16  |Closed Circle Arc|   |       |
        | |        |     17    |  -17  |Closed Oval Arc  |   |       |
        +------------------------------------------------------------+

         nFgColor     Sets the color of object: 0 - 255, -1 uses layer color.
         nBgFill      Filled objects: hatching style.
                                     (circles, boxes, polygons)
                      Line objects: No affect. (lines, arc)

                      Bitmapped Text: Background text color, -1 is
                                      transparent. Stroke text does not have a
                                      background color.
         nPattern     Filled objects: Background color for the pattern.
                      Line objects: Dashed line style.
                      Text: Font handle.

         nInfoArray   Sets information about the object that varies by type:
         +---------------------------------------------------------------+
         |Parameters For aInfoArray                                      |
         ----------------------------------------------------------------|
         |Type |Array|Elements                                           |
         |-----+-----+---------------------------------------------------|
         |1    | 1(N)|Starting X world coordinate                        |
         |Box  | 2(N)|Starting Y world coordinate                        |
         |     | 3(N)|Number of points (always 2)                        |
         |     | 4(N)|Ending X world coordinate                          |
         |     | 5(N)|Ending Y world coordinate                          |
         |     | 6(N)|Drawing instruction (always 1)                     |
         ------+-----+---------------------------------------------------|
         |2    | 1(N)|Starting X world coordinate                        |
         |Poly | 2(N)|Starting Y world coordinate                        |
         | gon | 3(N)|Total number of points                             |
         |     | 4(N)|Second X world coordinate                          |
         |     | 5(N)|Second Y world coordinate                          |
         |     | 6(N)|Drawing instruction repeating by 3 until...        |
         |     |  (N)|Last X world coordinate                            |
         |     |  (N)|Last Y world coordinate                            |
         |     |  (N)|Drawing instruction 1 - draw line                  |
         ------+-----+---------------------------------------------------|
         |3    | 1(N)|Starting X world coordinate                        |
         |Line | 2(N)|Starting Y world coordinate                        |
         |     | 3(N)|Number of points (always 2)                        |
         |     | 4(N)|Ending X world coordinate                          |
         |     | 5(N)|Ending Y world coordinate                          |
         |     | 6(N)|Drawing instruction (always 1)                     |
         ------+-----+---------------------------------------------------|
         |4    | 1(N)|Starting X world coordinate                        |
         |Poly | 2(N)|Starting Y world coordinate                        |
         | line| 3(N)|Total number of points                             |
         |     | 4(N)|Second X world coordinate                          |
         |     | 5(N)|Second Y world coordinate                          |
         |     | 6(N)|Drawing instruction repeating by 3 until...        |
         |     |  (N)|Last X world coordinate                            |
         |     |  (N)|Last Y world coordinate                            |
         |     |  (N)|Drawing instruction                                |
         |     |     |---------------------------------------------------|
         |     |     |0    |Move, but do not plot                        |
         |     |     |1    |Move and plot                                |
         ------+-----+---------------------------------------------------|
         |10 - | 1(N)|Center X world coordinate                          |
         | 17  | 2(N)|Center Y world coordinate                          |
         |Curve| 3(N)|X radius                                           |
         |     | 4(N)|Y radius                                           |
         |     | 5(N)|Arc start (0-3600)                                 |
         |     | 6(N)|Arc width (0-3600)                                 |
         ------+-----+---------------------------------------------------|
         |20   | 1(N)|X world coordinate                                 |
         |Text | 2(N)|Y world coordinate                                 |
         |     | 3(N)|Justification                                      |
         |     |     |---------------------------------------------------|
         |     |     |0    |Start                                        |
         |     |     |1    |Center                                       |
         |     |     |2    |End                                          |
         |     |     |---------------------------------------------------|
         |     | 4(N)|Registration                                       |
         |     |     |---------------------------------------------------|
         |     |     |0    |Top                                          |
         |     |     |1    |Baseline                                     |
         |     |     |2    |Center                                       |
         |     |     |3    |Bottom                                       |
         |     |     |---------------------------------------------------|
         |     | 5(N)|Horizontal scale                                   |
         |     | 6(N)|Vertical scale                                     |
         |     |     |---------------------------------------------------|
         |     |     |Bit   |1 (standard) to 4                           |
         |     |     |Fonts |                                            |
         |     |     |------+--------------------------------------------|
         |     |     |Stroke|1 (tiny) to 100                             |
         |     |     |Fonts |                                            |
         |     |     |---------------------------------------------------|
         |     | 7(N)|Angle (0-3600) in increments of 10                 |
         |     | 8(N)|Direction                                          |
         |     |     |---------------------------------------------------|
         |     |     |0    |Right to left                                |
         |     |     |1    |Left to right                                |
         |     |     |2    |Bottom to top                                |
         |     |     |3    |Top to bottom                                |
         |     |     |---------------------------------------------------|
         |     | 9(N)|Text                                               |
         +---------------------------------------------------------------+

         OPTIONAL PARAMETERS
         cDesc       Sets a description of object.
         nAppend     Sets whether to make this a continuation of the current
                     hot object.
                     0 = Add to current object (breakable)
                     1 = Add to current object (unbreakable)
                     [Default] = This is a new object

   Returns
         nCount      Object position in stack layer.

   Description
         OBJ_ADD() adds objects under program control using parameters from
         any source. It can be used, among other things, to create pre-defined
         templates and parametric designs of objects.

         nFgColor is the color of the object. If a -1 is entered, then the
         object will take the color of the layer it is on.

         nBgFill is the background fill pattern for the object. For the
         nObjectType of 20 (text) it is the background color for the font and
         can be set from 0-15.

         nPattern sets the background pattern. For nObjectType of 20 (text),
         this is the font handle. For line objects, the line pattern is set.

See Also: CIRCLE_3PT() MS_OBJECT() MS_POINTS()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson