Commit Graph

95 Commits

Author SHA1 Message Date
Dhilan007 3da695b184 fixed got wrong Rect by Label::getBoundingBox. 2014-03-28 11:03:39 +08:00
Dhilan007 8a8fa743eb closed #4565:fixed logical error in Label::setFontAtlas. 2014-03-27 14:28:32 +08:00
Dhilan007 1247760d95 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop_label_fixs
Conflicts:
	cocos/2d/CCLabel.cpp
2014-03-26 11:15:48 +08:00
Dhilan007 41ffa372e8 label: Refactor implementation of shadow. 2014-03-26 11:09:16 +08:00
James Chen b6589b0b5a Merge pull request #5931 from Dhilan007/develop_label
label: Support to clip transparent area of Label, content size will be updated with only non-transparent area.
2014-03-25 16:47:12 +08:00
Dhilan007 8278a510aa Label:fixed shadow offset didn't consider 'contentScaleFactor' 2014-03-25 10:41:53 +08:00
Dhilan007 859fe98502 label:1.change default value of anchor point. 2.Shadow offset and outline size passed to new Label didn't consider 'contentScaleFactor' 2014-03-25 09:58:16 +08:00
Dhilan007 538c01e76e label:support clip blank of upper and lower margin. 2014-03-24 14:16:27 +08:00
Dhilan007 1a08cd9b32 fix typo. 2014-03-21 13:52:12 +08:00
Dhilan007 6b74794c74 fix typo and mistake in Label::setTextColor. 2014-03-21 09:47:29 +08:00
Dhilan007 9dfa099bef Label:Refactoring related functions of color. 2014-03-20 20:56:10 +08:00
andyque 8c1bf48357 fixed label font size: from int to float 2014-03-20 15:03:48 +08:00
andyque ca6851f114 fix warnings of font and RichText 2014-03-20 11:58:36 +08:00
andyque 7ae77c9335 fix cocos2dx engine internal warnings 2014-03-20 10:58:04 +08:00
Dhilan007 f76460aee8 closed issue#4434:fixed display incorrect color of label if create by font name. 2014-03-19 10:10:47 +08:00
Dhilan007 a286ed8374 fixed typo. 2014-03-18 13:48:41 +08:00
Dhilan007 cc671835f8 closed issue#4428:fixed label display incorrect if invoking getLetter and it's multi-line. 2014-03-17 18:33:15 +08:00
Dhilan007 5f6fbc6a33 label:fixed getter for font size and font name. 2014-03-14 15:18:45 +08:00
Dhilan007 971b1dd557 Label:fixed text display incorrect when come to foreground on android. 2014-03-14 14:59:26 +08:00
Dhilan007 36bfd6d2c2 label:fixed incorrect effect of outline. 2014-03-14 09:51:39 +08:00
Dhilan007 fe6f485a6b label:rename some API for clearly. 2014-03-13 21:00:36 +08:00
Dhilan007 62d0fa8564 label:rename some API for clearly. 2014-03-13 20:52:33 +08:00
Dhilan007 bc68c6b629 Refactor setter of label's font name and font size. 2014-03-13 18:46:35 +08:00
Dhilan007 3acaf3ece5 1.Label:Fixes the font rendering on Windows.
2.fixed Label::setColor crash when create the label by font name.
2014-03-12 20:39:13 +08:00
Dhilan007 c11ef679da fixed incorrect initial value of label's TextVAlignment. 2014-03-12 16:11:12 +08:00
Dhilan007 f5daf1af24 label:change default font size 2014-03-12 15:30:14 +08:00
Dhilan007 2786b40dc3 using string::empty() for judge whether string is empty. 2014-03-12 15:03:22 +08:00
Dhilan007 233b04269b label:
1.fixed crash if create label by font name and text is empty.
2.fixed getter of font name and font size is incorrect.
2014-03-12 14:49:19 +08:00
Dhilan007 6f165bb592 fixed incorrect initial value of label type. 2014-03-12 11:06:51 +08:00
Dhilan007 aefafdbe77 Add conditions to evaluate for setter of font size and font name. 2014-03-12 10:53:51 +08:00
Dhilan007 df12ca963e issue #4337:label support create by font name,compatible with old labelTTF
1.fixed color and opacity has not yet gone into effect.
2.fixed display is not consistent with old LabelTTF when content scale factor of Director not equal to 1.
2014-03-11 18:06:14 +08:00
Dhilan007 c2ef7b8796 fix incorrect implementation of Label::getContentSize 2014-03-11 15:03:16 +08:00
Dhilan007 792e182e12 typo fix and coding style improvements. 2014-03-11 14:32:07 +08:00
Dhilan007 11d3acd478 fixed inappropriate usage of inline. 2014-03-10 20:35:36 +08:00
Dhilan007 8bac35ae2a closed #4337:label support create by font name,compatible with old labelTTF. 2014-03-10 19:42:43 +08:00
Dhilan007 ac944cd42b fixed incorrect display when the size of label not enough to support display all text. 2014-03-07 15:58:49 +08:00
Dhilan007 c233b636cd closed #4301:Label support vertical alignment and assign dimensions. 2014-03-07 14:58:44 +08:00
Ricardo Quesada a0ab8fcdf3 onDraw() updated
`onDraw()` receives `const kmMat4 &transform` and `bool
transformUpdated`.

`CC_NODE_DRAW_SETUP()` is no longer used in our code.
`_modelViewTransform` is only used as a cache.
2014-03-05 15:49:08 -08:00
Dhilan007 dfdf19daff remove unused shader and also did adjust FontAtlas::getTexture 2014-03-05 16:51:16 +08:00
Dhilan007 23501b40aa issue #3629:new label support customize the effects such as Shadow[blur is unsupported], Outline 2014-03-05 15:54:40 +08:00
Dhilan007 c3c3e12ee6 close #4276:fixed crash on CocoStudioGuiTest->LabelBMFontTest. 2014-03-05 14:41:59 +08:00
Ricardo Quesada d78304599d Cache working OK.
Performance increased in 20% for static objects.
2014-02-28 16:10:48 -08:00
Ricardo Quesada 6920bec6ef transform object returns the MV
code cleaner.
the kmGL code is altogether
2014-02-28 11:20:53 -08:00
Ricardo Quesada eb66ddd931 visit and draw improved.
`visit()` and `draw()` are improved.
they both receive:
 - `Renderer`
 - `kmMat4` for transformation
 - `bool` whether or not the transform changed from the previous frame

Although `draw` and `visit` are not using the 3 new parameters,
they will start using it in the coming days (or weeks, or months).

Those parameters are needed for:
 - `Renderer` shouldn't be a singleton. There should be one renderer per Director. There could be more than one renderer
 - we should get rid of `kmGLXXX` functions since nodoby knows what is happening. the `kmMat4` is for that.
 - whenever possible, we should try to optimize the multiplications. the `dirty` flag is for that.

We need those changes, so, it is better to change the API now, and not right after v3.0-final is released.
2014-02-27 21:43:54 -08:00
Dhilan007 54f48b23e6 LabelBMFont re-implemented as a wrapper of Label. 2014-02-20 22:33:52 +08:00
Dhilan007 ddd02b463c optimize label:
1.remove unnecessary API
2.reduces object-creation and function calls.
2014-02-19 20:26:14 +08:00
Dhilan007 5361413383 replace [auto] with [const auto&] in FOR loop. 2014-02-18 16:41:01 +08:00
Dhilan007 2ad81b0edb closed #4060:fixed Label wasn't implemented correctly when Label::_fontAtlas contains multiple texture. 2014-02-18 14:30:51 +08:00
Dhilan007 e12c1f57ac Label::reduce unnecessary calculation amount. 2014-02-10 11:21:54 +08:00
Dhilan007 710b614680 fix mistake of label's transparency. 2014-01-26 21:19:40 +08:00