Skip to content

Commit

Permalink
New text layout method, word-wrap support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagamia committed Jan 2, 2017
1 parent 6ca51e9 commit f0845fc
Showing 1 changed file with 427 additions and 86 deletions.

3 comments on commit f0845fc

@Sunaries
Copy link

@Sunaries Sunaries commented on f0845fc Jan 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have replaced all the lines (with slight modifications) from KENNYSOFT@fcef546 to the GMS version. It's a big improvement.

Example)

Can I add this update to my version as well without conflicting with KENNYSOFT's code?

EDIT:

I added your code on top of what KENNYSOFT provided. Now I get the following issue:

P.S. Seems there's also an issue with the text formatting with the preview feature. In-game version ↓

@Kagamia
Copy link
Owner Author

@Kagamia Kagamia commented on f0845fc Jan 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's fixed. --> 2e3af70

Word-wrap and text renderer engine could be configured.

 //GearGraphics.cs, Line: 217
 using (var r = new FormattedTextRenderer())
 {
     r.WordWrapEnabled = true;
     r.UseGDIRenderer = false;
     r.DrawString(g, s, font, x, x1, ref y, height);
 }

Tested with CMST.121/string.wz from GMS179, switch Font to 'Microsoft YaHei', and set word-wrap enabled.

1712002

@Sunaries
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.