Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - getscrattr() return the attribute at screen location http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getscrattr()        Return the attribute at screen location
------------------------------------------------------------------------------
 Declaration
   screen.hdr

 Syntax
   func uint getscrattr extern
   param value uint uRow, ;
         value uint uCol

 Arguments
   uRow is a screen row number.
   uCol is a screen column number.

 Return
   A color attribute value.

 Description
   This function returns the current screen attribute at the specified
   screen position. The function directly accesses screen memory,
   independent of the current screen driver.

 Example
   #define EXAMPLE_SCREEN
   #include example.hdr

   // This code reads the screen attribute at start, and saves it, so that the
   // screen can be cleared with the same attribute at program termination.
   
   proc Test_getscrattr
   vardef
      byte bColor
   enddef
   bColor := getscrattr( row(), col() ) // save color attribute at cursor
   __syscolor[ CLR_STD ] := RED_WHITE   // change colors
   ? "Hello world"                      // do some output
   wait
   __syscolor[ CLR_STD ] := bColor      // restore color
   clear                                // clear screen
   endpro

   proc main
   Test_getscrattr()
   endproc

See Also: getscrchar() getscrcharattr() putscrattr()

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