NickRimer's Recent Forum Activity

  • I have images on local. I can load them to sprite.

    I need to to save them all to another place.

    Maybe in one folder. Maybe to compress them and save like one file data (zip or smth. else).

    What variant could you reccomend? My decision is below but it's not so good as I want.

    ----- MY WAY (very bad)

    Use plugin "jsZip" by Noncentz705

    Use behavior "Extract sprite to base64 string" by Pode

    1. Sprite -> Load image from URL (FileChooser.FileURLAt(0))
    2. Sprite.ExtractImage.currentImage
    3. jsZip.AddImage ...
    [/code:2donmpr5]
    
    What is bad? Step 2!
    
    Step 2 is long. Image is not big, but conversion takes several seconds. And all program is in idle (fps 0 and so on)! Harder image - harder base64 - more time - more weight.
    You can try. In attachment you can find 2 different images jpg 53kb. One is mtg card, another is excel icon.
    After zipping mtg card picture in archive will be too big (it is a result of step 2) - 53 Kb image converts to 300 Kb image. Not so good.. But 53 kb of icon converts great to 48 kb..
    
    Take file from here: http://rghost.ru/6J6Xk7jMK
    Sorry, it's in russian. just click on BLACK button 'Скачать'
  • Noncentz705

    Hello!

    I'm trying to zip images loaded with FileChooser this way:

    1. Pick file 001.jpg (53 Kb) with FileChooser
    2. Create archive with tag "img"
    3. Add image with dataURL 'FileChooser.FileURLAt(0)' with name "001.jpg" to archive with tag "img"
    4. Invoke download archive with tag "img" with name "archive.zip" (no matter Compression is true or false)
    [/code:2k3ggz9w]
    And then I have archive.zip (1 Kb) with file 001.jpg (48 bytes) inside and of course image is bad, no data.
    
    Image is correct and has image/jpeg MIME type.
    FileChooser.FileURLAt(0) is correct too, because Sprite loads it well with Sprite - Load Image from URL action.
    
    Where am I wrong? What is wrong? What did I forget?
    
    P.S. And also what mean actions Clear Texture and Get Texture?
    
    ---------------------------- UPDATE
    
    I've just understand my mistake. URL is not dataURL.
    Now I make an image conversion to base64 string with "Extract sprite to base64 string" plugin by @Pode and all works good.
    
    Another question is: any ways to make dataURL? For example without base64.
    53 Kb image converts to 300 Kb image. It's very BAD!!!
  • lennaert

    With FileChooser I can take a FileChooser.FileURLAt(0) after picking the file.

    But if I store this "URL" and then will try to access file with this link in another session - it's a bad way. Because it will be incorrect link.

    On the other way FileChooser.FileNameAt(0) gives just a filename and no path to it. So I can't find this file next time knowing just its name even in this session..

    I need to save some path to local file to access it in any session (of course with condition that file is in its place)

    In NodeWebkit it's easy. What about other platforms?

  • 53 Kb JPEG picture loads to sprite and then converts (with 5-6 seconds idle and 0 fps) into 400 kb text data..

    I'm just trying to understand the meaning of this procedure..

    It's a pity.. a had a lot of hopes on this conversion

  • The first part is about URL-checking system.

    What do I have?

    A list of URLs

    What do I need?

    Check every URL:

    1. It is an IMAGE

    2. There is no request errors on it

    Result?

    If they are all images and there are no errors - message 'All is OK'

    On any error - mark bad URLs with error type (not an image or 404 or ...)

    ----------

    The second part is about localfile's links

    What do I have?

    Several files on disk. Platform may be Browser, PC, Android, iOS.

    What do I need?

    1. Take path for every file like an URL or with other method to have access to them at any time with this link.

    2. Not to take path if it is not an image

    Common result is:

    save list of urls and file paths to a file

    I will attach my project file soon, you'll see what I have done (can't do it right now). But I can't make it to be universal for every platforms. Also I'll write you my problems. I've tried to make it for several hours, and no good results..

  • Aphrodite

    Hmmm.. well.. simple way..

    Thank you a lot!

  • Error has gone. And now I need to up this topic, because pictire is uploaded. Please, answer the question if you can.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Look at this forum screenshot and tell me is it possible? I can't find how.

    It can be very useful if you want to separarte answers for several people.

  • Yeah, I know tokenat expression.. and I just forget about it.

    Thank you! I think it will be better using it with tokencount at the same time!

    Question with edittime is opened.

    No ways to edit Text object row-by-row? Only using Set text action?

  • I understand that question maybe very-very easy but I can't formulate my search query correctly.

    I'm not a newbie in construct but I never need to solve this kind of problem earlier.

    The question Is about how to divide string into parts with newline divider. But without it.

    Example: This is a string in some .json file - "Hello, Commander! Let's do businness blah-blah-blah. Good Luck, Commander!"

    I want to read it and apply to Text object, but to make phrase "Good Luck, Commander!" on a newline.

    No problems with reading. How to make a newline? Is there a way to replace text with some special symbols (for example, in Pascal it was #13+#10) to make it happen?

    IMPORTANT! Arranging and reading 2 different strings and divide it with newline expression IS NOT A VARIANT!!! String is solid. We need to tear it apart with something, that can replace newline.

    The other question is how to make this through edittime?

    In Construct Classic for Text object we can open small window with MemoBox and write all text we want, needed amount of strings etc.

    In C2 we have just 1 string TEXT.. and no ways to put newline string here. Or there are some ways? Can you help?

  • This I know by myself.. My question was direct.

    Webfonts. On first layout. Check it was loaded. And only after it - show scene.

  • Hello!

    I think most of you knows how to use and install webfonts to use in projects.

    But all we know that loading and applying this fonts happens AFTER project preloading.

    So if we have Text object on first layout users will see OLD font and after some seconds - NEW font.

    Font-files are integrated into project, but we have some delay anyway.

    Of course we can use a show-delay before game start but can we guess certanly about delay value?

    For example, on my computer it can take ~1 sec. And what if on other is 2 or more?

    Any ways to speed-up their loading? Or ways to determine that fonts have already loaded.

    How this problem is solved by you?

NickRimer's avatar

NickRimer

Member since 3 Feb, 2015

None one is following NickRimer yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies