- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
如何使用 Open GL 在 Android 中显示可移动文本?或者是他们的任何其他方式来显示文本移动而没有任何 SCSS 。我已经尝试过 Android 动画和选取框,但它并没有减少 SCSS 。我需要像新闻标题一样在单行上移动的文本,从右到左。在 Open GL 中,我应该在渲染器中做什么?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
touchStart = new PointF();
objs = new GLSurfaceView(this);
sqobj = new rendsquare();
objs.setRenderer(sqobj);
setContentView(objs);
TextView editBox = new TextView(getApplicationContext());
editBox.setTextColor(Color.BLUE);
editBox.setEllipsize(TruncateAt.MARQUEE);
editBox.setMarqueeRepeatLimit(-1);
editBox.setHorizontallyScrolling(true);
editBox.setFocusable(true);
editBox.setFocusableInTouchMode(true);
editBox.setText("Hello GL testing 123 hello hello h r u i am fine hello u there hello! hello !! !! !! !!");
addContentView(editBox, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}
//另一个
public class SquaropnglActivity extends Activity {
private rendsquare sqobj;
private PointF touchStart;
private GLSurfaceView objs;
Animation mAnimation = new TranslateAnimation(300f, -300f, 0.0f, 0.0f);
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
touchStart = new PointF();
objs = new GLSurfaceView(this);
sqobj = new rendsquare();
objs.setRenderer(sqobj);
setContentView(objs);
mAnimation.setRepeatMode(1);
mAnimation.setInterpolator(new DecelerateInterpolator());
mAnimation.setDuration(3000L);
mAnimation.setRepeatCount(-1);
TextView editBox = new TextView(getApplicationContext());
editBox.setTextColor(Color.BLUE);
editBox.setAnimation(mAnimation);
editBox.setTextSize(40);
editBox.setLines(1);
editBox.setText("Hello GL testing 123 hello hello h r u i am fine hello u there hello! hello !! !! !! !!");
addContentView(editBox, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}
最佳答案
如果你想用opengl方式进行文字渲染,请在你的代码中编写文字绘制逻辑onDrawFrame(gl)
方法并在每个帧更新时更新文本位置以具有选取框动画。
对于文本渲染,请查看OpenGL Text Rendering
还没有测试过。它应该适合你。最良好的祝愿。
关于android - Opengl Android 中的可移动文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11082008/
我想在 iOS 中以编程方式制作二维模型。像这样: 这取自应用 Gomoji . 我用谷歌搜索但没有得到正确的解决方案。这个角色也在移动,所以它可以移动手和腿,同时我想改变手的颜色等。 SpriteK
也许是个愚蠢的问题: C++ 中有没有一种方法可以防止枚举类类型被复制? 最佳答案 没有。枚举是整数。并且整数始终是可复制/可移动的。 您当然可以创建一个从枚举构造的实际类。而那个类(class)可以
看起来 jqGrid 是基于 jQuery 对话框的,是否有可能使其可移动(像对话框一样)?我已经能够将它放在对话框中,但有两个标题栏等看起来很奇怪。我“认为”可以向其中添加必要的类以使其可移动,但我
我正在尝试创建一个交互式待办事项列表,我在其中将文本输入文本框,单击一个按钮,它会在下面添加项目。到目前为止,我已经成功地使用按钮将项目添加到我的列表中,但我无法通过单击一次删除一个项目,这是我希望能
是否可以创建一个可移动的 QGraphicsItem,它可以用鼠标右键而不是左键移动? 我唯一能通过搜索找到的是一个线程 which suggests using QGraphicsItem::set
我一直在尝试拼凑一个项目,该项目包含一个在侧面滚动的 Collection View ,当点击一个单元格时,它将向场景添加一个新的 ImageView 。我希望这张新图片可以拖动。 我的代码当前显示
是否有任何允许重新排序它们的 Angular JS 选项卡指令(如浏览器的选项卡) 如果不是开始实现会很棒 使用 angular-ui-bootstap 如何使它们可重新排序
我已经向 Mac App Store 提交了一个帮助应用程序(使用 LSUIElement)。我的错误印象是 App Store 安装过程会为辅助应用程序放置一个停靠栏图标。 我如何创建一个用户可以删
我有一个设置错误的表(作为应用程序表,但创建了一个维护 View ),但它应该是一个自定义表,以便我们能够传输表的条目。 到目前为止,我更改了表格的类型和可维护性,现在它是 C 类型(自定义),可以不
您好,我在我的网站上使用谷歌地图。我想在保持 map 可移动的同时使用图像为其覆盖(用户可以四处拖动和缩放) 到目前为止我做了什么: 我创建了 map ,然后我使用伪 :before 元素来调用我想作
我想制作一些有趣的可移动 div。我有以下代码: dragElement(document.getElementById("draggable_shortcut")); functio
我正在使用 FloatingActionButton在我的应用程序中。有时,它会与基本内容重叠,所以我想制作它以便用户可以将 FAB 拖到一边。 本身不需要拖放功能。它只需要是可移动的。文档没有提到这
我想制作一个具有自定义外观的安装程序,并通过将 BorderStyle 设置为 bsNone 来禁用标题栏。 现在我无法再移动窗口了。我环顾四周,找到了 Delphi 的解决方案: http://ww
我有两种纹理:背景和蒙版。我需要使掩码的输出定义显示的表单背景。非常重要的部分是 mask 的尺寸需要小于背景我将在运行时移动它以显示背景的部分。 项目在 WP7 上,所以数量有限 BlendStat
我的摩托罗拉手机有 12GB 内部存储和可移动 SD 卡功能。 在 DDMS 文件资源管理器中,我的内部手机存储 (12GB) 挂载为 sdcard,我的可移动 sdcard 挂载为 sdcard-e
如何获取所有驱动器的列表以及相应的驱动器类型(可移动、本地磁盘或 cd-rom、dvd-rom 等)? 最佳答案 通过这段代码你可以获得所有驱动器及其类型描述 File[] paths; FileSy
我正在尝试打印驱动器盘符及其系统类型。在此程序中,它将硬盘驱动器打印为逻辑驱动器,将 cd 驱动器打印为 cd 驱动器,将存储卡打印为可移动驱动器。当我插入外部硬盘和 pendrive (sandis
我正在使用 Angular2 及其 Material Design( https://material.angular.io ) 创建一个小型网络应用程序,我在其中使用 MdDialog 来使用以下代
std::vector> foo; //populate foo. 自从新标准以来 vector 是可移动的,但不幸的是他们还没有使可选的可移动:( 有没有制作可选可移动的计划? 上面的 vector
我是一名优秀的程序员,十分优秀!