(Stencyl 3.5 / OpenFL 6.x) Extension Modifications

mdotedot

  • Posts: 1654
Some of my (multiuser) extensions suffered from problems when using in Stencyl 3.5 (Beta)

Flash works without a problem with these URLLoader/Loader issues.

For the other publications you need to cast them:

* Error: e.target.data : IEventDisplatcher has no field data
Change code     e.target.data    to   cast(e.target, URLLoader).data
* Error: openfl.events.IEventDispatcher has no field content
Change code
e.currentTarget.content.bitmapData into:  cast(cast(e.currentTarget,Loader).content,openfl.display.Bitmap).bitmapdata;

See also: https://github.com/openfl/openfl/issues/1321

This will still work when the extension is used in Stencyl 3.4

Also some references to openfl.utils need their lime.utils counter-parts:
Change :    import openfl.utils.UInt8Array
 into:            import lime.utils.UInt8Array

This topic might be updated later when I encounter more issues.

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

yoplalala

  • *
  • Posts: 1632
You can have some extensions that work on both version of Stencyl , you can use this trick
#if (openfl >= "4.0.0")  // Thats Stencyl 3.5
import com.stencyl.Config as S;
#else
import scripts.MyAssets as S;
#end

mdotedot

  • Posts: 1654
Thanks Yoplalala,

Good to know! My issues at the moment work with the cast for both targets! But it might come in handy for other issues!
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

yoplalala

  • *
  • Posts: 1632
You'rel lucky ;)

From Openfl 4 ( Stencyl 3.5 is now at OpenFl 6)

We have removed deprecated references to openfl.gl.* and openfl.utils.* typed arrays, JNI and GL classes. You should use lime.graphics.opengl.* or lime.utils.* when using these types in your projects.


openfl.utils.JNI  => lime.system.JNI
 openfl.utils.SystemPath.applicationStorageDirectory =>  lime.system.System.applicationStorageDirectory

I'am also noticing that
Code: [Select]
var shadow:openfl.filters.DropShadowFilter  = new openfl.filters.DropShadowFilter();
__actor.filters = [shadow];

in android doesn't work anymore. The app crashes.

PS: Just noticed , maybe you were talking only about your extensions ....  But I think it could be a great thread to put find what needs to be modified for Openfl 3.6 ;)

« Last Edit: September 11, 2017, 01:08:35 pm by yoplalala »

mdotedot

  • Posts: 1654
In build 9637 the wrapper block caused this:
Code: [Select]
Unexpected problem on thread AWT-EventQueue-0: java.lang.ClassCastException: stencyl.sw.editors.snippet.designer.block.DummyField cannot be cast to javax.swing.JComponent

Justin was kind enough to help out quickly to get it resolved!


Code: [Select]
<block tag="Away3DloadGraphics" spec="Away3D : load graphics name %0 source: %1 do %2" code="Away3D.loadGraphics(~,~, function myLoadFunc(){~});" type="wrapper" color="yellow" returns="void">
                <fields>
                        <text order="0" />
                        <text order="1" />
                        <CODE_BLOCK order="2" />
                </fields>
        </block>


Remove the %2 in the spec part of the code.

I still need to confirm the use of the block in my code since I can't see anything due to another issue introduced by the new opengl/lime set.
It works.

 

« Last Edit: October 30, 2017, 07:16:04 am by mdotedot »
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

RulezTeam

  • *
  • Posts: 319
Hi,

what about these about these to work with OpenFL6 :
- import openfl.Lib;
- import openfl.display.BitmapData;
- import openfl.utils.ByteArray;
- import haxe.io.Bytes;

Should I replace openfl with lime ? Or every simgle import should be mod different from other ?
For example :
- openfl.utils.ByteArray;  -> lime.system.ByteArray ?

Thank you