Just implemented support for lower frame-rates, so we can knock that off the list
@singmajesty I ran into an issue. The legacy SharedObject uses these two classes:
sys.FileSystem;
sys.io.File;
However, I have no idea where they are. I looked in the openfl as well as lime packages but canāt find any sys namespace, and itās not located in root of haxelib either. A hint?
Thanks ibilon!
Just downloaded OpenFL 3.0.6 and there are some changes where instead of using sys.io.File, itās using openfl.filesystem.File. Iāll continue with that.
sys.io.File
sounds right, you just need to #if sys #end
around the import, so it doesnāt break Flash or HTML5 compilation
What, but it complained that sys.io.File didnāt have the property applicationStorageDirectory! Which indeed it doesnāt. So we do need a separate openfl.filesystem.File, which Iāve copied over from _legacy.
Iām trying to build it now to see if loading the shared object works. But Iām having some issues with my dev environment. I forked openfl, then set up the local repository in my /usr/lib/haxe/lib/openfl, so I have it in a folder named dev, right next to my 3,0,6. I thought I could haxelib set openfl dev
but then when I try to run openfl test mac
, it fails: āError: Could not find haxelib āopenflā, does it need to be installed?ā I get the same result just by running openfl
in Terminal. Is there any guide on setting up for contributing?
applicationStorageDirectory can be found in lime.system.System
http://docs.openfl.org/lime/system/System.html
Maybe doing a haxelib dev openfl dev
would work better.
Iāve also just done an initial implementation of the GameInput API
Thanks ibilon, Iām a noob! Iām now properly set up with dev environment
lime.system.System.applicationStorageDirectory is a string, while openfl.filesystem.File.applicationStorageDirectory is a File instance. The file instanceās nativePath is what is used in legacy, but thereās an inconsistency:
System.applicationStorageDirectory -> /Users/x/Library/Application Support/Xavier Stamps-Lafont/TheMission/
File.applicationStorageDirectory. nativePath -> /Users/x/Library/Application Support/TheMission
So System uses the company attribute from the project.xml meta element and the title attribute to form the path, while File only uses the title attribute. Iām finding it in Lime, but a bit shaky about modifying it since I donāt know what all the implications areā¦
Should the application storage use the company/title in the path, or just the title?? I would think the title, both because itās a bit clearer file structure, and because it would maintain backwards compatibility. But probably itās a call for @singmajesty
Currently using this C++ code (with SDL2) to get the storage path:
I suppose we could test and see what happens if the company is set to an empty string, to see if it matches. I wonder, though, how it compares on mobile
Hey I got it to load my shared object data!
For testing it, I changed this:
To:
return lime_system_get_directory (SystemDirectory.APPLICATION_STORAGE, āā, file);
And that loaded fine. The path ended up being like /Users/x/Library/Application Support//TheMission///ControlsConfig.sol but the extra / are ignored.
Iām not sure about mobile. I canāt spend much time on this, if itās fine to just get it working on desktop (assuming itās consistent across Mac/Windows/Linux?) and make a pull request for that, then somebody else can resume for other platforms.
Also, are there unit tests for these?
Thatās fine, get it working for desktop (perhaps #if desktop on the Lime change) and send over the pull requests. We can always continue to tune things as we go
Hmm I donno if itās that simple, the conditional in the Lime change. Currently itās like this:
Does desktop target mean cpp and neko only? I canāt seem to find the conditional compiling documentation on OpenFL anymore.
Thatās fine, I forget, I thought #if desktop was defined, but honestly we should have an #if cffi or perhaps we should consider using #if sys for these
Oh, I meant #if desktop
because Iām not sure this applies to mobile, for example:
lime_system_get_directory (SystemDirectory.APPLICATION_STORAGE, #if desktop "" #else company #end, file);
Hm Iām still not sure what conditions to use. Itās odd to have this:
#if (cpp || neko || nodejs)
return lime_system_get_directory (SystemDirectory.APPLICATION_STORAGE, #if desktop "" #else company #end, file);
#else
return null;
#end
Itās odd to have these conditionals within each other, also makes it difficult to read the code. Iād rather:
#if (desktop)
return lime_system_get_directory (SystemDirectory.APPLICATION_STORAGE, "", file);
#elseif (nodejs || ?????)
return lime_system_get_directory (SystemDirectory.APPLICATION_STORAGE, company, file);
#else
return null;
#end
Isnāt there documentation for what all conditionals there are?
You could do the latter if you want, keep it as #elseif cpp || nodejs
Sorry about the really late response, been very busy recently.
I updated to latest Lime and OpenFL so that I could continue on this SharedObject stuff, but now have some other issues.
Primarily the text is placed differently, which is very odd. It seems the actual TextFields are placed at double the x and y values that are set, and maybe the width and height are also reported as double what they used to be in -Dlegacy. I get these traces when compiling:
Could not find primitive lime_cairo_set_font_face__2.
Could not find primitive lime_cairo_set_font_size__2.
Could not find primitive lime_cairo_set_font_options__2.
Could not find primitive lime_cairo_get_font_options__1.
Could not find primitive lime_cairo_show_text__2.
Could not find primitive lime_cairo_rotate__2.
Could not find primitive lime_cairo_scale__3.
Could not find primitive lime_cairo_ft_font_face_create_for_ft_face__2.
Could not find primitive lime_cairo_font_face_destroy__1.
Could not find primitive lime_cairo_font_options_create__0.
Could not find primitive lime_cairo_font_options_get_antialias__1.
Could not find primitive lime_cairo_font_options_get_subpixel_order__1.
Could not find primitive lime_cairo_font_options_get_hint_style__1.
Could not find primitive lime_cairo_font_options_get_hint_metrics__1.
Could not find primitive lime_cairo_font_options_set_antialias__2.
Could not find primitive lime_cairo_font_options_set_subpixel_order__2.
Could not find primitive lime_cairo_font_options_set_hint_style__2.
Could not find primitive lime_cairo_font_options_set_hint_metrics__2.
Could not find primitive lime_buffer_get_native_pointer__1.
Do I have to rebuild something for the text to work properly?
The other issue I already mentioned earlier in this post, my input layer isnāt working properly, Iāll look into that.
Are you using source? If so, make sure you git submodule init && git submodule update
and rebuild
Or try a newer version, your error looks like something that was fixed