[TYPO3] mask

Miroslav Monkevic miroslav at monkevic.info
Wed Mar 21 11:51:03 CET 2007


Hello,

change:

     80.text = hello!

to:

     80.text.cObject < tt_content.image.20.1.altText

or even:


     80.text.cObject < tt_content.image.20.1.titleText


BTW I've submitted the improved version of script (saved few calls, 
improved readability) under link you provided. However commenting form 
there dos not respect line breaks, so I repeat it here.

###

tt_content.image.20.1.file >
tt_content.image.20.1.file {
  import.current = 1
  width.field = imagewidth
  m.mask = GIFBUILDER
  m.mask {
        # Here we create a dynamic mask with the exact same
        # dimensions as the actual image, but with rounded corners
    XY = [10.w],[10.h]
    format = gif
        # Since the "XY" parameter doesn't have stdWrap, we "find"
        # the size by simply loading the original image again.
    10 = IMAGE
    10.file {
      import.current = 1
      width.field = imagewidth
      maxW = {$styles.content.imgtext.maxW}
      maxW.override.data = register:maxImageWidth
      maxWInText = {$styles.content.imgtext.maxWInText}
      maxWInText.override.data = register:maxImageWidthInText
    }
        # Create a white box that fills the entire area
    20 = BOX
    20.dimensions = 0,0,[10.w],[10.h]
    20.color = #FFFFFF
        # Add Top-Left corner mask
    30 = IMAGE
    30.file = {$imagePath}cornermask_tl.gif
    30.align = l,t
        # Add Top-Right corner mask
    40 = IMAGE
    40.file = {$imagePath}cornermask_tr.gif
    40.align = r,t
        # Add Bottom-Left corner mask
    50 = IMAGE
    50.file = {$imagePath}cornermask_bl.gif
    50.align = l,b
        # Add Bottom-Left corner mask
    60 = IMAGE
    60.file = {$imagePath}cornermask_br.gif
    60.align = r,b
  }
    # The fastest method (recommended) is using a static image, like this:
    #m.bgImg = {$imagePath}clear.gif
    # But it can also be done dynamically, like this:
  m.bgImg = GIFBUILDER
  m.bgImg {
        # Here we create a dynamic bgMask
        # Dimensions of this image is unimportant
    XY = [10.w],[10.h]
    format = gif
    10 = BOX
    10.dimensions = 0,0,10,10
    10.color = {$bgColor}
  }
}

###

Cheers!



Bas van der Togt wrote:
> Hello list i found the following script on 
> http://www.typo3wizard.com/en/snippets/gifbuilder/dynamic-imagemasks-using-gifbuilder.html
> It's working great, but i want to add an function.
> I made an white balk in the middle of the image, but now i want to add 
> the text from the alt or title which is entered with the image.
> Can somebody help me to do this? Your help would be great!
>
> cheers,
> Bas
>
> script:
> # Mask
> tt_content.image.20.1.file >
> tt_content.image.20.1.file {
>    import.current = 1
>    width.field = imagewidth
>    m.mask.import.cObject = IMG_RESOURCE
>    m.mask.import.cObject.file = GIFBUILDER
>    m.mask.import.cObject.file {
>      # Here we create a dynamic mask with the exact same
>      # dimensions as the actual image, but with rounded corners
>      XY = [10.w],[10.h]
>      format = gif
>      # Since the "XY" parameter doesn't have stdWrap, we "find"
>      # the size by simply loading the original image again.
>      10 = IMAGE
>      10.file {
>        import.current = 1
>        width.field = imagewidth
>        maxW = imagewidth
>        maxW.override.data = register:maxImageWidth
>        maxWInText = {$styles.content.imgtext.maxWInText}
>        maxWInText.override.data = register:maxImageWidthInText
>      }
>      # Create a white box that fills the entire area
>      20 = BOX
>      20.dimensions = 0,0,[10.w],[10.h]
>      20.color = #FFFFFF
>      # Add Top-Left corner mask
>      30 = IMAGE
>      30.file = {$imagePath}cornermask_tl.gif
>      30.align = l,t
>      # Add Top-Right corner mask
>      40 = IMAGE
>      40.file = {$imagePath}cornermask_tr.gif
>      40.align = r,t
>      # Add Bottom-Left corner mask
>      50 = IMAGE
>      50.file = {$imagePath}cornermask_bl.gif
>      50.align = l,b
>      # Add Bottom-Left corner mask
>      60 = IMAGE
>      60.file = {$imagePath}cornermask_br.gif
>      60.align = r,b
>      70 = BOX
>      70.dimensions = 0,60,190,20
>      70.color = green
>      80 = TEXT
>      80.text = hello!
>      80.offset = 15,75
>      80.niceText = 1
>      80.fontSize= 12
>      80.fontFile = t3lib/fonts/verdana.ttf
>      80.fontColor = black
>      80.shadow.offset = 2,2
>      80.shadow.blur = 60
>      80.shadow.opacity = 40
>    }
>    # The fastest method (recommended) is using a static image, like this:
>    #m.bgImg = {$imagePath}clear.gif
>    # But it can also be done dynamically, like this:
>    m.bgImg.import.cObject = IMG_RESOURCE
>    m.bgImg.import.cObject.file = GIFBUILDER
>    m.bgImg.import.cObject.file {
>      # Here we create a dynamic bgMask
>      # Dimensions of this image is unimportant
>      XY = [10.w],[10.h]
>      format = gif
>      10 = BOX
>      10.dimensions = 0,0,10,10
>      10.color = {$bgColor}
>    }
> }
>   

-- 
Best regards,
Miroslav Monkevic




More information about the TYPO3-english mailing list