blitting text and images

Started by raft, March 30, 2010, 04:02:41 PM

Previous topic - Next topic

paulscode

Quote from: paulscodethe overhead of adding new textures was significantly more than modifying existing textures (to the point that the first option was not really an option if you want smooth video playback).

Quote from: raft on March 31, 2010, 05:12:10 PMbut i suppose you were doing this every frame ? in my case this is done once per bubble. indeed every time font size changes for each bubble but on Android font size wont change

Even still, the texture effect is a better option, because you will experience a 50-200 millisecond pause each time you add a texture, which players will notice as "hiccups" in the rendering, especially if several bubbles pop up around the same time.

raft

i guess you are right as a rule of thumb but somehow texture creation is not noticable on this thing. not on emulator and not an actual device. possibly because the created text textures are very small in size. closest 2^n x 2^m to what you see on screen.

Darkflame

The class's look really handy.

I'm working on a AR Browser and need on-the-fly generated text bubbles, so this seems appropriate.

One thing; What license do you consider this under? Though we are developing a free, open source, browser ourself (http://arwave.org/), we want people to be able to re-use and adapt our code for their own projects, even if their commercial. So we need to know any code we use if allowed for that :P


raft


Darkflame


BLadeLaRus

Nice classes, but I wonder. Did somebody use GLFont.getStringBounds(String s)? May be I downloaded older version of this class. But there is simple error. This method GLFont.getStringBounds(String s) doesn't work, it always returns width = 0.  This is happening because of charWidths[] array isn't filled on setting Paint.
Just pointing on this simple copy/paste error  ;)

EgonOlsen

I think i used this for Alien Runner and had the same problem. IIRC, raft fixed it back then. I just can't remember if i got that version from him or if he updated the download...

raft

which version is it? android or desktop?

BLadeLaRus

It is android version. I got it from first post in this topic.

raft

i've updated the links. please re-download

jt123

Is there any example source for texture pack.

raft

Quote from: jt123 on March 23, 2013, 01:50:16 PM
Is there any example source for texture pack.
you can have a look at bones demo to see sample usage
http://aptalkarga.com/bones/

jt123

Thanks i forget to use pack(). Now it works.

zerofox

hi all,

want to ask about blitting the text. is there anyway to blit text vertically? thanks

raft

not directly. you need the modify the code.