Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RedEvo

Pages: 1 ... 8 9 10
136
Extension Ideas / Not same lib for iphoneos and iphonesim [QUESTION]
« on: November 15, 2013, 06:35:49 pm »
Dears,
I'm working on Android and iOS Facebook Extension on OpenFL platform, starting from GeorgeN Android Facebook extension.
After studing OpenFL and iOS dynamics and taking inspiration from AdMob Extension from Abliblablobla I'm able to compile an OpenFL Facebook extension for iOS. But I can compile it only for device or for simulator, I can't compile in both way.

Facebook iOS SDK do not supply a .a lib like AdMob. To obtain libfacebook_ios_sdk.a you must compile source. During compile I'm able to obtain many types of libfacebook_ios_sdk.a:

Code: [Select]
.//Debug-iphoneos/libfacebook_ios_sdk.a
.//Debug-iphonesimulator/libfacebook_ios_sdk.a
.//Debug64-iphoneos/libfacebook_ios_sdk.a
.//Debug64-iphonesimulator/libfacebook_ios_sdk.a
.//facebook-ios-sdk.build/Debug-iphoneos/facebook-ios-sdk.build/Objects-normal/armv7/libfacebook_ios_sdk.a
.//facebook-ios-sdk.build/Debug-iphoneos/facebook-ios-sdk.build/Objects-normal/armv7s/libfacebook_ios_sdk.a
.//facebook-ios-sdk.build/Release-iphoneos/facebook-ios-sdk.build/Objects-normal/armv7/libfacebook_ios_sdk.a
.//facebook-ios-sdk.build/Release-iphoneos/facebook-ios-sdk.build/Objects-normal/armv7s/libfacebook_ios_sdk.a
.//Release-iphoneos/libfacebook_ios_sdk.a
.//Release-iphonesimulator/libfacebook_ios_sdk.a
.//Release64-iphoneos/libfacebook_ios_sdk.a
.//Release64-iphonesimulator/libfacebook_ios_sdk.a

but I cannot obtain a libfacebook_ios_sdk.a working for both iphoneos and iphonesimulator.
Under Release-universal folder I have a file without extension called FacebookSDK. I do not know, I'm a noob in iOS programming, if there's a way to get out a "universal" .a library from this file.

Anyway I'm thinking to solve the problem using tags in include.xml file using different tags to import libfacebook_ios_sdk.a for iphonesim and iphoneos.
I do not know if it's possible with OpenFL or Stencyl tags but I want to write something like that:

Code: [Select]
    <dependency name="ndll/iPhone/iphoneos/libfacebook_ios_sdk.a" if="iphoneos" />
    <dependency name="ndll/iPhone/iphonesim/libfacebook_ios_sdk.a" if="iphonesim" />

Obliviously these dependancy are not correct. Someone known if there's a good way to do that?

Hope this post can explain well issue I'm trying to face. Please ask me about eventual not clear part.
Thanks in advance for help and for your time, David.

137
Extension Ideas / Re: Tapjoy Extension
« on: October 16, 2013, 07:48:03 am »
To integrate Tapjoy in Stencyl there are some non minimal changes to AndroidManifest.xml and build.xml:

AndroidManifest.xml:
Code: [Select]
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14"/>
instead of
Code: [Select]
<uses-sdk android:minSdkVersion="8"/>
build.xml:
Code: [Select]
<property name="target" value="android-14"/>instead of
Code: [Select]
<property name="target" value="android-8"/>
These changes are mandatory because Tapjoy use some configChanges (screenSize) attributes in activity introduces in API 13. I prefer API 14 because is Android 4 and not Android 3

After these changes the app compile and correctly run in my S2-4.1.2 and in my S2-2.3.5. Anyway I do not know nothing about impact in general aspects of app (performance, leaks and so on).

Jon, or any other people have experience in this aspect of Stencyl, do you consider an risk to compile and distribuite the Android App using these AndroidManifest and build?

Thanks, David.

138
Extension Ideas / Re: Tapjoy Extension
« on: October 04, 2013, 06:21:08 am »
I'm looking at your Facebook extension and I'm taking inspiration to make someting like that in order to integrate Tapjoy in Stencyl.

Unfortunately last Tapjoy sdk, declared compatible with sdk8 and Froyo 2.2 android, is not compatible with sdk8 cause using tags in AndroidManifest.xml compatible only with sdk>=13.

They are looking how to solve this issue.
I'm going to work again on Tapjoy Stencyl extension when they solve this issue.

David.

139
Extension Ideas / Re: Tapjoy Extension
« on: September 30, 2013, 01:10:52 pm »
Thanks for your experience sharing. Is not a problem for me to work directly on templates and so on. The only way to integrate them on Stencyl is work directly on Stencyl features? I wish to improve Stencyl community with Tapjoy extension...

Anyone have some others suggestions to try to make a Tapjoy extension?

Thanks, David.

140
Extension Ideas / Tapjoy Extension
« on: September 30, 2013, 08:01:20 am »
Dears,
I need to start to work to Tapjoy extension for Stencyl, I'm going to start from Android integration.

I've a couple of questions before:
1. Is anyone working on it?
2. Looking on getting started guide of Tapjoy for Android you can see they ask to modify some code in Manifest and First Activity. Is there a way to insert them at runtime using haxe/OpenFL coding or I should modify AndroidManifest and GameActivity in nme/......./templates ? It's no very easy to make a sharable Stencyl Extension if I must operate in this way.

Any suggestions are welcome!
Thanks, David.

141
Extension Ideas / Extension package
« on: August 20, 2013, 02:46:00 pm »
Dears,
in extensions is there a way to use a different package other than
Code: [Select]
package ;
Thanks, David.

142
Resolved Questions / Re: Help with Android native Extension
« on: June 26, 2013, 03:59:14 am »
This happen when I sacrifice my sleep to work. And I must admin with my self that is too much time I develop code using only complex IDEs.

Thanks a lot George!
David.

143
Resolved Questions / Help with Android native Extension
« on: June 25, 2013, 05:33:30 pm »
Dears,
I've produced this android extension:
IosUtils.java
Code: [Select]
import android.os.Environment;
import java.io.File;
import android.util.Log;

public class IosCache
{
public static String getFolderPath(){
File f = Environment.getDownloadCacheDirectory();
Log.w("ppppppppp",f.getName());
        return f.getName();
}
}

with this IosUtils.hx
Code: [Select]
package;

#if android
import nme.JNI;
#end

class IosUtils
{

public static function getCacheFolder():String
{
var folder:String = "";
#if(cpp && mobile && !android)
folder = iosCache()+"/Caches";
#end

#if android
if (jni_get_android_path == null) {
jni_get_android_path = JNI.createStaticMethod("IosUtils", "getFolderPath", "()Ljava/lang/String;",true);
}
trace (jni_get_android_path());
folder = jni_get_android_path();
#end
return folder;

}


#if(cpp && mobile && !android)
private static var iosCache = nme.Loader.load("ios_cache", 0);
private static var haxeLog = nme.Loader.load("haxe_log",1);
#end

public static function myTrace(toBeLogged:String) {
#if (mobile && !android && !air)
#end
#if (!(mobile && !android && !air) )
trace(toBeLogged);
#end
}

#if android
private static var jni_get_android_path:Dynamic;
#end

}

Trace result is this:
Code: [Select]
[LOG] I/trace ( 6251): IosUtils.hx:21: null

During tries I've noticed that it seems jni_get_android_path() doesn't call the java correspondent function getFolderPath.

Can someone have an idea to try to solve this miscalling?
To be sure that java part is compiled as well I've decompiled the IosUtils.class in [WORKSPACE]/games-generated/[YOUR GAME]/Export/android/bin/bin/classes/ and is the same.

Attached you can find the extension, compiled.

Thanks a lot, David.

144
Suggestion Archives / About automatic scaling
« on: June 06, 2013, 11:46:12 am »
My idea is preserve the cocoa approach and permit only to show the available scale assets.
To implement this I improvise a part because I do not have instruments to enter directly in MyAssets.hx file produced automatically by Stencyl.

First of all I create a class in order to select the better available scaling factor. In this class I include my improvisation regardin available scaling factor surveing, they are the same available in game.xml file.

Code: [Select]
package scripts;

import com.stencyl.Engine;

class AvailableScales
{   
private static var availableScales:Hash<Float>;

  public function new()
{
}

public static function getBetterScale(screenWidth,screenHeight) {
var ratio:Float = getRatio(screenWidth,screenHeight);
trace("ratio: "+ratio);
var retScale:Float = 0.0;
var distance:Float = 1000.0;
for (scale in getAvailableScales()) {
var tempDist:Float = ratio-scale;
trace("tempDist"+scale+": "+tempDist);
if (tempDist<distance && tempDist>=0) {
distance = tempDist;
retScale = scale;
}
}
return retScale;
}

private static function getRatio(availableW:Int,availableH:Int):Float{
var ratioX:Float = availableW/maxAvailableAssetX;

var ratioY:Float = availableH/maxAvailableAssetY;
ratioX= trunk1(ratioX*4);
ratioY= trunk1(ratioY*4);
trace("ratioX: "+ratioX);
trace("ratioY: "+ratioY);
if (ratioX<ratioY) return ratioX;
else return ratioY;
}

private static function getAvailableScales():Hash<Float>{
availableScales = new Hash<Float>();
availableScales.set("1x",1.0);
availableScales.set("1.5x",1.5);
availableScales.set("2x",2.0);
availableScales.set("2.3x",2.3);
availableScales.set("4",4.0);
return availableScales;
}
private static var maxAvailableAssetX:Int = 1920;
private static var maxAvailableAssetY:Int = 1280;

private static function trunk1(number:Float):Float {
return (Std.int(number*10)/10);
}

}

Then I've add this line to Universal.hx in #if(mobile && !air), at the end in order to set Engine.SCALE dinamically:

Code: [Select]
        Engine.SCALE = scripts.AvailableAssets.getBetterScale(stageWidth,stageHeight);
Engine.IMG_BASE = scripts.AvailableAssets.getBetterScale(stageWidth,stageHeight)+"x";

I've tried in a asusTF101 with a real screen size 1280x752 and 2.3x will accepted and rightly scaled in all parts tests, only on android and only with no collision.

Hope is useful and hope this can be part of the solution of android resolution problems.
David.


145
Fixed Bugs (3.x) / Re: Code Syntax Button
« on: June 06, 2013, 06:30:55 am »
Sorry for delay in answering, I've lost this post.
Yes this is my case.

Thanks, David.

146
Fixed Bugs (3.x) / Code Syntax Button
« on: May 22, 2013, 02:27:07 am »
I use very much Check Syntax Button to check the code in codemode behaviors.
Is possible to tie it to Platform dropdown list like Test Game Button?
Check Syntax button seems provide only syntax check for Flash target.

Thanks, David.

Pages: 1 ... 8 9 10