User Tag List

Results 1 to 5 of 5

Thread: Loading images by name (string) not by file format

  1. #1
    Clicker iOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loading images by name (string) not by file format

    In my application I want to load 2 pictures (bottom_picture and top_picture) from a folder (resources) by name not by file format.
    I have tried using Active Picture - New Picture - in expression calculator I have put Resources\bottom_picture.* where * can by any file format but without any luck.
    P.S.: If I put the extension (bottom_picture.png) the image will appear.
    Can someone help me?
    Thanks!

  2. #2
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Hi SimonBelmont,

    Unfortunately if you don't specify a 'full and complete' filename through an expression then Active Picture won't revert to a default extension.

    Instead define your extension in a global string like this:
    Global String A = bmp

    Then in the event editor do:
    "Resources\bottom_picture."+Global String A
    That will parse as
    Resources\bottom_picture.bmp

    You can then change the Global String either at Edit time (frame editor) or during Runtime.
    Want to learn Clickteam Fusion 2.5?




  3. #3
    Clicker iOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help
    I've made this.
    Global String A = bmp
    Global String B = png
    For example I want to put bottom_picture.png in the folder resources (in that folder bottom_picture.bmp exit). Your example will work for the bmp picture.
    I will rename bottom_picture.bmp (not to conflict or something) to 1.bmp.
    Now the code in expression calculator will be "Resources\bottom_picture."+Global String A OR Global String B to load the png picture (bmp picture cannot be loaded because is renamed) ?

    P.S. I want to add a list of extensions that my app will recognize. For example "Resource\bottom_picture." + bmp + jpg + png etc.

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Using the List object, you can load a file list on the path "C:\Some Directory\SomeFilename.*" and it will list all files with that name and any extension. Then you can loop through the list and load them. Using global values like that won't work in this case (I don't even know why it was suggested).
    Working as fast as I can on Fusion 3

  5. #5
    Clicker iOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks LB for your suggestion.
    I found the solution (it was simple).
    You have to use File Object and Global Strings for this.
    You must create 1 global string with a name (extension for example) but don't specify any values.
    Then you must test the files, in my case bottom_picture.png, bottom_picture.jpg, bottom_picture.bmp if exist then add a new condition "Run this event once" with the special conditions Set extension to png for bottom_picture.png, jpg for bottom_picture.jpg and bmp for bottom_picture.bmp
    When you have finished to test them add a new event with "Run this event once" then at the Active Picture Object add New picture with the expression "Resources\bottom."+extension (where extension is the global string, Resources is the folder with the pictures and bottom. is my pictures).
    I hope that you understand how I do it.
    Maybe this will help other people from the thread.

Similar Threads

  1. Loading string from file
    By manwich in forum Android Export Module Version 2.0
    Replies: 3
    Last Post: 25th May 2013, 03:51 AM
  2. Images loading from url
    By crayzorechos in forum iOS Export Module Version 2.0
    Replies: 7
    Last Post: 29th April 2013, 04:03 PM
  3. String Parser 2 - External File Loading
    By UrbanMonk in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 7th August 2012, 07:17 PM
  4. Flash Images Plus Internal File loading still doesn't work
    By Demi in forum SWF/Flash Export Module Version 2.0
    Replies: 10
    Last Post: 10th November 2011, 09:49 PM
  5. Loading images
    By Anders in forum Extension Developers Lobby
    Replies: 2
    Last Post: 11th May 2008, 06:07 PM

Posting Permissions

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