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>layer_info()</b> c_demo http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
LAYER_INFO()                                                        C_DEMO
   Stores descriptions from all objects in the layer into an array.

   Syntax
         nNumberOfDesc = LAYER_INFO([nLayerNumber] [,aDescArray]
                                    [,aMarkArray] [,aIndex])

   Arguments
         OPTIONAL PARAMETERS
         nLayerNumber Sets the number of the layer to search. If not
                      specified, the current layer is used.
         aDescArray   Sets the array to store any found descriptions.
         aMarkArray   Array to store whether the object is Marked or not.
         aIndex       Array to store the object numbers.

   Returns
         nNumberOfDesc     Returns the number of descriptions found.

   Description
         LAYER_INFO() stores the descriptions from all objects in the
         specified layer into aDescArray. Descriptions are stored in object
         number order. aMarkArray stores whether the object is hot or not. A 1
         means the object is hot, and a 0 means it is not hot. Object numbers
         correspond with the array elements. aIndex stores the object numbers.

   Examples

         Displays all object descriptions in current layer:

         DECLARE Mark_or_Not[2]
         Mark_or_Not[1] = "not marked."
         Mark_or_Not[2] = "marked."
         IF LAYER_CNT() # 0                       && If there are objects
            DECLARE desc_array[LAYER_CNT()]       && Create proper array
            DECLARE mark_array[LAYER_CNT()]       && Create proper array
            LAYER_INFO(LAYER_CURR(),desc_array,mark_array)
                                                    && Store desc to array
            vert = 3
            FOR i = 1 TO LEN(desc_array)          && Process all elements
               @ vert,10 SAY desc_array[i]        && Say description
               @ vert+1,14 SAY "Object is "+Mark_or_Not[Mark_array[i]-1]
               IF vert 22                         && At bottom display row
                  KEY_PRESS()                     && Wait for mouse button
                  vert = 3                        && Reset row to top
               ENDIF
            vert = vert+2                         && Increment row #
            NEXT
            KEY_PRESS()                           && Wait for mouse button
            OBJS_MAP()                            && Redraw objects
         ENDIF

See Also: LAYER_CNT() LAYER_CURR() LAYER_NUM() LAYER_ON() OBJ_ARRSIZ()

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