From 25c5c50c1163bc0e5a63750fce223be30c1e8362 Mon Sep 17 00:00:00 2001 From: Andy Yao Date: Wed, 5 Feb 2014 15:12:55 -0800 Subject: [PATCH 1/3] Added font 'size' support for pure2d layout. --- pure2D/src/com/funzio/pure2D/text/BmfTextObject.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pure2D/src/com/funzio/pure2D/text/BmfTextObject.java b/pure2D/src/com/funzio/pure2D/text/BmfTextObject.java index a9bc75ce..b3f3ab34 100644 --- a/pure2D/src/com/funzio/pure2D/text/BmfTextObject.java +++ b/pure2D/src/com/funzio/pure2D/text/BmfTextObject.java @@ -39,6 +39,7 @@ public class BmfTextObject extends BaseDisplayObject implements Cacheable { protected static final String ATT_TEXT = "text"; protected static final String ATT_TEXT_ALIGN = "textAlign"; protected static final String ATT_FONT = "font"; + protected static final String ATT_SIZE = "size"; protected BitmapFont mBitmapFont; protected TextOptions mTextOptions; @@ -433,6 +434,15 @@ public void setXMLAttributes(final XmlPullParser xmlParser, final UIManager mana if (bitmapFont != null) { setBitmapFont(bitmapFont); setText(manager.evalString(xmlParser.getAttributeValue(null, ATT_TEXT))); + final String sizeAttr = xmlParser.getAttributeValue(null, ATT_SIZE); + if (sizeAttr != null) { + try { + final int size = Integer.parseInt(sizeAttr); + setScale(size / bitmapFont.getTextOptions().inTextPaint.getTextSize()); + } catch (NumberFormatException e) { + Log.e(TAG, "Invalid value of 'size': " + sizeAttr); + } + } final String letterSpacing = xmlParser.getAttributeValue(null, ATT_LETTER_SPACING); if (letterSpacing != null) { From 2acb442f0b222b8b3bf1a97e6aec9bdbdfc5f8d2 Mon Sep 17 00:00:00 2001 From: Sheng Liu Date: Wed, 17 Sep 2014 16:06:47 -0700 Subject: [PATCH 2/3] Minor bug fixes. Update target SDK to 19. --- pure2D/AndroidManifest.xml | 2 +- pure2D/project.properties | 2 +- .../com/funzio/pure2D/animators/TweenAnimator.java | 2 +- .../pure2D/animators/UnstableMoveAnimator.java | 2 +- .../pure2D/gl/gl10/textures/BufferTexture.java | 2 +- .../loaders/tasks/VersionedDownloadTaskGroup.java | 5 +++-- .../funzio/pure2D/particles/nova/NovaEmitter.java | 2 +- .../nova/vo/RecursiveTrajectoryAnimatorVO.java | 8 ++++---- pure2D/src/com/funzio/pure2D/shapes/Polyline3D.java | 1 - pure2D/src/com/funzio/pure2D/ui/Button.java | 1 - pure2D/src/com/funzio/pure2D/ui/PageStacker.java | 12 ++++++------ pure2D/src/com/funzio/pure2D/ui/UIManager.java | 2 +- pure2D/src/com/funzio/pure2D/utils/Pure2DUtils.java | 1 - 13 files changed, 20 insertions(+), 22 deletions(-) diff --git a/pure2D/AndroidManifest.xml b/pure2D/AndroidManifest.xml index bbe4567e..8a870ca2 100644 --- a/pure2D/AndroidManifest.xml +++ b/pure2D/AndroidManifest.xml @@ -5,7 +5,7 @@ + android:targetSdkVersion="19" /> > 4); n = n | (n >> 8); n = n | (n >> 16); - n = n | (n >> 32); return n + 1; } From 267307bf750d81409aedf0a7f289460b2def556e Mon Sep 17 00:00:00 2001 From: Long Ngo Date: Thu, 18 Sep 2014 18:36:06 -0700 Subject: [PATCH 3/3] removed unused variables --- .../com/funzio/pure2D/atlas/ImageSequenceBufferAtlas.java | 6 ++---- pure2D/src/com/funzio/pure2D/ui/UIConstraint.java | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pure2D/src/com/funzio/pure2D/atlas/ImageSequenceBufferAtlas.java b/pure2D/src/com/funzio/pure2D/atlas/ImageSequenceBufferAtlas.java index 409fed39..f2713d7b 100644 --- a/pure2D/src/com/funzio/pure2D/atlas/ImageSequenceBufferAtlas.java +++ b/pure2D/src/com/funzio/pure2D/atlas/ImageSequenceBufferAtlas.java @@ -29,8 +29,6 @@ import java.util.Arrays; import java.util.Comparator; -import javax.microedition.khronos.opengles.GL10; - import android.content.res.AssetManager; import android.graphics.Point; import android.graphics.PointF; @@ -59,7 +57,7 @@ public class ImageSequenceBufferAtlas extends Atlas { public static final String TAG = ImageSequenceBufferAtlas.class.getSimpleName(); private GLState mGLState; - private GL10 mGL; + // private GL10 mGL; private BufferTexture mTexture; private FrameBuffer mFrameBuffer; @@ -106,7 +104,7 @@ public ImageSequenceBufferAtlas(final GLState glState) { Log.v(TAG, "ImageSequenceAtlas()"); mGLState = glState; - mGL = mGLState.mGL; + // mGL = mGLState.mGL; if (!FrameBuffer.isSupported()) { Log.e(TAG, "FrameBuffer is not supported!\n" + Log.getStackTraceString(new Exception())); diff --git a/pure2D/src/com/funzio/pure2D/ui/UIConstraint.java b/pure2D/src/com/funzio/pure2D/ui/UIConstraint.java index 5a97fc0f..9d31af34 100644 --- a/pure2D/src/com/funzio/pure2D/ui/UIConstraint.java +++ b/pure2D/src/com/funzio/pure2D/ui/UIConstraint.java @@ -29,7 +29,6 @@ import org.xmlpull.v1.XmlPullParser; import com.funzio.pure2D.DisplayObject; -import com.funzio.pure2D.Scene; import com.funzio.pure2D.containers.Container; import com.funzio.pure2D.containers.DisplayGroup; import com.funzio.pure2D.containers.LinearGroup; @@ -87,7 +86,7 @@ public static enum UNIT { public UNIT childrenGapUnit = UNIT.UNSET; private UIConfigVO mUIConfigVO; - private int mAxisSystem = Scene.AXIS_BOTTOM_LEFT; + // private int mAxisSystem = Scene.AXIS_BOTTOM_LEFT; private boolean mHasAttributes = false; public UIConstraint() { @@ -100,7 +99,7 @@ public UIConstraint(final XmlPullParser parser, final UIManager manager) { public void setAttributes(final XmlPullParser parser, final UIManager manager) { mUIConfigVO = manager.getConfig(); - mAxisSystem = manager.getTextureManager().getGLState().getAxisSystem(); + // mAxisSystem = manager.getTextureManager().getGLState().getAxisSystem(); mHasAttributes = false; widthUnit = getAttributeUnit(parser, ATT_WIDTH);