User Tag List

Results 1 to 5 of 5

Thread: [Android] Getting dynamic string from Edit data

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    739
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    [Android] Getting dynamic string from Edit data

    Hi all extension developpers,

    For the android port of Spriter, I want to get a string which is dynamically created at edit time.

    The EDITDATA structure is the following:

    Code:
    struct EDITDATA
    {
        // Header - required
        extHeader        eHeader;
    
        // Object's data
        wchar_t            scmlFilename[_MAX_PATH];
        char            scmlFile[1];//scml file buffer, dynamic size
    
    };
    The scmfile string is created like this:
    Code:
    //Update EDIDATA Structure
                DWORD dwNewSize = sizeof(EDITDATA) + strlen(scmlFile) + 1;
                // Asks MMF to reallocate the structure with the new size
                LPEDATA pNewPtr = (LPEDATA)mvReAllocEditData(mV, edPtr, dwNewSize);
    
                // If reallocation worked
                if (pNewPtr != NULL)
                {
                    // Copy the string
                    edPtr = pNewPtr;
                    strcpy(edPtr->scmlFile, scmlFile);
                }

    By createRunObject for Android, I used the follwoing:

    Code:
    scmlFileName = file.readString();
    scmlFileString = file.readString();
    but if scmlFileName is correct, the scmlFileString is empty (scmlFileString="")when I debug my example application.

    Do you have any idea how to solve this?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    739
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Hi all,

    Thanks for those who looked at this problem. I found a solution step by step in Android Studio (what a nightmare with small configuration like mine):

    Code:
    scmlFileName = file.readString(256);
    file.bUnicode=false;
    file.skipBytes(8);
    scmlFileString = file.readString();
    I do not really understand why I need to skip 8 Bytes but it seems to work with different scml files.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    739
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I also found something strange when calling act.getParamNewDirection to get a direction parameter by an action. Instead of getting an int between 0 and 31 like stated in documentation, I got the direction with power of 2: direction 0 is giving 2^0=1, direction 3 is giving 2^3=8.
    Does someone have any idea why?

    EDIT: ok, it is obvious since NewDirection parameter allows the user to choose several directions and not only one, therefore these directions is coded on 32bits, one for each direction.
    A small error in documentation for Android SDK.
    Is there a possibility in EDIF SDK to limit the number of direction to only one?

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Not to my knowledge. The official SDK files only have PARAM_NEWDIRECTION, but I'm not sure if the NEW means there was an older version or if it just references how it is used for active objects. Why do you want to limit the user to 32 directions though? Why not allow the full precision of a floating point value in degrees?
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    739
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Thanks LB for the feedback. NEW is indeed because there is an older obsolete version for older extension. Not really a good naming convention but ok. I choosed this because it seemed to be a more natural way for a user to enter a direction of animation. Just to ask for an integer would have done the job but I do not want to break the rétro-compatibility now.

Similar Threads

  1. recover edit box data
    By sylvie in forum Android Export Module 2.5
    Replies: 6
    Last Post: 4th March 2014, 08:22 AM
  2. Set edit box text to string$("string object") causes long delay
    By MJK in forum XNA Export Module Version 2.0
    Replies: 4
    Last Post: 22nd August 2012, 02:58 PM
  3. Edit data problem
    By Greg in forum Extension Development
    Replies: 3
    Last Post: 22nd September 2011, 09:45 PM
  4. How to store dynamic Edit-time data?
    By Werbad in forum Extension Development
    Replies: 2
    Last Post: 31st October 2008, 09:43 AM
  5. Dynamic data help.
    By SEELE in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 13th May 2008, 01:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •