Page 1 of 12

[Behavior] scrolling (for text/sprite font plugin)

PostPosted: Sat May 26, 2012 3:55 am
by rexrainbow
Document , plugin and sample capx files are included

Re: [Behavior] scrolling (for text/sprite font plugin)

PostPosted: Tue Jun 05, 2012 8:39 am
by Python
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.

Re: [Behavior] scrolling (for text/sprite font plugin)

PostPosted: Tue Jun 05, 2012 9:24 am
by rexrainbow
@Python

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.rexrainbow2013-03-26 23:59:50

Re: [Behavior] scrolling (for text/sprite font plugin)

PostPosted: Tue Jul 31, 2012 1:07 am
by rexrainbow
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.
Capxrexrainbow2012-07-31 03:55:04

Re: [Behavior] scrolling (for text/sprite font plugin)

PostPosted: Mon Aug 13, 2012 8:34 pm
by Reflextions
How do you set what shows up on each new line and page? What are the commands? Awesome plugin, thanks.

Re: [Behavior] scrolling (for text/sprite font plugin)

PostPosted: Mon Aug 13, 2012 11:14 pm
by rexrainbow
@Draspur

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
[code]inst.draw(ctx);[/code]
line 122: get visible lines count of this textbox
[code]this.visible_lines = Math.floor(inst.height/inst.pxHeight);[/code]
line 91: fuction of setting visible content
[code]behinstProto._get_visible_lines = function (start_line_index) {...}[/code]rexrainbow2012-08-13 23:26:25

Re: [Behavior] scrolling (for text/sprite font plugin)

PostPosted: Tue Aug 14, 2012 1:49 am
by Reflextions
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!Draspur2012-08-14 01:52:31

Re: [Behavior] scrolling (for text/sprite font plugin)

PostPosted: Tue Aug 14, 2012 3:48 am
by rexrainbow
@Draspur

Line number or percentage. See sample capx at first post.rexrainbow2012-08-14 03:49:09

Re: [Behavior] scrolling (for text/sprite font plugin)

PostPosted: Tue Aug 14, 2012 8:20 pm
by Reflextions
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.

Re: [Behavior] scrolling (for text/sprite font plugin)

PostPosted: Wed Aug 15, 2012 4:20 am
by rexrainbow
@Draspur

Try to use "action: Set content" to assign text directly.rexrainbow2012-08-15 04:20:56