Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Gideros Labs - Page 4 — Gideros Forum

Gideros Labs

12467

Comments

  • @unlying,
    with openURL you cannot attach a file (in the traditional sense) but you could in the body, send the fie as UUEncoded string, which would be part of the body.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • ar2rsawseenar2rsawseen Maintainer
    edited February 2014
    @unlying I don't think it is possible with the string, but maybe, just maybe, we could do the Dialog pugin with most popular native dialogs :-?

    @OZApps way may also work, let me check that
  • ar2rsawseenar2rsawseen Maintainer
    edited February 2014
    Hmm it seems not exactly to a body, but to a header, so might not be possible
    $attachment = chunk_split(base64_encode(file_get_contents($file))); 
    $uid = md5(uniqid(time()));
    $header = "From: ".$from."\r\n";
    $header .= "Reply-To: ".$from."\r\n";
    $header .= "MIME-Version: 1.0\r\n";
    $header .= "Content-Type: multipart/mixed; boundary=".$uid."\r\n\r\n";
    $header .= "This is a multi-part message in MIME format.\r\n";
    $header .= "--".$uid."\r\n";
    $header .= "Content-type:text/plain; charset="UTF-8"\r\n";
    $header .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
    $header .= $message."\r\n\r\n";
    $header .= "--".$uid."\r\n";
    $header .= "Content-Type: application/octet-stream; name=".$filename."\r\n";
    $header .= "Content-Transfer-Encoding: base64\r\n";
    $header .= "Content-Disposition: attachment; filename=".$filename."\r\n\r\n";
    $header .= $attachment."\r\n\r\n";
    $header .= "--".$uid."--";
  • @ar2rsawseen, that's because you are trying to make it as an attachment. My suggestion made it inline rather than an attachment and hence added to the body.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Thanks for your efforts, ar2rsawseen. I have one more question.
    Everytime I try to capture the screen from the gideros windows player running on monitor #2, I get a whole screen of monitor #1. Is there any way to get right scene from monitor #2?
  • @folded unfortunately there is no way to currently work with multiple monitors. It will take screenshot of the default (1st monitor) and look for the Gideros window and crop it out. But if it is not there, well, won't crop anything out :(
  • ar2rsawseenar2rsawseen Maintainer
    edited February 2014
    Added LuaJIT binaries to Gideros Labs (read installation instruction carefully) ;)

    http://giderosmobile.com/labs/luajit

    Likes: phongtt

    +1 -1 (+1 / -0 )Share on Facebook
  • thanks for luaJIT, will test it, when the time comes.
  • OZAppsOZApps Guru
    edited February 2014
    @ar2rsawseen, as you asked yesterday, Does anyone read the instructions ;)

    how do you use Lua JIT on the mac ;)

    =))
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • ar2rsawseenar2rsawseen Maintainer
    edited February 2014
    For the special kind of persons, posting it here: :)

    Installation desktops

    Windows

    Copy luajit.dll file from luajit folder to your Gideros installation folder (where you have lua.dll file)
    Delete lua.dll file
    Rename luajit.dll to lua.dll

    Mac OSX

    Open Gideros installation folder
    Right click on GiderosPlayer and select Show Package Contents
    Navigate to Contents/Frameworks
    Copy libluajit.dylib file from luajit folder
    Delete liblua.1.dylib file
    Rename libluajit.dylib to liblua.1.dylib

    Installation mobiles

    Prerequisites

    To make mobile project work with LuaJIT you need to make some changes to Gideros Installation and reexport the project's assets again

    Windows installation

    • Inside Gideros installation folder, go to Tools folder and rename luac.exe to luac2.exe

    Mac OSX installation

    • Inside Gideros installation folder, right click on Gideros Studio and select Show Package Contents
    • Navigate to Contents/Tools and rename luac to luac2

    Android

    Copy libs folder from luajit folder into your exported project overriding existing liblua.so files

    IOS

    Copy liblua.a from luajit folder into your xCode's project folder overriding existing liblua.a

    Reverting back

    If for some reason you want to revert back to plain lua, there are old lua binaries for each platform available in plain-lua directory

    Likes: OZApps

    +1 -1 (+1 / -0 )Share on Facebook
  • what about the samples on using luaJIT
    this is app store safe.

    so when creating the device player, the same holds true, replacing the liblua1.dylib with libluajit.dylib, right?
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • @ar2rsawseen Great!! let's take a look on how LuaJIT could boost gideros performance on this "certain" game ;)
    have fun with our games~
    http://www.nightspade.com
  • ar2rsawseenar2rsawseen Maintainer
    edited February 2014
    You would not usually create multiple desktop players, would you? :)

    Samples on using LuaJIT? well it is basically same lua, all the same code should work, maybe with some couple of differences as varargs
    function test1(...)
        print(arg) -- prints nil with luajit
    end
     
    function test2(...)
        local arg = {...}
        print(arg) -- prints table with arguments
    end
    Is it appstore ready? well I am testing and testing and testing trying finding differences, and for now I did not have found any that would crash my apps, so if you test your app and it works, I think yes you can publish an app with it :)
  • You would not usually create multiple desktop players, would you? :)
    Why not? I have multiple players on my device one as a standard player and one with plug-ins. So with the desktop player, why not? One with Lua and one with LuaJIT.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • true, that would actually be easier on Mac than on Windows :)
  • I made a player for the LuaJit and it works. But if I export a final version (with code assets) then eclipse reports it can't load the .lua files. If I replace the libs with the noe jit versions then it works again.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Yes because exported lua files are lua precompiled and luajit cant work with them, that is why there is a whole section in installation note:

    Installation mobiles

    Prerequisites

    To make mobile project work with LuaJIT you need to make some changes to Gideros Installation and reexport the project's assets again

    Windows installation

    • Inside Gideros installation folder, go to Tools folder and rename luac.exe to luac2.exe

    Mac OSX installation

    • Inside Gideros installation folder, right click on Gideros Studio and select Show Package Contents
    • Navigate to Contents/Tools and rename luac to luac2

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • Ahh, missed the bit about renameing luac, sorted now. Works. :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • @ar2rsawseen, I knew there was merit in posting the instructions here ;)

    Likes: SinisterSoft

    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
    +1 -1 (+1 / -0 )Share on Facebook
  • About Media plugin - "Love is... Photo" was accepted for Appstore.
    https://itunes.apple.com/us/app/love-is...-photo!/id815188272?l=ru&ls=1&mt=8
    So Media plugin works on iOS and Apple accept it without any problems.
    +1 -1 (+2 / -0 )Share on Facebook
  • Thanks for luaJIT, ar2rsawseen. Great.

    When I export my program to android with luaJIT, it takes much longer to start than before. I tried jit.off(true, true) but still it starts slow. Am I supposed to try something else?

    And os.tmpname() gets an error on luaJIT that cannot make an unique name, which can be trivial, FYI.
  • SinisterSoftSinisterSoft Maintainer
    edited February 2014
    I noticed it taking quite a bit longer to start too, maybe 2 or 3 seconds. Maybe it would be a good idea to have some kind of built-in splash screen (like the one with the free licence) - but where the licence holder could put their own image of a specific size.

    eg - if there is a file called 'splash.png' in assets then that would be faded in, positioned centrally if they had a proper licence before any other assets or lua are processed.

    On the good side, I did notice a big speed increase - so I now do some pre-processing on my background map to pre-merge some sprites using rendertarget. Before it took quite a while - now you don't even notice it. The bug with rendertarget taking too much memory (depends on screen scaling) is still there btw - you have to allocate new rendertargets with no screen scaling, I'll be glad when that's fixed....
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • @OZApps and not once but twice :D
    @unlying that is awesome :)
    @folded I will try to play with os.tmpname
    The longer loading might due to the fact, that previously all code was precompiled lua bytecote, but now LuaJIT compiles it everytime launching an app (and probably with all those internal optimizations that it does, it also takes some time), however it can probably optimize the code better because it knows the hardware they are on and could use some hardware specifics to make it perform even faster.

    @SinisterSoft

    The splash and icons is something that also bother us on desktop, so maybe it would be really cool to implement providing inclusion of them in the IDE and project itself, however without the additional resource, I don't see that happening any time soon :(

    And the bug is in the internal tracker and we are aware of it ;)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • Shame a quick unsupported patch couldn't be made in the meantime to put a splashscreen in though, it would explain away the luajit delay....
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Thanks. :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • I got errors on multiple lines with this:

    setContentView(R.layout.main);
    //get main layout
    final FrameLayout layout = (FrameLayout)findViewById(R.id.layout_main);
    //layout parameters
    final FrameLayout.LayoutParams adParams = new FrameLayout.LayoutParams(
    FrameLayout.LayoutParams.WRAP_CONTENT ,
    FrameLayout.LayoutParams.WRAP_CONTENT ,
    Gravity.TOP);

    // Add the Gideros view to main layout
    layout.addView(mGLView);

    Is it possible to have a complete example project export for me to compare?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Here's an example, even a bit simpler than on tutorial ;)

    But in Eclipse it is actually much easier than xcode, you hover the red line and it offers you a solution, to import this or that class. To get resources R recognizible, all you need to do is to build a project, so it can generate resource package (which it also does automatically when you try running it) ;)
    zip
    zip
    AndroidSplash.zip
    4M

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • Thanks. :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Ahh, found my mistake, not put these in:

    import android.graphics.Color;
    import android.graphics.drawable.AnimationDrawable;
    import android.os.Handler;
    import android.view.Gravity;
    import android.widget.FrameLayout;
    import android.widget.ImageView;

    import com.giderosmobile.android.player.*;
    import com.sinistersoft.martians.R; // your com.company.app here :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
Sign In or Register to comment.