Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new fe.Text property msg_wrapped #507

Merged
merged 3 commits into from
Dec 20, 2018

Conversation

oomek
Copy link
Collaborator

@oomek oomek commented Nov 13, 2018

Allows to retrieve text of the object after word wrapping.

Example nut file:

local t1 = fe.add_text ( "Lorem ipsum dolor sit amet consectetur adipiscing elit", 0, 0, 400, 400 )
t1.set_bg_rgb( 200, 100, 100 )
t1.char_size = 40
t1.word_wrap = true
t1.align = Align.TopLeft

local t2 = fe.add_text ( "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua", 400, 0, 400, 400 )
t2.set_bg_rgb( 100, 200, 100 )
t2.char_size = 40
t2.word_wrap = true
t2.align = Align.TopLeft

local t3 = fe.add_text ( t1.msg + " " +  t2.msg, 0, 400, 800, 800 )
t3.set_bg_rgb( 100, 100, 100 )
t3.char_size = 40
t3.word_wrap = true
t3.align = Align.TopLeft

local t4 = fe.add_text ( t1.msg_wrapped + t2.msg_wrapped, 800, 400, 800, 800 )
t4.set_bg_rgb( 100, 100, 200 )
t4.char_size = 40
t4.word_wrap = true
t4.align = Align.TopLeft

function tick( ttime )
{
	t3.char_size = 40 + cos( ttime * 0.005 ) * 10.0
	t4.char_size = 40 + cos( ttime * 0.005 ) * 10.0
}
fe.add_ticks_callback( "tick" )

oomek and others added 2 commits November 13, 2018 19:05
@oomek oomek requested a review from mickelson November 23, 2018 14:36
@mickelson mickelson merged commit 5c83e3d into mickelson:master Dec 20, 2018
@oomek oomek deleted the feature-msg_wrapped branch December 30, 2018 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants