Direct comparison of medium sized game Flash/AS3 vs. OpenFL/Haxe + Issues

I believe it is -rpi, not -Drpi

Yes, you should be able to use -minify for HTML5 builds, or if you use the “Release Final” build config (instead of release) we default to enabling dead-code-elimination and minification: openfl test html5 -final

Build system switched to RPI but failed to find a header for RPI cam or something in SDL.

Error: In file included from ./lib/sdl/src/video/raspberry/SDL_rpiopengles.c:25:0:
./lib/sdl/src/video/raspberry/SDL_rpivideo.h:28:22: fatal error: bcm_host.h: No such file or directory
#include “bcm_host.h”

Very nice. Thank you!

Hi @singmajesty

Did you had time to look into this textfield issues?
Just asking. If not then maybe I will try to have a look. No idea if this would mean any success any ways.

Best regards
Andreas

Hi,

I am still concerned about memory usage. Is there somewhere a good article explaining how assets are handled regarding memory usage? I read somewhere they are preloaded thus using memory even if not used (like compressed or uncompressed for art assets?) and there are possibilities to load them asynchronously and then being not preloaded. Is there somewhere a article summing this up?

I also read somewhere that one could use texture compression maybe. Hmm. Any article about this?

Many thanx and best regards
Andreas

Regarding textfield issues, I forget, did we have a reproduction case?

Yes, any preload="true" assets are loaded automatically at the beginning. If you set them not to preload, you can Assets.loadBitmapData (etc) to load them later.

We have cache = true on by default when using Assets.getBitmapData and other commands, but this can be set to false. You can also use Assets.cache yourself, later, to clear references from the cache.

We use an Image, Canvas or ImageData object, depending on the use of a BitmapData object, then also have a GL texture when you use WebGL rendering. You can test using only canvas rendering to not have GL textures, or bitmapData.disposeImage () to discard the software surface once we have a GL texture ready instead. You might also try using your project without any sound, as perhaps something about the sound library inflates memory use for each sound.

1 Like

Hi,

Thank you! I will check that memory options!!! Good points!!!
I sent 2 emails to you. I just resent the mail containing the textfield test.

Best regards
Andreas

Got it :slight_smile:

Here’s the fix :grinning:

Hi,

wow!!! I will check that later today. Here its 6am! :smiley:

What I do not yet understand is why are they not selectable?
Is this maybe an error also on my side of things?

Best regards
Andreas

On Flash (and on other platforms) your first two fields appear to not be selectable, while the third field is. On Flash (since it is not selectable) it does not highlight, and the input cursor does not appear, but if you click and begin to type, you will still see input. If I set selectable = true on either field, it behaves similar to the third.

I assume this might just be something in how these are parsed, perhaps you need to set selectable = true by default when type == INPUT, unless the object specifies otherwise

1 Like

Hi,

your suggestion worked even without applying the patch. To do TextFields selectable if xml has no property about it.

Then there was a problem with TextField colors. Now it looks really good.

And there was one misinterpretation with restrict. The original code was ^><.
It blocked > and allowed only < with OpenFL whereas it did block both with Flash.
Channing it to ^<^> made it work again.

Is there a way to get current cursor position line? I need that for proper scrolling with textareas.

See here: https://github.com/andreasdr/xfl/blob/4f08c32bfd4356a220755ed1a3484f0da61b6881/openfl/controls/TextArea.hx

UPDATE:
Another thing with textfield is that up and down arrow keys are not working when using them as textarea.
And TAB is not working to switch between textfields.

Many thanx.

Best regards
Andreas

I believe you can get the current cursor line using:

var line = textField.getLineIndexOfChar (textField.caretIndex);

tabIndex is not implemented right now. It is possible that arrow keys might not change the current scroll position of the text field, but I thought it did move the caret

1 Like

Hi

textField.getLineIndexOfChar() works like a charm.
Now arrow keys just jump the cursor to last line it seems or something. It does for sure not something feasible :smile:

Many thanx and
Best regards
Andreas

Did I even say thank you @singmajesty? You are a really great, great help!!! Things get better and better.

Hi,

May I ask what state scale9 has? Its useful for certain shapes like backgrounds and buttons and such.
We will try to convert shapes to bitmap graphics anyway but I guess it still makes sense in some ways.

Best regards
Andreas

Scale 9 is not implemented yet, could be done now that cacheIsBitmap is stable, but ideal (on OpenGL) would be treating it like a Tilemap, one image, with UVs for each portion of the render

You’re welcome! Step-by-step I hope that we can help make you successful :wink:

It’s what I’d hope someone else would do for me

3 Likes

Hi,

short question. How to dispose a bitmap with a given bitmap data for GPU?
I already use disposeImage to dispose the software pixels after loading a bitmap.
Now I want to dispose the memory used in GPU when e.g. closing a window and thus disposing its bitmaps.

Best regards
Andreas

I think the browser might do that, otherwise I think that bitmapData.dispose() should discard everything (including a GL texture if its allocated)

1 Like

Hi,

while debugging memory leaks I found out that text assets In lime are cached somehow.
This is very suboptimal as we have lots of XML files containing XFL GUI definitions.
For us it would be better if they would not be cached :frowning:

Any ideas?

Thank you very much.

Best regards
Andreas

Are they automatically preloaded, or are they assets you load at runtime, later?