mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Merge branch 'develop' of github.com:cocos-creator/cocos2d-x-lite into develop
Conflicts: cocos/platform/android/CCDevice-android.cpp cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java cocos/platform/ios/CCDevice-ios.mm cocos/platform/mac/CCDevice-mac.mm cocos/platform/win32/CCDevice-win32.cpp
This commit is contained in:
@@ -145,14 +145,8 @@ public final class Cocos2dxBitmap {
|
||||
public static boolean createTextBitmapShadowStroke(byte[] bytes, final String fontName, int fontSize,
|
||||
int fontTintR, int fontTintG, int fontTintB, int fontTintA,
|
||||
int alignment, int width, int height,
|
||||
boolean shadow, float shadowDX, float shadowDY, float shadowBlur, float shadowOpacity,
|
||||
boolean stroke, int strokeR, int strokeG, int strokeB, int strokeA, float strokeSize, boolean enableWrap, int overflow) {
|
||||
String string;
|
||||
if (bytes == null || bytes.length == 0) {
|
||||
return false;
|
||||
} else {
|
||||
string = new String(bytes);
|
||||
}
|
||||
boolean stroke, int strokeR, int strokeG, int strokeB, int strokeA,
|
||||
float strokeSize, boolean enableWrap, int overflow, boolean enableBold) {
|
||||
|
||||
Layout.Alignment hAlignment = Layout.Alignment.ALIGN_NORMAL;
|
||||
int horizontalAlignment = alignment & 0x0F;
|
||||
@@ -169,7 +163,7 @@ public final class Cocos2dxBitmap {
|
||||
break;
|
||||
}
|
||||
|
||||
TextPaint paint = Cocos2dxBitmap.newPaint(fontName, fontSize);
|
||||
TextPaint paint = Cocos2dxBitmap.newPaint(fontName, fontSize, enableBold);
|
||||
|
||||
if (stroke) {
|
||||
paint.setStyle(TextPaint.Style.STROKE);
|
||||
@@ -252,7 +246,7 @@ public final class Cocos2dxBitmap {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static TextPaint newPaint(final String fontName, final int fontSize) {
|
||||
private static TextPaint newPaint(final String fontName, final int fontSize, final boolean enableBold) {
|
||||
final TextPaint paint = new TextPaint();
|
||||
paint.setTextSize(fontSize);
|
||||
paint.setAntiAlias(true);
|
||||
@@ -271,7 +265,11 @@ public final class Cocos2dxBitmap {
|
||||
paint.setTypeface(Typeface.create(fontName, Typeface.NORMAL));
|
||||
}
|
||||
} else {
|
||||
paint.setTypeface(Typeface.create(fontName, Typeface.NORMAL));
|
||||
if(enableBold) {
|
||||
paint.setTypeface(Typeface.create(fontName, Typeface.BOLD));
|
||||
} else {
|
||||
paint.setTypeface(Typeface.create(fontName, Typeface.NORMAL));
|
||||
}
|
||||
}
|
||||
|
||||
return paint;
|
||||
|
||||
Reference in New Issue
Block a user