Jake Knickerbocker <[email protected]> wrote:
> Basically I have a large block of text being drawn with a
> text actor. What I'd like to do is make this block scrollable
> but I want to restrict the text to a given box. Any text
> scrolling off the top or bottom would be hidden.
>
> But behind this text is a background image that would
> still remain visible above and below the text box.
I think you could do this by putting the text and the background actor
in a ClutterGroup and then put the text within another inner
ClutterGroup and set a clip on it. So you would have a hierarchy of
actors like this:
a) ClutterGroup
|
+-- b) ClutterTexture (for the background)
|
+-- c) ClutterGroup (with a clip to clip the text)
|
+-- d) ClutterText (to show the label)
You would then want to set the size of group c to be the same size as
the background image. You can set a clip on the group with
clutter_actor_set_clip_to_allocation. This should also clip the
children. You could then scroll the text simply by changing its position
within the group. It would look kind of like this:
+--------------------+ /- ClutterGroup
| (background image) | /
| +------------------+--+
| | | | ← move label this way ←
Some long text that you want to scroll within the group
+-+------------------+ | | |
| | +-----------------+
+---------------------+ this part of text is not visible
|
|
|
clip on this group
Hope that helps.
- Neil
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list