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 color markup support for label and window title. #2387

Merged
merged 6 commits into from Sep 30, 2014

Conversation

@davebaol
Copy link
Member

davebaol commented Sep 26, 2014

This should fix issue #1934

@davebaol

This comment has been minimized.

Not sure if it's worth pooling ColorChunk

@MobiDevelop
Copy link
Member

MobiDevelop commented Sep 27, 2014

What happened with Label and Window?

@davebaol

This comment has been minimized.

Copy link
Owner Author

davebaol commented on gdx/src/com/badlogic/gdx/scenes/scene2d/ui/Label.java in 0c0e308 Sep 27, 2014

This is the unique real change in Label.

@davebaol

This comment has been minimized.

Copy link
Owner Author

davebaol commented on gdx/src/com/badlogic/gdx/scenes/scene2d/ui/Window.java in 0c0e308 Sep 27, 2014

This is the unique real change in Window.

if (colorChunks.size > 0) {
colorChunks.peek().endIndex = (glyphIndices != null? glyphCount : this.idx[0] / 20);
}
colorChunks.add(new ColorChunk(color));

This comment has been minimized.

Copy link
@NathanSweet

NathanSweet Sep 27, 2014

Member

Do we want pooling?

This comment has been minimized.

Copy link
@davebaol

davebaol Sep 27, 2014

Author Member

Yeah, I was wondering if it's worth. Probably it is.
I'll add pooling If you guys think it's a good idea. Just let me know.

colorChunks.add(new ColorChunk(color));
}

private boolean textChanged;

This comment has been minimized.

Copy link
@NathanSweet

NathanSweet Sep 27, 2014

Member

I prefer fields at the top, helps give an overview of what the class needs/is doing.

This comment has been minimized.

Copy link
@davebaol

davebaol Sep 27, 2014

Author Member

Sure

@davebaol
Copy link
Member Author

davebaol commented Sep 30, 2014

So should colorChuncks be pooled?
Also, I think we can fix #2273 without having to use a real stack. We can just emulate the stack inside the colorChunks list by using a popIndex in each chunk.

@MobiDevelop
Copy link
Member

MobiDevelop commented Sep 30, 2014

Without looking in depth, I'd say that ColorChunk should be pooled.

@davebaol
Copy link
Member Author

davebaol commented Sep 30, 2014

Ok done. Both #1934 and #2273 should be fixed now.

NathanSweet added a commit that referenced this pull request Sep 30, 2014
Added color markup support for label and window title.
@NathanSweet NathanSweet merged commit 19e0a88 into libgdx:master Sep 30, 2014
@NathanSweet
Copy link
Member

NathanSweet commented Sep 30, 2014

Thanks!

BitmapFontCache has gotten quite complex with multiple pages and colors, but it's also pretty powerful.

@NathanSweet
Copy link
Member

NathanSweet commented Dec 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.