| Register Now | |
| My Points | |
| My Games | |
| Page 2 of 2 (17 messages) | « First page... 1 2 |
No, you don't need those functions since you won't be calling them. They are examples that create custom shapes. The shape you want, CupShape is built in.
To set a shape on a markup box, you use the box's pageShape property:
myMarkupBox.pageShape = myPageShape;
myMarkupBox.draw( g, myTextRegion );
In your case, the shape will either be PageShape.RECTANGLE_SHAPE (a special shape that produces the standard non-indented result) or a CupShape that you will create ahead of time in createFrontPainter and store in a global variable (just like you do with the markup boxes).
In the part of the if statement that is executed when the image is shown, you will set the cup shape to flow the text around the image. In the part of the if statement that is executed when the image is not shown, you'll use RECTANGLE_SHAPE to get the standard text flow. For this card,, the actual region that the text is drawn in will be the same (the large rectangle from just under the title to the bottom of the card). Only the shape changes.
CupShapes are defined using 5 values:
flowAroundImageShape = new PageShape.CupShape( leftInset1, rightInset1, y, leftInset2, rightInset2 );
leftInset1, rightInset1 are the amounts that the margins in the top part of the shape will be reduced by
leftInset2, rightInset2 are the amounts that the margins in the bottom part of the shape will be reduced by
y is the point at which to switch from the top set of insets to the bottom set of insets
All you want to indent is the top left corner, so your values will be:
( indentAmount, 0, y, 0, 0 )
where:
indentAmount is the width of the area where the images are displayed
y is a y-position just under the bottom of the images
Cheers,
Chris
malitia vetus... tandem venit
Well, after months of working on this I finally have it!! I couldn't have done it with out you. Thank you, Chris!
Musha
| Page 2 of 2 (17 messages) | « First page... 1 2 |