Document , plugin and sample capx files are included
When I open up the scrollbar sample, it also looks like I need Touch Wrap plugin, Drag & Drop2 behavior, as well as the Boundary behavior.
But this is awesome anyway, I think I can use this for my game.
—
Yes, to open my sample capx, you need
Touch Wrap plugin
Drag & Drop2 behavior
Boundary behavior
and
scrolling behavior
You might build your own scroll-bar without my plugins.
Update
Add action:next page.
For example, if text could display 4 lines, the "one page" is 4 line in this situation.
Here is a sample that combining scrolling with typing in text object.
Capx
How do you set what shows up on each new line and page? What are the commands? Awesome plugin, thanks.
The content of each line or each page is calculated internal by this behavior. You might see the source code of this behavior.
line 120: get total lines of content
inst.draw(ctx);
line 122: get visible lines count of this textbox
this.visible_lines = Math.floor(inst.height/inst.pxHeight);
line 91: fuction of setting visible content
behinstProto._get_visible_lines = function (start_line_index) {...}
Oh thanks, so then how would I choose what goes on which lines? Does this only work with numbers? I'm very new to C2 Sorry and Thanks!
Develop games in your browser. Powerful, performant & highly capable.
Line number or percentage. See sample capx at first post.
I have, but I just see "str(loopindex("i")) & newline",
I tried the newline function but it gave me errors. If I wanted to have the first line say hi and the next say hello, what would I put into it's text? "Hi" & newline "Hello" doesn't work. That's what I'm asking. Sorry for having difficulty.
Try to use "action: Set content" to assign text directly.
hi, rex , may i ask is that possible to include the image into the scroll text? i guess it will be a good idea if this scroll function can work with combination of image and text together,anyway it is just an idea,cheers
stanley87
Sorry, scrolling is just a behavior of text plugin.
okay,noted,thx rex for your answer.btw,may i know how to build plugin/behaviour myself? i hope i can build myself the new plugin/behaviours myself although i m still new to construct 2 ^_^
See Javascript SDK development
okay, thank you very much ^_^