home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 November / PCO_1198.ISO / filesbbs / os2 / tspg202s.arj / TSPG202S.ZIP / Scripts / GREYSHAD.CWX < prev    next >
Encoding:
Text File  |  1997-05-04  |  2.4 KB  |  89 lines

  1. /*
  2.  
  3.   funky.cwx
  4.  
  5.   Object with text region must be selected.  Creates a typical shadow
  6.   for text.  Objects may need to be rearranged.
  7.  
  8.  Copyright 1997 by TrueSpectra Inc.                                  
  9.                                                                      
  10.  This code is provided purely for demonstration purposes and is not  
  11.  supported or under warranty.  Feel free to modify and examine this  
  12.  example script for your own purposes.                               
  13.  
  14. */
  15.  
  16.  
  17. /* Object with text region must be selected               */
  18. /* Creates a typical shadow for text                      */
  19. /* Objects may need to be rearranged                      */
  20. handle = CwGetSelectedObject()
  21.  
  22. /* no object selected */
  23. if \CwIsHandleValid(handle) then do
  24.     say "No object selected."
  25.     exit
  26.     end
  27.  
  28. /* object must be block text or headline text */
  29. temp = CwGetProperty(handle, "Region type")
  30. if temp \= "Headline Text" & temp \= "Block Text" then do
  31.     say "Selected object must be text, not" temp
  32.     exit
  33.     end
  34.  
  35.  
  36. duphandle = CwDuplicateObject(handle)
  37.  
  38. Ycenter = CwGetProperty(duphandle, "Position:Y Center")
  39. Xcenter = CwGetProperty(duphandle, "Position:X Center")
  40.  
  41. Height  = CwGetProperty(duphandle, "Position:Height")
  42. Width   = CwGetProperty(duphandle, "Position:Width")
  43.  
  44. /* make object black */
  45. call CwSetRegion duphandle, "Custom Region"
  46. call CwSetTool duphandle, "Solid Color"
  47. handle2 =  CwGetTool(duphandle)
  48.  
  49. red = CwGetProperty(handle2, "Color:Red")
  50. green = CwGetProperty(handle2, "Color:Green")
  51. blue = CwGetProperty(handle2, "Color:Blue")
  52.  
  53. red = 0
  54. green = 0
  55. blue = 0
  56.  
  57. call CwSetProperty handle2, "Color:Red", red
  58. call CwSetProperty handle2, "Color:Green", green
  59. call CwSetProperty handle2, "Color:Blue", blue
  60.  
  61. regview = CwGetRegion(duphandle)
  62. view2 = CwGetView(regview)
  63.  
  64. call CwCopy handle
  65. call CwSelectView view2
  66. call CwPaste
  67.  
  68. iv1 = CwFindFirstObject(CwGetCurrentView())
  69. iv2 = CwDuplicateObject(iv1)
  70.  
  71. call CwSetPosition iv1, Xcenter, Ycenter, Width, Height, 0, 0
  72. call CwSetTool iv1, "Solid Color"
  73.  
  74. call CwSetPosition iv2, Xcenter, Ycenter, Width, Height, 0, 0
  75. call CwSetRegion iv2, "Rectangle"
  76. call CwSetTool iv2, "Blur"
  77.  
  78. red = 128
  79. green = 128
  80. blue = 128
  81.  
  82. iv3 = CwGetTool(iv1)
  83. call CwSetProperty iv3, "Color:Red", red
  84. call CwSetProperty iv3, "Color:Green", green
  85. call CwSetProperty iv3, "Color:Blue", blue
  86.  
  87.  
  88. call CwMoveObjectBehindObject duphandle , handle
  89.