Profile

Member Since
October 10, 2011

Search Members

  

rocks

35
@

Badges

This user hasn't earned any badges yet.

Posts

Viewing 1 to 20 (35 Total)

Re: StablexUI

Great work! I like your framework, finally I find a featuresui replacement in Haxe!

My suggestions:

1. The compile-time xml -> UI conversion is really cool, yet some time run-time conversion is also useful, e.g. update the UI theme from network. Maybe you can extend the framework to enable both compile-time ui genaration & run-time ui generation.

2. Hope a string externalizing solution to be included in this framework, e.g. like in android, id="@string/btnName"

Regards,
Rocks

Posted on February 20, 2013 at 8:40 PM

Re: TouchEvent not works on flash target but on iOS

Hi, I think flash support MouseEvent only in NME.

Posted on January 10, 2013 at 10:29 PM

Re: Intellij IDEA debugging

Hi imp,

Thanks for point me to the issue, now I can go through by move all java source files to another folder (disable external compilation gave me another error message).
BTW, in debug configration dialog, actually I cannot manually select the file to launch, in both "Alternative executable" & "Custom file to run", the message is "You cannot use custom executable in case of using NME". But it's ok since I can get the right swf file launched if I click the run button, it looks the haxe plugin can detect where the executable is, it's great!

Best Regards,
Rocks

Posted on January 09, 2013 at 11:24 PM

Re: Intellij IDEA debugging

Hi imp,

I've seen this screenr before however it is a little bit out of date, and it does not show how to create a run configuration for debugging.
I've tried some times, and always failed by a JDK related error, quite odd. I've upgraded to build 123.100.

Rocks

Posted on January 09, 2013 at 12:09 AM

Re: stopPropagation and stopImmediatePropagation not working on android

this seems a NME defect, here's my workaround, it uses Reflect to directly modify the private field of Event instance:
#if cpp
Reflect.setField(e, "nmeIsCancelled", true);
#else
e.stopPropagation();
#end

Posted on December 07, 2012 at 11:26 AM

Need a flash magic to access superclass field from overried getter/setter

I am working on a game engine and need the capability to moniter or change properties of flash native object (e.g. Sprite.x).
"@:getter(x)" and "@:setter(x)" is what I needed, however when I was trying to access this.x within getter/setter, I've got stack overflow error.
And if I change to super.x, the code is not compile at all.
I found a defect about this in googlecode issue tracker (http://code.google.com/p/haxe/issues/detail?id=301), and it was closed as "Wontfix", however I think this is definitely an import requirement for some developers, and also, the lack of capability to access super class field will significantly limit the usability of "@:setter" & "@:getter".

Posted on October 26, 2012 at 12:33 AM

Re: Patch for non ascii character input (from soft keyboard) in Android

Hi fjgarces,

Thanks a lot for your great work! It does work for Chinese, I've been searching for this solution for long time.
For some Chinese input method, it's very likely that more than one characters are input at the once, e.g. one with speech-to-text engine support.
So I did some changes to your code to enable multiple characters support.

@Override
public boolean onKeyMultiple(final int inKeyCode, int repeatCount, KeyEvent event) {
String s = event.getCharacters();
if (s == null || s.length() == 0) return super.onKeyMultiple(inKeyCode, repeatCount, event);
final char[] cc = s.toCharArray();
int cnt = 0;
for (int i = cc.length; --i >= 0; cnt += cc[i] != 0 ? 1 : 0);
if (cnt == 0) return super.onKeyMultiple(inKeyCode, repeatCount, event);
final MainView me = this;
queueEvent(new Runnable() {
// This method will be called on the rendering thread:
public void run() {
for (int i = 0, n = cc.length; i < n; i++) {
int keyCode;
if ((keyCode = cc[i]) != 0) {
// Simulate key down and up...
me.HandleResult(NME.onKeyChange(keyCode, true));
me.HandleResult(NME.onKeyChange(keyCode, false));
}
}
}
});
return true;
}

Posted on September 29, 2012 at 10:28 AM

Re: How to enumerate fonts on Android?

Hi altef,

Thanks a lot! Your information is really useful!

Posted on May 09, 2012 at 8:59 AM

How to enumerate fonts on Android?

I've just found that Font.enumerateFonts() is not available on cpp/android target, is this a defect or intended?
And is there any idea about how to detect the default font on android devices?
Thanks!

Posted on May 08, 2012 at 10:58 AM

Re: Multi-touch on Android

multi-touch does work on my Android 2.3 phone, did you test the multi-touch sample project in NME?

Posted on March 26, 2012 at 11:13 AM

Re: Defects in Tilesheet.drawTiles

Hi,
Thanks for the benchmark project, it's really helpful.
I've fixed the defect, now in my machine the demo runs on 55~60 fps with 250 bunnies, approximately 1/10 of neko target (I can get 55~60 fps in neko with 2500 bunnies).
I've attached the fix as an interim solution, and I am thinking about a faster way, maybe a big image cache of the most frenquently used tiles, so that the render can be done in one or several drawTriangles calls.

Rocks

Posted on February 11, 2012 at 10:00 AM

Re: Defects in Tilesheet.drawTiles

Hi,
Thanks for the benchmark project, it's really helpful.
I've fixed the defect, now in my machine the demo runs on 55~60 fps with 250 bunnies, approximately 1/10 of neko target (I can get 55~60 fps in neko with 2500 bunnies).
I've attached the fix as an interim solution, and I am thinking about a faster way, maybe a big image cache of the most frenquently used tiles, so that the render can be done in one or several drawTriangles calls.

Rocks

Attachments: Tilesheet.hx
Posted on February 11, 2012 at 9:56 AM

Re: Defects in Tilesheet.drawTiles

Thanks Philippe,
Have you tried the optimized version? in this version the copy copying is change-based, while in previous version it's frame-based.
Yes even after the optimization, it's still a slow approach, I'm thinking about your idea.
I cannot re-produce the defect - only one (the last?) bunny is visible, can you please send me your project for testing? Thanks!
Here's my email: rockswang@gmail.com

Posted on February 10, 2012 at 12:55 PM

Re: Defects in Tilesheet.drawTiles

Hi, please use this optimized version.

Attachments: Tilesheet.hx
Posted on February 10, 2012 at 3:23 AM

JPG image is not loaded in Android target

Hi,
Assets.getBitmapData() doesn't work correctly for JPG image in android target, while in neko/flash/windows JPG is ok.
in Android, the returned value of Assets.getBitmapData() is not null but a bitmap data instance with its width & height equals 0.
The test image is attached.

Attachments: 2.jpg
Posted on February 10, 2012 at 3:05 AM

Re: Defects in Tilesheet.drawTiles

I've just made some changes in Tilesheet.hx to fix these two defects for flash target, and I also added an implementation of color-transform (i.e. to enable TILE_RGB & TILE_ALPHA flags). It's doing the color-transform on the copies of original bitmap data, so might not be a fast approach, but at least now drawTiles behaves the same across the targets.
Please see attachment.

Attachments: Tilesheet.hx.txt
Posted on February 08, 2012 at 10:06 AM

Re: Defects in Tilesheet.drawTiles

My fix to defect 2:
...
var tile = tiles[tileID];
var centerPoint = tilePoints[tileID];
var ox = centerPoint.x * tile.width, oy = centerPoint.y * tile.height;

var scale = 1.0;
var rotation = 0.0;
var alpha = 1.0;

matrix.tx = x - tile.x - ox;
matrix.ty = y - tile.y - oy;

// need to add support for rotation, alpha, scale and RGB

graphics.beginBitmapFill (nmeBitmap, matrix, false, smooth);
graphics.drawRect (x - ox, y - oy, tile.width, tile.height);
...

Posted on February 08, 2012 at 3:26 AM

Re: Defects in Tilesheet.drawTiles

My fix to defect1:
...
if (rotation != 0)
{
var kx = tilePoint.x * tileWidth;
var ky = tilePoint.y * tileHeight;
var akx = (1 - tilePoint.x) * tileWidth;
var aky = (1 - tilePoint.y) * tileHeight;
var ca = Math.cos(rotation);
var sa = Math.sin(rotation);
var xc = kx * ca, xs = kx * sa, yc = ky * ca, ys = ky * sa;
var axc = akx * ca, axs = akx * sa, ayc = aky * ca, ays = aky * sa;
vertices[offset8] = x - (xc + ys);
vertices[offset8 + 1] = y - (-xs + yc);
vertices[offset8 + 2] = x + axc - ys;
vertices[offset8 + 3] = y - (axs + yc);
vertices[offset8 + 4] = x - (xc - ays);
vertices[offset8 + 5] = y + xs + ayc;
vertices[offset8 + 6] = x + axc + ays;
vertices[offset8 + 7] = y + (-axs + ayc);
}
...

Posted on February 08, 2012 at 3:25 AM

Defects in Tilesheet.drawTiles

1. In flash version, rotation behaves weird, image are stretched.
2. In flash version, the non-transformed (that means useScale & useRotation etc. are all false) tiles are drawed without considering the center point.

Posted on February 08, 2012 at 12:48 AM

Re: drawTiles behaves differently on flash and cpp target

Sorry, please ignore the content of this report, I just read the drawTiles source code again, and found that the defect is in the branch of non-transform drawing (i.e. drawRect not drawTriangle), it looks the centerPoint is not used in the logic, if I use SCALE flag it works as expected.

Posted on February 06, 2012 at 12:45 PM
« Previous12Next »