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

  1. /*
  2.  
  3.   funky.cwx
  4.  
  5.   Object with text region must be selected.  Makes text look funky.
  6.   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. handle = CwGetSelectedObject()
  17.  
  18. /* no object selected */
  19. if \CwIsHandleValid(handle) then do
  20.     call CwMsg "No object selected."
  21.     exit
  22.     end
  23.  
  24. /* object must be block text or headline text */
  25. temp = CwGetProperty(handle, "Region type")
  26. if temp \= "Headline Text" & temp \= "Block Text" then do
  27.     call CwMsg "Selected object must be text, not" temp
  28.     exit
  29.     end
  30.  
  31. Ycenter = CwGetProperty(handle, "Position:Y Center")
  32. Xcenter = CwGetProperty(handle, "Position:X Center")
  33. width = CwGetProperty(handle, "Position:Width")
  34. height = CwGetProperty(handle, "Position:Height")
  35.  
  36. /* cut the text */
  37. call CwCopy handle
  38.  
  39. /* make the text tool type a Color fade */
  40. call CwSetRegion handle, "Custom Region"
  41. call CwSetTool handle, "Color Fade"
  42. areg = CwGetRegion(handle)
  43. view = CwGetView(areg)
  44.  
  45. /* make the text upside down */
  46. call CwSelectView(view)
  47. call CwPaste
  48.  
  49.  
  50. /* text */
  51. handle2 = CwFindFirstObject(CwGetCurrentView())
  52.  
  53. /* make the object the proper size */
  54. call CwSetPosition handle2, Xcenter, Ycenter, width * 0.9, height * 0.9, 0, 0
  55.  
  56. /* Using the lens tool This is KEWL */
  57. handle3 = CwDuplicateObject(handle2)
  58. call CwSetProperty handle2, "Position:Angle", 180
  59.  
  60. call CwSetTool handle3, "Lens"
  61. call CwSetRegion handle3, "Rectangle"
  62.  
  63. /* make the lens bigger */
  64. width = CwGetProperty(handle3, "Position:Width")
  65. height = CwGetProperty(handle3, "Position:Height")
  66.  
  67.  
  68. height = height *1.1
  69. width = width *1.1
  70.  
  71.  
  72. call CwSetProperty handle3, "Position:Width", width
  73. call CwSetProperty handle3, "Position:Height", height
  74.  
  75. /* change the factor */
  76. factor = CwGetTool(handle3)
  77. call CwSetProperty factor, "Factor", 1.5
  78.  
  79.  
  80.