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


#184

Have you seen https://github.com/HaxeExtension/extension-iap? Do you think this would cover it?


#185

Hi, very nice. Will check it!!! Thank you!


#186

Hi,

I have some code based on “DisplayingABitmap”. It looks like the following.

package;

import openfl.display.Bitmap;
import openfl.display.Sprite;
import openfl.events.MouseEvent;
import openfl.filters.ColorMatrixFilter;
import openfl.Assets;

class Main extends Sprite {

	static var PF_FILTER_BLACK_WHITE : ColorMatrixFilter = new ColorMatrixFilter([1 / 3, 1 / 3, 1 / 3, 0, 0, 1 / 3, 1 / 3, 1 / 3, 0, 0, 1 / 3, 1 / 3, 1 / 3, 0, 0, 0, 0, 0, 1, 0]);

	private function onMouseOver(event: MouseEvent) {
		cast(getChildAt(0), Sprite).getChildAt(0).visible = !cast(getChildAt(0), Sprite).getChildAt(0).visible;
		cast(getChildAt(0), Sprite).getChildAt(1).visible = !cast(getChildAt(0), Sprite).getChildAt(1).visible;
	}

	public function new () {
		super ();
		var bitmap1: Bitmap = new Bitmap (Assets.getBitmapData ("assets/openfl.png"));
		bitmap1.visible = true;
		var bitmap2: Bitmap = new Bitmap (Assets.getBitmapData ("assets/openfl.png"));
		bitmap2.visible = false;
		var bitmap3: Bitmap = new Bitmap (Assets.getBitmapData ("assets/openfl.png"));
		bitmap3.visible = true;
		var sprite: Sprite = new Sprite();
		sprite.buttonMode = true;
		sprite.addChild(bitmap1);
		sprite.addChild(bitmap2);
		sprite.addChild(bitmap3);
		sprite.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
		sprite.addEventListener(MouseEvent.MOUSE_OUT, onMouseOver);
		sprite.filters = [PF_FILTER_BLACK_WHITE];
		addChild(sprite);
		sprite.x = (stage.stageWidth - sprite.width) / 2;
		sprite.y = (stage.stageHeight - sprite.height) / 2;
	}
	
	
}

So sometimes the sprite disappears when hovering over it or leaving it with mouse pointer. On Safari/MacOSX it always disappears if switching to another application window or changing desktop and switching back after that. Or after opening/closing the console pane in the browser window.

I have a workaround for this in my code now. So I have no hurry. Thought you might be interested anyways.

Many thanx and

Best regards
Andreas


#187

Hi,

I get compilation errors when trying to compile the sample application. Any hints?

Andreass-Air:sample andreas$ openfl build android
**Error:** **Could not find haxelib "extension-iap", does it need to be installed?**
Andreass-Air:sample andreas$ haxelib install extension-iap
Downloading extension-iap-1,2,2.zip...
Download complete : 2153411 bytes in 1.1s (1847.4KB/s)
Installing extension-iap...
Current version is now 1.2.2
Done
Andreass-Air:sample andreas$ openfl build android
/usr/local/lib/haxe/lib/extension-iap/1,2,2/extension/iap/android/IAP.hx:10: characters 7-23 : Type not found : openfl.utils.JNI
Andreass-Air:sample andreas$ ls
README.md application.xml assets bin certificates openfl-readme.txt src
Andreass-Air:sample andreas$ openfl build android application.xml
**Error:** **You must have a "project.xml" file or specify another valid project file when using the 'build' command**
Andreass-Air:sample andreas$ openfl build application.xml android
/usr/local/lib/haxe/lib/extension-iap/1,2,2/extension/iap/android/IAP.hx:10: characters 7-23 : Type not found : openfl.utils.JNI
Andreass-Air:sample andreas$

Many thanx and

Best regards
Andreas


#188

Hi,

Ok. Fixed it by manually compile master branch and using install.sh.

Many thanx and

Best regards
Andreas


#189

Sorry about that,

You should be able to use haxelib dev extension-iap path/to/your/git/repository and lime rebuild extension-iap ios to rebuild the binaries


#190

Hi,

short question. I can not get the example to work regarding payment. I can click a package to buy but then nothing happens. The console states:

I/trace   (13326): Store.hx:145: IAP: Available: true
I/trace   (13326): Store.hx:156: initFailed
...
I/trace   (13326): Store.hx:101: gold_x_1k
I/trace   (13326): Store.hx:382: PURCHASE WITHOUT IAP - productID: gold_x_1k

Which Android API level do I need to use? I have a FireOS tablet. Maybe its too outdated. Hmm. Which android version is required?

Many thanx and

Best regards
Andreas


#191

Hi,

Ok. Seems like my tablet is to old as Google Pay was introduced in 2015/2016. My tablet is from 2014 if I remember right.

Update: Android 5 is required. My tablet has 4.x.

Many thanx and

Best regards
Andreas


#192

I haven’t tried this in a long time, but I think there is something you may need to do on your account to make sure that purchasable items are set up, then devices may need to run in a special sandbox in order for your demo items to be available to “buy.”

Also, I believe that Amazon devices lack Google Play Services, so purchasing there must be done using another API. I thought I heard of a company that added Amazon support to extension-iap, though, but didn’t contribute it back. I could try and hunt it down if you need it


#193

Hi,

I will try to get a plain Android tablet. No need to support Amazon Fire tablets I guess. Would be nice still. But not required for now.

I will come back to you If I have problems with a ordinary Android tablet.

Many thanx and

Best regards
Andreas


#194

Hi,

Regarding disappearing display object containers I have this bug at multiple places and there is one I know I cannot solve on my own.

Any help is highly appreciated. I also think that this bug is kind of new.

Many thanx and

Best regards
Andreas